[gtk/matthiasc/for-master: 8/8] Add reftests for center layout
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 8/8] Add reftests for center layout
- Date: Mon, 24 Aug 2020 16:03:37 +0000 (UTC)
commit c890d5991c7ab24c019ae12ad04a59869495554f
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Aug 24 12:02:34 2020 -0400
Add reftests for center layout
Add a test that checks behavior with invisible children,
and another one that ensures we go back to box-like
layout if min-size is forced.
.../reftests/centerlayout-invisible-child.css | 3 +++
.../reftests/centerlayout-invisible-child.ref.ui | 21 +++++++++++++++++
testsuite/reftests/centerlayout-invisible-child.ui | 27 ++++++++++++++++++++++
testsuite/reftests/centerlayout-minsize.css | 3 +++
testsuite/reftests/centerlayout-minsize.ref.ui | 26 +++++++++++++++++++++
testsuite/reftests/centerlayout-minsize.ui | 27 ++++++++++++++++++++++
testsuite/reftests/meson.build | 6 +++++
7 files changed, 113 insertions(+)
---
diff --git a/testsuite/reftests/centerlayout-invisible-child.css
b/testsuite/reftests/centerlayout-invisible-child.css
new file mode 100644
index 0000000000..9e5d48a484
--- /dev/null
+++ b/testsuite/reftests/centerlayout-invisible-child.css
@@ -0,0 +1,3 @@
+box {
+ border-spacing: 10px;
+}
diff --git a/testsuite/reftests/centerlayout-invisible-child.ref.ui
b/testsuite/reftests/centerlayout-invisible-child.ref.ui
new file mode 100644
index 0000000000..fc1055a55a
--- /dev/null
+++ b/testsuite/reftests/centerlayout-invisible-child.ref.ui
@@ -0,0 +1,21 @@
+<!-- check that an invisible child does not influence the layout -->
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow" id="window_information_collection">
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkCenterBox" id="box1">
+ <child type="start">
+ <object class="GtkLabel" id="label1">
+ <property name="label" translatable="yes">Hello, Hello</property>
+ </object>
+ </child>
+ <child type="end">
+ <object class="GtkLabel" id="label3">
+ <property name="label" translatable="yes">World</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/centerlayout-invisible-child.ui
b/testsuite/reftests/centerlayout-invisible-child.ui
new file mode 100644
index 0000000000..30888471b0
--- /dev/null
+++ b/testsuite/reftests/centerlayout-invisible-child.ui
@@ -0,0 +1,27 @@
+<!-- check that an invisible child does not influence the layout -->
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow" id="window_information_collection">
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkCenterBox" id="box1">
+ <child type="start">
+ <object class="GtkLabel" id="label1">
+ <property name="label" translatable="yes">Hello, Hello</property>
+ </object>
+ </child>
+ <child type="center">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">0</property>
+ <property name="label" translatable="yes">cruel</property>
+ </object>
+ </child>
+ <child type="end">
+ <object class="GtkLabel" id="label3">
+ <property name="label" translatable="yes">World</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/centerlayout-minsize.css b/testsuite/reftests/centerlayout-minsize.css
new file mode 100644
index 0000000000..9e5d48a484
--- /dev/null
+++ b/testsuite/reftests/centerlayout-minsize.css
@@ -0,0 +1,3 @@
+box {
+ border-spacing: 10px;
+}
diff --git a/testsuite/reftests/centerlayout-minsize.ref.ui b/testsuite/reftests/centerlayout-minsize.ref.ui
new file mode 100644
index 0000000000..8791443f2b
--- /dev/null
+++ b/testsuite/reftests/centerlayout-minsize.ref.ui
@@ -0,0 +1,26 @@
+<!-- check that an invisible child does not influence the layout -->
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow" id="window_information_collection">
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkBox" id="box1">
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="label" translatable="yes">Hello, Hello</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="label" translatable="yes">cruel</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="label" translatable="yes">World</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/centerlayout-minsize.ui b/testsuite/reftests/centerlayout-minsize.ui
new file mode 100644
index 0000000000..7f11882cf4
--- /dev/null
+++ b/testsuite/reftests/centerlayout-minsize.ui
@@ -0,0 +1,27 @@
+<!-- check that an invisible child does not influence the layout -->
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow" id="window_information_collection">
+ <property name="decorated">0</property>
+ <property name="default-width">20</property>
+ <child>
+ <object class="GtkCenterBox" id="box1">
+ <child type="start">
+ <object class="GtkLabel" id="label1">
+ <property name="label" translatable="yes">Hello, Hello</property>
+ </object>
+ </child>
+ <child type="center">
+ <object class="GtkLabel" id="label2">
+ <property name="label" translatable="yes">cruel</property>
+ </object>
+ </child>
+ <child type="end">
+ <object class="GtkLabel" id="label3">
+ <property name="label" translatable="yes">World</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build
index a6a5210a77..0e8bdbc16e 100644
--- a/testsuite/reftests/meson.build
+++ b/testsuite/reftests/meson.build
@@ -163,6 +163,12 @@ testdata = [
'box-shadow-with-blend-mode.ui',
'button-wrapping.ui',
'button-wrapping.ref.ui',
+ 'centerlayout-invisible-child.css',
+ 'centerlayout-invisible-child.ref.ui',
+ 'centerlayout-invisible-child.ui',
+ 'centerlayout-minsize.css',
+ 'centerlayout-minsize.ref.ui',
+ 'centerlayout-minsize.ui',
'color-transition.css',
'color-transition.ref.ui',
'color-transition.ui',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]