Modified: trunk/Source/WebKit2/ChangeLog (148082 => 148083)
--- trunk/Source/WebKit2/ChangeLog 2013-04-10 07:38:02 UTC (rev 148082)
+++ trunk/Source/WebKit2/ChangeLog 2013-04-10 07:39:18 UTC (rev 148083)
@@ -1,3 +1,42 @@
+2013-04-10 Zan Dobersek <[email protected]>
+
+ REGRESSION (r146518): WebKit2APITests/TestInspector is failing
+ https://bugs.webkit.org/show_bug.cgi?id=113281
+
+ Reviewed by Darin Adler.
+
+ Changes to the WebInspectorProxy opening processing in r146518 caused the change in how the GTK-specific
+ WebInspectorProxy code operates, specifically the 'bring-to-front' signal is not emitted anymore when opening the
+ inspector due to the WebInspectorProxy::bringToFront method now only bringing the inspector window to front if it exists
+ and opening it (and thus unable to bring it to front) otherwise.
+
+ Closing of the inspector through the didClose method is now done immediately after sending the WebInspector::Close()
+ message to the WebProcess rather than waiting for the WebProcess to communicate back the order of closing. Due to this
+ the relevant code in the test cases had to be changed to not run the loop but rather just check that the closing was
+ successful.
+
+ (InspectorTest::InspectorTest): Remove the initialization of the now redundant m_quitOnBringToFront member variable.
+ (InspectorTest::bringToFront): Quit the loop without checking the removed member variable.
+ (InspectorTest::closed): Do not quit the loop as it is not run anymore.
+ (InspectorTest::showIdle): A helper method that asynchronously calls the webkit_web_inspector_show method, removing some
+ unnecessary complexity about under what exact circumstances to quit the loop in open-window/bring-to-front callbacks.
+ (InspectorTest::show): Replaces the showAndWaitUntilFinished method, adding an idle invocation of the showIdle helper
+ method and running the loop.
+ (InspectorTest::close): Formerly closeAndWaitUntilClosed, now does not run the loop anymore as there's no need for it.
+ (testInspectorDefault): Only the window opening event is now expected upon showing the inspector for the first time.
+ Adjusting callsites to use InspectorTest::show and InspectorTest::close instead of
+ InspectorTest::showAndWaitUntilFinished and InspectorTest::showAndWaitUntilFinished.
+ (CustomInspectorTest::destroyWindow): Formerly destroyWindowAndWaitUntilClosed, the closing is not asynchronous anymore
+ so the loop is not run.
+ (testInspectorManualAttachDetach): Only the window opening event is now expected upon showing the inspector for the first time.
+ Adjusting callsites to use InspectorTest::show and InspectorTest::close instead of
+ InspectorTest::showAndWaitUntilFinished and InspectorTest::showAndWaitUntilFinished.
+ (testInspectorCustomContainerDestroyed): Adjusting callsites to use InspectorTest::show and CustomInspectorTest::destroyWindow
+ instead of InspectorTest::showAndWaitUntilFinished and CustomInspectorTest::destroyWindowAndWaitUntilClosed.
+ * UIProcess/WebInspectorProxy.cpp:
+ (WebKit::WebInspectorProxy::show): When showing a connected WebInspectorProxy, call the bringToFront method which will
+ open the inspector if it's not yet visible or bring it to the front otherwise.
+
2013-04-10 Zan Dobersek <[email protected]>
[GTK][WK2] Implement WebInspectorProxy::platformInspectedWindowWidth
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestInspector.cpp (148082 => 148083)
--- trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestInspector.cpp 2013-04-10 07:38:02 UTC (rev 148082)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestInspector.cpp 2013-04-10 07:39:18 UTC (rev 148083)
@@ -65,7 +65,6 @@
InspectorTest()
: WebViewTest()
, m_inspector(webkit_web_view_get_inspector(m_webView))
- , m_quitOnBringToFront(false)
{
webkit_settings_set_enable_developer_extras(webkit_web_view_get_settings(m_webView), TRUE);
assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_inspector));
@@ -91,15 +90,13 @@
virtual bool bringToFront()
{
m_events.append(BringToFront);
- if (m_quitOnBringToFront)
- g_main_loop_quit(m_mainLoop);
+ g_main_loop_quit(m_mainLoop);
return FALSE;
}
virtual void closed()
{
m_events.append(Closed);
- g_main_loop_quit(m_mainLoop);
}
virtual bool attach()
@@ -114,12 +111,17 @@
return TRUE;
}
- void showAndWaitUntilFinished(bool quitOnBringToFront)
+
+ static gboolean showIdle(InspectorTest* test)
{
- m_quitOnBringToFront = quitOnBringToFront;
- webkit_web_inspector_show(m_inspector);
+ webkit_web_inspector_show(test->m_inspector);
+ return FALSE;
+ }
+
+ void show()
+ {
+ g_idle_add(reinterpret_cast<GSourceFunc>(showIdle), this);
g_main_loop_run(m_mainLoop);
- m_quitOnBringToFront = false;
}
void resizeViewAndAttach()
@@ -141,14 +143,12 @@
g_main_loop_run(m_mainLoop);
}
- void closeAndWaitUntilClosed()
+ void close()
{
webkit_web_inspector_close(m_inspector);
- g_main_loop_run(m_mainLoop);
}
WebKitWebInspector* m_inspector;
- bool m_quitOnBringToFront;
Vector<InspectorEvents> m_events;
};
@@ -159,7 +159,7 @@
test->loadHtml("<html><body><p>WebKitGTK+ Inspector test</p></body></html>", 0);
test->waitUntilLoadFinished();
- test->showAndWaitUntilFinished(false);
+ test->show();
// We don't add the view to a container, so consume the weak ref with GRefPtr.
GRefPtr<WebKitWebViewBase> inspectorView = webkit_web_inspector_get_web_view(test->m_inspector);
g_assert(inspectorView.get());
@@ -167,12 +167,11 @@
g_assert(!webkit_web_inspector_is_attached(test->m_inspector));
g_assert_cmpuint(webkit_web_inspector_get_attached_height(test->m_inspector), ==, 0);
Vector<InspectorTest::InspectorEvents>& events = test->m_events;
- g_assert_cmpint(events.size(), ==, 2);
- g_assert_cmpint(events[0], ==, InspectorTest::BringToFront);
- g_assert_cmpint(events[1], ==, InspectorTest::OpenWindow);
+ g_assert_cmpint(events.size(), ==, 1);
+ g_assert_cmpint(events[0], ==, InspectorTest::OpenWindow);
test->m_events.clear();
- test->showAndWaitUntilFinished(true);
+ test->show();
events = test->m_events;
g_assert_cmpint(events.size(), ==, 1);
g_assert_cmpint(events[0], ==, InspectorTest::BringToFront);
@@ -194,7 +193,7 @@
g_assert_cmpint(events[1], ==, InspectorTest::OpenWindow);
test->m_events.clear();
- test->closeAndWaitUntilClosed();
+ test->close();
events = test->m_events;
g_assert_cmpint(events.size(), ==, 1);
g_assert_cmpint(events[0], ==, InspectorTest::Closed);
@@ -273,12 +272,11 @@
return InspectorTest::detach();
}
- void destroyWindowAndWaitUntilClosed()
+ void destroyWindow()
{
g_assert(m_inspectorWindow);
gtk_widget_destroy(m_inspectorWindow);
m_inspectorWindow = 0;
- g_main_loop_run(m_mainLoop);
}
GtkWidget* m_inspectorWindow;
@@ -291,13 +289,12 @@
test->loadHtml("<html><body><p>WebKitGTK+ Inspector test</p></body></html>", 0);
test->waitUntilLoadFinished();
- test->showAndWaitUntilFinished(false);
+ test->show();
test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webkit_web_inspector_get_web_view(test->m_inspector)));
g_assert(!webkit_web_inspector_is_attached(test->m_inspector));
Vector<InspectorTest::InspectorEvents>& events = test->m_events;
- g_assert_cmpint(events.size(), ==, 2);
- g_assert_cmpint(events[0], ==, InspectorTest::BringToFront);
- g_assert_cmpint(events[1], ==, InspectorTest::OpenWindow);
+ g_assert_cmpint(events.size(), ==, 1);
+ g_assert_cmpint(events[0], ==, InspectorTest::OpenWindow);
test->m_events.clear();
test->resizeViewAndAttach();
@@ -319,7 +316,7 @@
test->resizeViewAndAttach();
g_assert(webkit_web_inspector_is_attached(test->m_inspector));
test->m_events.clear();
- test->closeAndWaitUntilClosed();
+ test->close();
events = test->m_events;
g_assert_cmpint(events.size(), ==, 2);
g_assert_cmpint(events[0], ==, InspectorTest::Detach);
@@ -334,12 +331,12 @@
test->loadHtml("<html><body><p>WebKitGTK+ Inspector test</p></body></html>", 0);
test->waitUntilLoadFinished();
- test->showAndWaitUntilFinished(false);
+ test->show();
test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webkit_web_inspector_get_web_view(test->m_inspector)));
g_assert(!webkit_web_inspector_is_attached(test->m_inspector));
test->m_events.clear();
- test->destroyWindowAndWaitUntilClosed();
+ test->destroyWindow();
Vector<InspectorTest::InspectorEvents>& events = test->m_events;
g_assert_cmpint(events.size(), ==, 1);
g_assert_cmpint(events[0], ==, InspectorTest::Closed);
Modified: trunk/Tools/Scripts/run-gtk-tests (148082 => 148083)
--- trunk/Tools/Scripts/run-gtk-tests 2013-04-10 07:38:02 UTC (rev 148082)
+++ trunk/Tools/Scripts/run-gtk-tests 2013-04-10 07:39:18 UTC (rev 148083)
@@ -67,7 +67,6 @@
SkippedTest("unittests/testwebresource", "/webkit/webresource/sub_resource_loading", "Test fails in GTK Linux 64-bit Release bot", 82330),
SkippedTest("unittests/testwebview", "/webkit/webview/icon-uri", "Test times out in GTK Linux 64-bit Release bot", 82328),
SkippedTest("unittests/testatk", "/webkit/atk/getTextInParagraphAndBodyModerate", "Test fails", 105538),
- SkippedTest("WebKit2APITests/TestInspector", SkippedTest.ENTIRE_SUITE, "Test fails", 113281),
SkippedTest("WebKit2APITests/TestInspectorServer", SkippedTest.ENTIRE_SUITE, "Test times out", 105866),
SkippedTest("WebKit2APITests/TestResources", "/webkit2/WebKitWebView/resources", "Test is flaky in GTK Linux 32-bit Release bot", 82868),
SkippedTest("WebKit2APITests/TestWebKitAccessibility", "/webkit2/WebKitAccessibility/atspi-basic-hierarchy", "Test fails", 100408),