Title: [149045] trunk/Tools
Revision
149045
Author
[email protected]
Date
2013-04-24 09:12:04 -0700 (Wed, 24 Apr 2013)

Log Message

[EFL][WK2]: Fix WKViewClientWebProcessCallbacks WK2 API test
https://bugs.webkit.org/show_bug.cgi?id=114850

Patch by Sergio Correia <[email protected]> on 2013-04-24
Reviewed by Andreas Kling.

Revision r148312 fixed WebPageProxy cleanup and also changed the process
termination semantics when requested by the user so that a client is not
notified of a crash anymore, since there was no crash anyway.

That change broke WKViewClientWebProcessCallbacks WK2 API test, since it
relied on being notified of a crash after calling WKPageTerminate(). As
a result of not being notified of such non-existent crash, the test would
timeout right after making the terminate call.

This patch adds an InjectedBundle to be used for simulating a crash, by
calling abort() upon receiving a "Crash" message, and thus we are able to
keep testing the crash callback.

This patch also re-enables the WKViewClientWebProcessCallbacks test, which
had been disabled in revisions r148858 and r148855, since it was failing.

* TestWebKitAPI/PlatformEfl.cmake:
* TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks_Bundle.cpp: Added.
(TestWebKitAPI):
(WKViewClientWebProcessCallbacksTest):
(TestWebKitAPI::WKViewClientWebProcessCallbacksTest::WKViewClientWebProcessCallbacksTest):
(TestWebKitAPI::WKViewClientWebProcessCallbacksTest::didReceiveMessage):

Modified Paths

Added Paths

Diff

Modified: trunk/Tools/ChangeLog (149044 => 149045)


--- trunk/Tools/ChangeLog	2013-04-24 16:08:32 UTC (rev 149044)
+++ trunk/Tools/ChangeLog	2013-04-24 16:12:04 UTC (rev 149045)
@@ -1,3 +1,35 @@
+2013-04-24  Sergio Correia  <[email protected]>
+
+        [EFL][WK2]: Fix WKViewClientWebProcessCallbacks WK2 API test
+        https://bugs.webkit.org/show_bug.cgi?id=114850
+
+        Reviewed by Andreas Kling.
+
+        Revision r148312 fixed WebPageProxy cleanup and also changed the process
+        termination semantics when requested by the user so that a client is not
+        notified of a crash anymore, since there was no crash anyway.
+
+        That change broke WKViewClientWebProcessCallbacks WK2 API test, since it
+        relied on being notified of a crash after calling WKPageTerminate(). As
+        a result of not being notified of such non-existent crash, the test would
+        timeout right after making the terminate call.
+
+        This patch adds an InjectedBundle to be used for simulating a crash, by
+        calling abort() upon receiving a "Crash" message, and thus we are able to
+        keep testing the crash callback.
+
+        This patch also re-enables the WKViewClientWebProcessCallbacks test, which
+        had been disabled in revisions r148858 and r148855, since it was failing.
+
+        * TestWebKitAPI/PlatformEfl.cmake:
+        * TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks_Bundle.cpp: Added.
+        (TestWebKitAPI):
+        (WKViewClientWebProcessCallbacksTest):
+        (TestWebKitAPI::WKViewClientWebProcessCallbacksTest::WKViewClientWebProcessCallbacksTest):
+        (TestWebKitAPI::WKViewClientWebProcessCallbacksTest::didReceiveMessage):
+
 2013-04-24  Christophe Dumez  <[email protected]>
 
         [EFL][WK2] WebKitTestRunner failures due to IconDatabase assertions

Modified: trunk/Tools/TestWebKitAPI/PlatformEfl.cmake (149044 => 149045)


--- trunk/Tools/TestWebKitAPI/PlatformEfl.cmake	2013-04-24 16:08:32 UTC (rev 149044)
+++ trunk/Tools/TestWebKitAPI/PlatformEfl.cmake	2013-04-24 16:12:04 UTC (rev 149045)
@@ -51,6 +51,11 @@
     KURL
 )
 
+# In here we list the bundles that are used by our specific WK2 API Tests
+list(APPEND bundle_harness_SOURCES
+    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks_Bundle.cpp
+)
+
 set(test_webkit2_api_BINARIES
     AboutBlankLoad
     CookieManager
@@ -88,6 +93,7 @@
     WKStringJSString
     WKURL
     WillSendSubmitEvent
+    efl/WKViewClientWebProcessCallbacks
 )
 
 # Seccomp filters is an internal API and its symbols
@@ -107,7 +113,6 @@
     RestoreSessionStateContainingFormData
     ShouldGoToBackForwardListItem
     WKPageGetScaleFactorNotZero
-    #efl/WKViewClientWebProcessCallbacks
 )
 
 # Tests disabled because of missing features on the test harness:

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks.cpp (149044 => 149045)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks.cpp	2013-04-24 16:08:32 UTC (rev 149044)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks.cpp	2013-04-24 16:12:04 UTC (rev 149045)
@@ -101,7 +101,7 @@
 
 TEST(WebKit2, WKViewClientWebProcessCallbacks)
 {
-    WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("WKViewClientWebProcessCallbacksTest"));
     WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
 
     PlatformWebView view(context.get());
@@ -115,7 +115,7 @@
     WKPageLoadURL(view.page(), url.get());
     Util::run(&states.didFinishLoad);
 
-    WKPageTerminate(view.page());
+    WKContextPostMessageToInjectedBundle(context.get(), Util::toWK("Crash").get(), 0);
     Util::run(&states.didCrash);
 
     WKPageReload(view.page());

Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks_Bundle.cpp (0 => 149045)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks_Bundle.cpp	                        (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks_Bundle.cpp	2013-04-24 16:12:04 UTC (rev 149045)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InjectedBundleTest.h"
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+class WKViewClientWebProcessCallbacksTest : public InjectedBundleTest {
+public:
+    WKViewClientWebProcessCallbacksTest(const std::string& identifier);
+
+private:
+    virtual void didReceiveMessage(WKBundleRef, WKStringRef messageName, WKTypeRef messageBody);
+};
+
+static InjectedBundleTest::Register<WKViewClientWebProcessCallbacksTest> registrar("WKViewClientWebProcessCallbacksTest");
+
+WKViewClientWebProcessCallbacksTest::WKViewClientWebProcessCallbacksTest(const std::string& identifier)
+    : InjectedBundleTest(identifier)
+{
+}
+
+void WKViewClientWebProcessCallbacksTest::didReceiveMessage(WKBundleRef, WKStringRef messageName, WKTypeRef)
+{
+    if (!WKStringIsEqualToUTF8CString(messageName, "Crash"))
+        return;
+
+    // Simulating a crash
+    abort();
+}
+
+} // namespace TestWebKitAPI
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to