summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2021-09-21 00:59:36 +0200
committerBenjamin Otte <otte@redhat.com>2021-09-21 01:00:39 +0200
commite5aac82860dc6dfc3ca06c782551b3b97539989a (patch)
treebcc53d2a1b10ba470722b80b362ba65b07c58936
parente9cf8c6cc766f3314097ae8a01f19dadee1b6b74 (diff)
downloadgtk+-issue-4136.tar.gz
reftests: Add tests that check default-size is computed correctlyissue-4136
Related: #4136
-rw-r--r--testsuite/reftests/default-size-with-title.ref.ui55
-rw-r--r--testsuite/reftests/default-size-with-title.ui59
-rw-r--r--testsuite/reftests/default-size.ref.ui52
-rw-r--r--testsuite/reftests/default-size.ui56
-rw-r--r--testsuite/reftests/meson.build4
5 files changed, 226 insertions, 0 deletions
diff --git a/testsuite/reftests/default-size-with-title.ref.ui b/testsuite/reftests/default-size-with-title.ref.ui
new file mode 100644
index 0000000000..0c8473fab1
--- /dev/null
+++ b/testsuite/reftests/default-size-with-title.ref.ui
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow" id="window">
+ <property name="width_request">600</property>
+ <property name="height_request">400</property>
+ <property name="title">What's my size?</property>
+ <child type="titlebar">
+ <object class="GtkHeaderBar" />
+ </child>
+ <child>
+ <object class="GtkGrid">
+ <property name="valign">center</property>
+ <property name="halign">center</property>
+ <property name="column-spacing">10</property>
+ <property name="row-spacing">10</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">default width:</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">600</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">default height:</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">1</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">400</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">1</property>
+ </layout>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/default-size-with-title.ui b/testsuite/reftests/default-size-with-title.ui
new file mode 100644
index 0000000000..8040331f7d
--- /dev/null
+++ b/testsuite/reftests/default-size-with-title.ui
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow" id="window">
+ <property name="width_request">600</property>
+ <property name="height_request">400</property>
+ <property name="title">What's my size?</property>
+ <child type="titlebar">
+ <object class="GtkHeaderBar" />
+ </child>
+ <child>
+ <object class="GtkGrid">
+ <property name="valign">center</property>
+ <property name="halign">center</property>
+ <property name="column-spacing">10</property>
+ <property name="row-spacing">10</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">default width:</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <!-- This binding should never do anything because the text is set to
+ the correct value from the start, all we do is make sure it doesn't change -->
+ <property name="label" bind-source="window" bind-property="default-width">600</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">default height:</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">1</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <!-- This binding should never do anything because the text is set to
+ the correct value from the start, all we do is make sure it doesn't change -->
+ <property name="label" bind-source="window" bind-property="default-height">400</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">1</property>
+ </layout>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/default-size.ref.ui b/testsuite/reftests/default-size.ref.ui
new file mode 100644
index 0000000000..7f1cc49469
--- /dev/null
+++ b/testsuite/reftests/default-size.ref.ui
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow" id="window">
+ <property name="width_request">600</property>
+ <property name="height_request">400</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkGrid">
+ <property name="valign">center</property>
+ <property name="halign">center</property>
+ <property name="column-spacing">10</property>
+ <property name="row-spacing">10</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">default width:</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">600</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">default height:</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">1</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">400</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">1</property>
+ </layout>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/default-size.ui b/testsuite/reftests/default-size.ui
new file mode 100644
index 0000000000..5166d0fe6a
--- /dev/null
+++ b/testsuite/reftests/default-size.ui
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow" id="window">
+ <property name="width_request">600</property>
+ <property name="height_request">400</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkGrid">
+ <property name="valign">center</property>
+ <property name="halign">center</property>
+ <property name="column-spacing">10</property>
+ <property name="row-spacing">10</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">default width:</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <!-- This binding should never do anything because the text is set to
+ the correct value from the start, all we do is make sure it doesn't change -->
+ <property name="label" bind-source="window" bind-property="default-width">600</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">default height:</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">1</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <!-- This binding should never do anything because the text is set to
+ the correct value from the start, all we do is make sure it doesn't change -->
+ <property name="label" bind-source="window" bind-property="default-height">400</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">1</property>
+ </layout>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build
index 5e4d5d08d7..9584845a2e 100644
--- a/testsuite/reftests/meson.build
+++ b/testsuite/reftests/meson.build
@@ -225,6 +225,10 @@ testdata = [
'data-url.css',
'data-url.ref.ui',
'data-url.ui',
+ 'default-size.ui',
+ 'default-size.ref.ui',
+ 'default-size-with-title.ui',
+ 'default-size-with-title.ref.ui',
'fixed-widget-stacking.ref.ui',
'fixed-widget-stacking.ui',
'flipping-icons.ref.ui',