diff --git a/testsuite/gtk/stylecontext.c b/testsuite/gtk/stylecontext.c index ca52a75ed0..7348df952c 100644 --- a/testsuite/gtk/stylecontext.c +++ b/testsuite/gtk/stylecontext.c @@ -246,62 +246,6 @@ test_match (void) g_object_unref (context); } -static void -test_style_property (void) -{ - GtkStyleContext *context; - GtkWidgetPath *path; - GtkCssProvider *provider; - GError *error; - const gchar *data; - gint x; - GdkRGBA color; - GdkRGBA expected; - - error = NULL; - provider = gtk_css_provider_new (); - - context = gtk_style_context_new (); - - path = gtk_widget_path_new (); - gtk_widget_path_append_type (path, GTK_TYPE_WINDOW); - gtk_widget_path_append_type (path, GTK_TYPE_BOX); - gtk_widget_path_append_type (path, GTK_TYPE_BUTTON); - gtk_style_context_set_path (context, path); - gtk_widget_path_free (path); - gtk_style_context_set_state (context, GTK_STATE_FLAG_PRELIGHT); - - /* Since we set the prelight state on the context, we expect - * only the third selector to match, even though the second one - * has higher specificity, and the fourth one comes later. - * - * In particular, we want to verify that widget style properties and - * CSS properties follow the same matching rules, ie we expect - * color to be #003 and child-displacement-x to be 3. - */ - data = "GtkButton:insensitive { color: #001; -GtkButton-child-displacement-x: 1 }\n" - "GtkBox GtkButton:selected { color: #002; -GtkButton-child-displacement-x: 2 }\n" - "GtkButton:prelight { color: #003; -GtkButton-child-displacement-x: 3 }\n" - "GtkButton:focused { color: #004; -GtkButton-child-displacement-x: 4 }\n"; - gtk_css_provider_load_from_data (provider, data, -1, &error); - g_assert_no_error (error); - gtk_style_context_add_provider (context, - GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_USER); - - - gtk_style_context_get_color (context, GTK_STATE_FLAG_PRELIGHT, &color); - gdk_rgba_parse (&expected, "#003"); - g_assert (gdk_rgba_equal (&color, &expected)); - - gtk_style_context_get_style (context, "child-displacement-x", &x, NULL); - - g_assert_cmpint (x, ==, 3); - - g_object_unref (provider); - g_object_unref (context); -} - static void test_basic_properties (void) { @@ -341,7 +285,6 @@ main (int argc, char *argv[]) g_test_add_func ("/style/parse/selectors", test_parse_selectors); g_test_add_func ("/style/path", test_path); g_test_add_func ("/style/match", test_match); - g_test_add_func ("/style/style-property", test_style_property); g_test_add_func ("/style/basic", test_basic_properties); return g_test_run ();