Title: [216423] trunk/Tools
- Revision
- 216423
- Author
- carlo...@webkit.org
- Date
- 2017-05-08 09:40:44 -0700 (Mon, 08 May 2017)
Log Message
Unreviewed. Fix GTK+ test /webkit2/WebKitWebView/_javascript_-dialogs after r215404.
Sending down+up keys is no longer enough to simulate a real user interaction after r215404, the key events now
should be handled by the web process to be considered a user interaction. So, add an input to the HTML and send
characters to the input. Also fix typo in the function name.
* TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp:
(testWebViewJavaScriptDialogs):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (216422 => 216423)
--- trunk/Tools/ChangeLog 2017-05-08 15:58:40 UTC (rev 216422)
+++ trunk/Tools/ChangeLog 2017-05-08 16:40:44 UTC (rev 216423)
@@ -1,3 +1,14 @@
+2017-05-08 Carlos Garcia Campos <cgar...@igalia.com>
+
+ Unreviewed. Fix GTK+ test /webkit2/WebKitWebView/_javascript_-dialogs after r215404.
+
+ Sending down+up keys is no longer enough to simulate a real user interaction after r215404, the key events now
+ should be handled by the web process to be considered a user interaction. So, add an input to the HTML and send
+ characters to the input. Also fix typo in the function name.
+
+ * TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp:
+ (testWebViewJavaScriptDialogs):
+
2017-05-07 Michael Catanzaro <mcatanz...@igalia.com>
[GTK] Cannot sign in with new Google sign-in page
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp (216422 => 216423)
--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp 2017-05-08 15:58:40 UTC (rev 216422)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp 2017-05-08 16:40:44 UTC (rev 216423)
@@ -298,11 +298,11 @@
return m_mouseTargetHitTestResult.get();
}
- void simulateUserInterqaction()
+ void simulateUserInteraction()
{
- mouseMoveTo(1, 1);
- keyStroke(GDK_KEY_Down);
- keyStroke(GDK_KEY_Up);
+ runJavaScriptAndWaitUntilFinished("document.getElementById('testInput').focus()", nullptr);
+ keyStroke(GDK_KEY_a);
+ keyStroke(GDK_KEY_b);
while (gtk_events_pending())
gtk_main_iteration();
}
@@ -535,7 +535,7 @@
static const char* jsConfirmFormat = "do { confirmed = confirm('%s'); } while (!confirmed); alert('confirmed');";
static const char* jsPromptFormat = "alert(prompt('%s', 'default'));";
static const char* htmlOnBeforeUnloadFormat =
- "<html><body _onbeforeunload_=\"return beforeUnloadHandler();\"><script>function beforeUnloadHandler() { return \"%s\"; }</script></body></html>";
+ "<html><body _onbeforeunload_=\"return beforeUnloadHandler();\"><input id=\"testInput\" type=\"text\"></input><script>function beforeUnloadHandler() { return \"%s\"; }</script></body></html>";
test->m_scriptDialogType = WEBKIT_SCRIPT_DIALOG_ALERT;
GUniquePtr<char> alertDialogMessage(g_strdup_printf(jsAlertFormat, kAlertDialogMessage));
@@ -568,7 +568,7 @@
// Reload should trigger onbeforeunload.
#if 0
- test->simulateUserInterqaction();
+ test->simulateUserInteraction();
// FIXME: reloading HTML data doesn't emit finished load event.
// See https://bugs.webkit.org/show_bug.cgi?id=139089.
test->m_scriptDialogConfirmed = false;
@@ -578,7 +578,7 @@
#endif
// Navigation should trigger onbeforeunload.
- test->simulateUserInterqaction();
+ test->simulateUserInteraction();
test->m_scriptDialogConfirmed = false;
test->loadHtml("<html></html>", nullptr);
test->waitUntilLoadFinished();
@@ -588,7 +588,7 @@
test->m_scriptDialogConfirmed = false;
test->loadHtml(beforeUnloadDialogHTML.get(), nullptr);
test->waitUntilLoadFinished();
- test->simulateUserInterqaction();
+ test->simulateUserInteraction();
test->tryCloseAndWaitUntilClosed();
g_assert(test->m_scriptDialogConfirmed);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes