diff --git a/tests/reftests/Makefile.am b/tests/reftests/Makefile.am
index f3684dfeb0..d614934290 100644
--- a/tests/reftests/Makefile.am
+++ b/tests/reftests/Makefile.am
@@ -62,6 +62,9 @@ EXTRA_DIST += \
background-window-transparent.css \
background-window-transparent.ref.ui \
background-window-transparent.ui \
+ bad-color-names.css \
+ bad-color-names.ref.ui \
+ bad-color-names.ui \
reference-background-origin.png \
border-color-default.css \
border-color-default.ref.ui \
diff --git a/tests/reftests/bad-color-names.css b/tests/reftests/bad-color-names.css
new file mode 100644
index 0000000000..e87583fd8b
--- /dev/null
+++ b/tests/reftests/bad-color-names.css
@@ -0,0 +1,11 @@
+@define-color nonexistant @idonotexist;
+
+@define-color self @self;
+
+@define-color cycle @cycle1;
+@define-color cycle1 @cycle2;
+@define-color cycle2 @cycle1;
+
+.background {
+ background: linear-gradient(to bottom, @nonexistant, @self, @cycle, @undefinedcolor);
+}
diff --git a/tests/reftests/bad-color-names.ref.ui b/tests/reftests/bad-color-names.ref.ui
new file mode 100644
index 0000000000..5cb9f67be1
--- /dev/null
+++ b/tests/reftests/bad-color-names.ref.ui
@@ -0,0 +1,10 @@
+
+
+
+
+
diff --git a/tests/reftests/bad-color-names.ui b/tests/reftests/bad-color-names.ui
new file mode 100644
index 0000000000..5cb9f67be1
--- /dev/null
+++ b/tests/reftests/bad-color-names.ui
@@ -0,0 +1,10 @@
+
+
+
+
+