Title: [214347] trunk/Tools
- Revision
- 214347
- Author
- [email protected]
- Date
- 2017-03-24 07:55:59 -0700 (Fri, 24 Mar 2017)
Log Message
Unreviewed. Fix GTK+ test /webkit2/WebKitWebView/_javascript_-dialogs after r214277.
Since r214277 beforeunload events are not fired unless there's some user interaction, so we need to simulate it
in our unit tests to work.
* TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp:
(testWebViewJavaScriptDialogs):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (214346 => 214347)
--- trunk/Tools/ChangeLog 2017-03-24 14:33:52 UTC (rev 214346)
+++ trunk/Tools/ChangeLog 2017-03-24 14:55:59 UTC (rev 214347)
@@ -1,5 +1,15 @@
2017-03-24 Carlos Garcia Campos <[email protected]>
+ Unreviewed. Fix GTK+ test /webkit2/WebKitWebView/_javascript_-dialogs after r214277.
+
+ Since r214277 beforeunload events are not fired unless there's some user interaction, so we need to simulate it
+ in our unit tests to work.
+
+ * TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp:
+ (testWebViewJavaScriptDialogs):
+
+2017-03-24 Carlos Garcia Campos <[email protected]>
+
[GTK] Add MIMETypeRegistry implementation using xdgmime and remove the GTK+ one
https://bugs.webkit.org/show_bug.cgi?id=170001
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp (214346 => 214347)
--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp 2017-03-24 14:33:52 UTC (rev 214346)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp 2017-03-24 14:55:59 UTC (rev 214347)
@@ -298,6 +298,15 @@
return m_mouseTargetHitTestResult.get();
}
+ void simulateUserInterqaction()
+ {
+ mouseMoveTo(1, 1);
+ keyStroke(GDK_KEY_Down);
+ keyStroke(GDK_KEY_Up);
+ while (gtk_events_pending())
+ gtk_main_iteration();
+ }
+
virtual GtkWidget* viewCreate(WebKitWebView* webView, WebKitNavigationAction* navigation)
{
g_assert(webView == m_webView);
@@ -519,6 +528,8 @@
static void testWebViewJavaScriptDialogs(UIClientTest* test, gconstpointer)
{
+ test->showInWindowAndWaitUntilMapped(GTK_WINDOW_TOPLEVEL);
+
static const char* htmlOnLoadFormat = "<html><body _onLoad_=\"%s\"></body></html>";
static const char* jsAlertFormat = "alert('%s')";
static const char* jsConfirmFormat = "do { confirmed = confirm('%s'); } while (!confirmed); alert('confirmed');";
@@ -557,6 +568,7 @@
// Reload should trigger onbeforeunload.
#if 0
+ test->simulateUserInterqaction();
// FIXME: reloading HTML data doesn't emit finished load event.
// See https://bugs.webkit.org/show_bug.cgi?id=139089.
test->m_scriptDialogConfirmed = false;
@@ -566,6 +578,7 @@
#endif
// Navigation should trigger onbeforeunload.
+ test->simulateUserInterqaction();
test->m_scriptDialogConfirmed = false;
test->loadHtml("<html></html>", nullptr);
test->waitUntilLoadFinished();
@@ -575,6 +588,7 @@
test->m_scriptDialogConfirmed = false;
test->loadHtml(beforeUnloadDialogHTML.get(), nullptr);
test->waitUntilLoadFinished();
+ test->simulateUserInterqaction();
test->tryCloseAndWaitUntilClosed();
g_assert(test->m_scriptDialogConfirmed);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes