summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2016-01-03 15:37:40 -0500
committerMatthias Clasen <mclasen@redhat.com>2016-01-03 15:39:55 -0500
commit3c26aef826f9272d3ab00d25ffec3e8000d97a1b (patch)
treecd287296a861b2c0b22140bb3e70c2462f89d485 /testsuite
parent2e921691d97c203e172cddd18aead9eb90904770 (diff)
downloadgtk+-3c26aef826f9272d3ab00d25ffec3e8000d97a1b.tar.gz
Use a custom theme for CSS style tests
Use a custom, empty theme and stop importing reset-to-defaults.css. This avoids overwriting initial values, so our initial value filtering works better.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/css/style/Empty.css0
-rw-r--r--testsuite/css/style/Makefile.am25
-rw-r--r--testsuite/css/style/currentcolor.css2
-rw-r--r--testsuite/css/style/inherit.css2
-rw-r--r--testsuite/css/style/label.css2
-rw-r--r--testsuite/css/style/nth-child.css2
-rw-r--r--testsuite/css/style/reset-to-defaults.css3
-rw-r--r--testsuite/css/style/test-css-style.c1
-rw-r--r--testsuite/css/style/test-css-style.gresource.xml6
9 files changed, 27 insertions, 16 deletions
diff --git a/testsuite/css/style/Empty.css b/testsuite/css/style/Empty.css
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/testsuite/css/style/Empty.css
diff --git a/testsuite/css/style/Makefile.am b/testsuite/css/style/Makefile.am
index bbd72ef6a1..6ace19154e 100644
--- a/testsuite/css/style/Makefile.am
+++ b/testsuite/css/style/Makefile.am
@@ -14,15 +14,19 @@ test_css_style_CFLAGS = \
-I$(top_builddir)/gdk \
-I$(top_srcdir)/gdk \
$(GTK_DEBUG_FLAGS) \
- $(GTK_DEP_CFLAGS)
+ $(GTK_DEP_CFLAGS) \
+ $(NULL)
test_css_style_LDADD = \
$(top_builddir)/gdk/libgdk-3.la \
$(top_builddir)/gtk/libgtk-3.la \
- $(GTK_DEP_LIBS)
+ $(GTK_DEP_LIBS) \
+ $(NULL)
test_css_style_SOURCES = \
- test-css-style.c
+ test-css-style.c \
+ resources.c \
+ $(NULL)
test_data = \
currentcolor.ui currentcolor.css currentcolor.nodes \
@@ -31,7 +35,19 @@ test_data = \
nth-child.ui nth-child.css nth-child.nodes \
$(NULL)
-EXTRA_DIST += $(test_in_files) $(test_data)
+BUILT_SOURCES = resources.c
+
+resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(builddir)/test-css-style.gresource.xml)
+
+resources.c: test-css-style.gresource.xml $(resource_files)
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $(srcdir)/test-css-style.gresource.xml
+
+EXTRA_DIST += \
+ test-css-style.gresource.xml \
+ $(resource_files) \
+ $(test_in_files) \
+ $(test_data) \
+ $(NULL)
if BUILDOPT_INSTALL_TESTS
insttestdir=$(libexecdir)/installed-tests/$(PACKAGE)/css/style
@@ -48,7 +64,6 @@ $(test_files): %.test: %.test.in
$(AM_V_GEN) sed $(substitutions) $< > $@.tmp && mv $@.tmp $@
EXTRA_DIST += \
- reset-to-defaults.css \
$(test_files) \
$(NULL)
diff --git a/testsuite/css/style/currentcolor.css b/testsuite/css/style/currentcolor.css
index 6c8bbdedd1..68b3f5d5a9 100644
--- a/testsuite/css/style/currentcolor.css
+++ b/testsuite/css/style/currentcolor.css
@@ -1,5 +1,3 @@
-@import "reset-to-defaults.css";
-
box {
color: red;
}
diff --git a/testsuite/css/style/inherit.css b/testsuite/css/style/inherit.css
index 61ac21a312..6eefc78e2c 100644
--- a/testsuite/css/style/inherit.css
+++ b/testsuite/css/style/inherit.css
@@ -1,5 +1,3 @@
-@import "reset-to-defaults.css";
-
box {
color: red;
opacity: 0.5;
diff --git a/testsuite/css/style/label.css b/testsuite/css/style/label.css
index 76b190df59..5d38bf25d3 100644
--- a/testsuite/css/style/label.css
+++ b/testsuite/css/style/label.css
@@ -1,5 +1,3 @@
-@import "reset-to-defaults.css";
-
box {
font: "Comic Sans";
}
diff --git a/testsuite/css/style/nth-child.css b/testsuite/css/style/nth-child.css
index 96265b2acc..6d7ca66c74 100644
--- a/testsuite/css/style/nth-child.css
+++ b/testsuite/css/style/nth-child.css
@@ -1,5 +1,3 @@
-@import "reset-to-defaults.css";
-
label:first-child {
font-size: 20px;
}
diff --git a/testsuite/css/style/reset-to-defaults.css b/testsuite/css/style/reset-to-defaults.css
deleted file mode 100644
index a739419492..0000000000
--- a/testsuite/css/style/reset-to-defaults.css
+++ /dev/null
@@ -1,3 +0,0 @@
-* {
- all: unset;
-}
diff --git a/testsuite/css/style/test-css-style.c b/testsuite/css/style/test-css-style.c
index c0470a1063..53fac070e5 100644
--- a/testsuite/css/style/test-css-style.c
+++ b/testsuite/css/style/test-css-style.c
@@ -245,6 +245,7 @@ main (int argc, char **argv)
g_object_set (gtk_settings_get_default (),
"gtk-font-name", "Sans",
+ "gtk-theme-name", "Empty",
NULL);
if (argc < 2)
{
diff --git a/testsuite/css/style/test-css-style.gresource.xml b/testsuite/css/style/test-css-style.gresource.xml
new file mode 100644
index 0000000000..1625b862d8
--- /dev/null
+++ b/testsuite/css/style/test-css-style.gresource.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/gtk/libgtk/theme">
+ <file>Empty.css</file>
+ </gresource>
+</gresources>