Fix GTK+ unit tests after r108278.
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2012 07:44:36 +0000 (07:44 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2012 07:44:36 +0000 (07:44 +0000)
Reviewed by Alejandro G. Castro.

Now that WebCore is no longer stealing focus, we need to
adjust where we grab focus to ensure that it actually succeeds.

* tests/testcopyandpaste.c:
(map_event_cb): No longer grab focus here.
(runPasteTestCallback): Grabbing focus here seems to be late enough in the process.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108312 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/tests/testcopyandpaste.c

index 0f50c99..7a814f3 100644 (file)
@@ -1,5 +1,18 @@
 2012-02-20  Martin Robinson  <mrobinson@igalia.com>
 
+        Fix GTK+ unit tests after r108278.
+
+        Reviewed by Alejandro G. Castro.
+
+        Now that WebCore is no longer stealing focus, we need to
+        adjust where we grab focus to ensure that it actually succeeds.
+
+        * tests/testcopyandpaste.c:
+        (map_event_cb): No longer grab focus here.
+        (runPasteTestCallback): Grabbing focus here seems to be late enough in the process.
+
+2012-02-20  Martin Robinson  <mrobinson@igalia.com>
+
         [GTK] Web content oftens steals focus from other widgets
         https://bugs.webkit.org/show_bug.cgi?id=77791
 
index 6d1b480..7d8dd8f 100644 (file)
@@ -111,7 +111,6 @@ static void load_status_cb(WebKitWebView* webView, GParamSpec* spec, gpointer da
 
 gboolean map_event_cb(GtkWidget *widget, GdkEvent* event, gpointer data)
 {
-    gtk_widget_grab_focus(widget);
     CopyAndPasteFixture* fixture = (CopyAndPasteFixture*)data;
     webkit_web_view_load_string(fixture->webView, fixture->info->page,
                                 "text/html", "utf-8", "file://");
@@ -137,6 +136,8 @@ static void test_copy_and_paste(CopyAndPasteFixture* fixture, gconstpointer data
 static CopyAndPasteFixture* currentFixture;
 static JSValueRef runPasteTestCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
+    gtk_widget_grab_focus(GTK_WIDGET(currentFixture->webView));
+
     // Simulate a paste keyboard sequence.
     GdkEvent* event = gdk_event_new(GDK_KEY_PRESS);
     event->key.keyval = gdk_unicode_to_keyval('v');