From d689bbf303fee210c57bc4182e964530f4f79288 Mon Sep 17 00:00:00 2001 From: "mrobinson@webkit.org" Date: Tue, 21 Feb 2012 07:44:36 +0000 Subject: [PATCH] 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. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108312 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebKit/gtk/ChangeLog | 13 +++++++++++++ Source/WebKit/gtk/tests/testcopyandpaste.c | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Source/WebKit/gtk/ChangeLog b/Source/WebKit/gtk/ChangeLog index 0f50c99..7a814f3 100644 --- a/Source/WebKit/gtk/ChangeLog +++ b/Source/WebKit/gtk/ChangeLog @@ -1,5 +1,18 @@ 2012-02-20 Martin Robinson + 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 + [GTK] Web content oftens steals focus from other widgets https://bugs.webkit.org/show_bug.cgi?id=77791 diff --git a/Source/WebKit/gtk/tests/testcopyandpaste.c b/Source/WebKit/gtk/tests/testcopyandpaste.c index 6d1b480..7d8dd8f 100644 --- a/Source/WebKit/gtk/tests/testcopyandpaste.c +++ b/Source/WebKit/gtk/tests/testcopyandpaste.c @@ -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'); -- 2.7.4