Changeset 214784 in webkit
- Timestamp:
- Apr 3, 2017 6:06:15 AM (7 years ago)
- Location:
- releases/WebKitGTK/webkit-2.16/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.16/Tools/ChangeLog
r214748 r214784 1 2017-03-24 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Unreviewed. Fix GTK+ test /webkit2/WebKitWebView/javascript-dialogs after r214277. 4 5 Since r214277 beforeunload events are not fired unless there's some user interaction, so we need to simulate it 6 in our unit tests to work. 7 8 * TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp: 9 (testWebViewJavaScriptDialogs): 10 1 11 2017-03-15 Tim Horton <timothy_horton@apple.com> 2 12 -
releases/WebKitGTK/webkit-2.16/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp
r206302 r214784 299 299 } 300 300 301 void simulateUserInterqaction() 302 { 303 mouseMoveTo(1, 1); 304 keyStroke(GDK_KEY_Down); 305 keyStroke(GDK_KEY_Up); 306 while (gtk_events_pending()) 307 gtk_main_iteration(); 308 } 309 301 310 virtual GtkWidget* viewCreate(WebKitWebView* webView, WebKitNavigationAction* navigation) 302 311 { … … 520 529 static void testWebViewJavaScriptDialogs(UIClientTest* test, gconstpointer) 521 530 { 531 test->showInWindowAndWaitUntilMapped(GTK_WINDOW_TOPLEVEL); 532 522 533 static const char* htmlOnLoadFormat = "<html><body onLoad=\"%s\"></body></html>"; 523 534 static const char* jsAlertFormat = "alert('%s')"; … … 558 569 // Reload should trigger onbeforeunload. 559 570 #if 0 571 test->simulateUserInterqaction(); 560 572 // FIXME: reloading HTML data doesn't emit finished load event. 561 573 // See https://bugs.webkit.org/show_bug.cgi?id=139089. … … 567 579 568 580 // Navigation should trigger onbeforeunload. 581 test->simulateUserInterqaction(); 569 582 test->m_scriptDialogConfirmed = false; 570 583 test->loadHtml("<html></html>", nullptr); … … 576 589 test->loadHtml(beforeUnloadDialogHTML.get(), nullptr); 577 590 test->waitUntilLoadFinished(); 591 test->simulateUserInterqaction(); 578 592 test->tryCloseAndWaitUntilClosed(); 579 593 g_assert(test->m_scriptDialogConfirmed);
Note: See TracChangeset
for help on using the changeset viewer.