reftests: Add tests that check default-size is computed correctly

Related: #4136
This commit is contained in:
Benjamin Otte 2021-09-21 00:59:36 +02:00 committed by Benjamin Otte
parent 765e78f72b
commit 1ef000b1ab
7 changed files with 336 additions and 0 deletions

View File

@ -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>
<property name="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>
</property>
</object>
</interface>

View File

@ -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>
<property name="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>
</property>
</object>
</interface>

View File

@ -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">size?</property>
<property name="titlebar">
<object class="GtkHeaderBar" />
</property>
<property name="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>
</property>
</object>
</interface>

View File

@ -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">size?</property>
<property name="titlebar">
<object class="GtkHeaderBar" />
</property>
<property name="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>
</property>
</object>
</interface>

View File

@ -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="title">size?</property>
<property name="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>
</property>
</object>
</interface>

View File

@ -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="title">size?</property>
<property name="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>
</property>
</object>
</interface>

View File

@ -225,6 +225,12 @@ testdata = [
'data-url.css',
'data-url.ref.ui',
'data-url.ui',
'default-size-undecorated.ui',
'default-size-undecorated.ref.ui',
'default-size-with-titlebar.ui',
'default-size-with-titlebar.ref.ui',
'default-size-without-titlebar.ui',
'default-size-without-titlebar.ref.ui',
'fixed-widget-stacking.ref.ui',
'fixed-widget-stacking.ui',
'flipping-icons.ref.ui',