<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[182475] releases/WebKitGTK/webkit-2.4/Tools</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/182475">182475</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-04-07 09:32:23 -0700 (Tue, 07 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/176563">r176563</a> - [GTK] Use custom JavaScript instead of DBus to implement WebProcess tests
https://bugs.webkit.org/show_bug.cgi?id=138834

Reviewed by Sergio Villar Senin.

It makes everyting simpler and the tests run faster too, since we
don't need to spawn the private bus and wait until the DBus name
is registered. The web extension registers a new JavaSCript class
with a status method to run the tests, similar to the DBus
method. In the UI process side, tests use webkit_web_view_run_java_script()
instead of sending a DBus message.

* TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt:
* TestWebKitAPI/Tests/WebKit2Gtk/DOMNodeFilterTest.cpp:
(WebKitDOMNodeFilterTest::create):
(WebKitDOMNodeFilterTest::testTreeWalker):
(WebKitDOMNodeFilterTest::testNodeIterator):
(WebKitDOMNodeFilterTest::webPageFromArgs): Deleted.
(WebKitDOMNodeFilterTest::runTest): Deleted.
* TestWebKitAPI/Tests/WebKit2Gtk/DOMNodeTest.cpp:
(WebKitDOMNodeTest::create):
(WebKitDOMNodeTest::testHierarchyNavigation):
(WebKitDOMNodeTest::testInsertion):
(WebKitDOMNodeTest::testTagNames):
(WebKitDOMNodeTest::webPageFromArgs): Deleted.
(WebKitDOMNodeTest::runTest): Deleted.
* TestWebKitAPI/Tests/WebKit2Gtk/DOMXPathNSResolverTest.cpp:
(WebKitDOMXPathNSResolverTest::create):
(WebKitDOMXPathNSResolverTest::testXPathNSResolverNative):
(WebKitDOMXPathNSResolverTest::testXPathNSResolverCustom):
(WebKitDOMXPathNSResolverTest::webPageFromArgs): Deleted.
(WebKitDOMXPathNSResolverTest::runTest): Deleted.
* TestWebKitAPI/Tests/WebKit2Gtk/FrameTest.cpp:
(WebKitFrameTest::create):
(WebKitFrameTest::testMainFrame):
(WebKitFrameTest::testURI):
(WebKitFrameTest::testJavaScriptContext):
(WebKitFrameTest::webPageFromArgs): Deleted.
(WebKitFrameTest::runTest): Deleted.
* TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNode.cpp:
(testWebKitDOMNodeHierarchyNavigation):
(testWebKitDOMNodeInsertion):
(testWebKitDOMNodeTagNames):
(beforeAll):
(afterAll):
* TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNodeFilter.cpp:
(runTest):
(beforeAll):
(afterAll):
* TestWebKitAPI/Tests/WebKit2Gtk/TestDOMXPathNSResolver.cpp:
(testWebKitDOMXPathNSResolverNative):
(testWebKitDOMXPathNSResolverCustom):
(beforeAll):
(afterAll):
(runTest): Deleted.
* TestWebKitAPI/Tests/WebKit2Gtk/TestFrame.cpp:
(webkitFrameTestRun):
(beforeAll):
(afterAll):
* TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.cpp:
(testsMap):
(WebProcessTest::add):
(WebProcessTest::create):
(runTest):
(windowObjectClearedCallback):
(webkit_web_extension_initialize):
(methodCallCallback): Deleted.
(webkit_web_extension_initialize_with_user_data): Deleted.
* TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.h:
* TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.cpp: Removed.
* TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.h: Removed.
* TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
(WebViewTest::runWebProcessTest):
* TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit24ToolsChangeLog">releases/WebKitGTK/webkit-2.4/Tools/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsTestWebKitAPIGNUmakefileam">releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/GNUmakefile.am</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsTestWebKitAPITestsWebKit2GtkCMakeListstxt">releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsTestWebKitAPITestsWebKit2GtkDOMNodeTestcpp">releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/DOMNodeTest.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsTestWebKitAPITestsWebKit2GtkFrameTestcpp">releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/FrameTest.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsTestWebKitAPITestsWebKit2GtkTestDOMNodecpp">releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNode.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsTestWebKitAPITestsWebKit2GtkTestFramecpp">releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestFrame.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsTestWebKitAPITestsWebKit2GtkWebProcessTestcpp">releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsTestWebKitAPITestsWebKit2GtkWebProcessTesth">releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.h</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsTestWebKitAPIgtkWebKit2GtkWebViewTestcpp">releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsTestWebKitAPIgtkWebKit2GtkWebViewTesth">releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit24ToolsTestWebKitAPIgtkWebKit2GtkWebProcessTestRunnercpp">releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsTestWebKitAPIgtkWebKit2GtkWebProcessTestRunnerh">releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit24ToolsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/ChangeLog (182474 => 182475)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/ChangeLog        2015-04-07 16:05:47 UTC (rev 182474)
+++ releases/WebKitGTK/webkit-2.4/Tools/ChangeLog        2015-04-07 16:32:23 UTC (rev 182475)
</span><span class="lines">@@ -1,3 +1,80 @@
</span><ins>+2014-11-28  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Use custom JavaScript instead of DBus to implement WebProcess tests
+        https://bugs.webkit.org/show_bug.cgi?id=138834
+
+        Reviewed by Sergio Villar Senin.
+
+        It makes everyting simpler and the tests run faster too, since we
+        don't need to spawn the private bus and wait until the DBus name
+        is registered. The web extension registers a new JavaSCript class
+        with a status method to run the tests, similar to the DBus
+        method. In the UI process side, tests use webkit_web_view_run_java_script()
+        instead of sending a DBus message.
+
+        * TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt:
+        * TestWebKitAPI/Tests/WebKit2Gtk/DOMNodeFilterTest.cpp:
+        (WebKitDOMNodeFilterTest::create):
+        (WebKitDOMNodeFilterTest::testTreeWalker):
+        (WebKitDOMNodeFilterTest::testNodeIterator):
+        (WebKitDOMNodeFilterTest::webPageFromArgs): Deleted.
+        (WebKitDOMNodeFilterTest::runTest): Deleted.
+        * TestWebKitAPI/Tests/WebKit2Gtk/DOMNodeTest.cpp:
+        (WebKitDOMNodeTest::create):
+        (WebKitDOMNodeTest::testHierarchyNavigation):
+        (WebKitDOMNodeTest::testInsertion):
+        (WebKitDOMNodeTest::testTagNames):
+        (WebKitDOMNodeTest::webPageFromArgs): Deleted.
+        (WebKitDOMNodeTest::runTest): Deleted.
+        * TestWebKitAPI/Tests/WebKit2Gtk/DOMXPathNSResolverTest.cpp:
+        (WebKitDOMXPathNSResolverTest::create):
+        (WebKitDOMXPathNSResolverTest::testXPathNSResolverNative):
+        (WebKitDOMXPathNSResolverTest::testXPathNSResolverCustom):
+        (WebKitDOMXPathNSResolverTest::webPageFromArgs): Deleted.
+        (WebKitDOMXPathNSResolverTest::runTest): Deleted.
+        * TestWebKitAPI/Tests/WebKit2Gtk/FrameTest.cpp:
+        (WebKitFrameTest::create):
+        (WebKitFrameTest::testMainFrame):
+        (WebKitFrameTest::testURI):
+        (WebKitFrameTest::testJavaScriptContext):
+        (WebKitFrameTest::webPageFromArgs): Deleted.
+        (WebKitFrameTest::runTest): Deleted.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNode.cpp:
+        (testWebKitDOMNodeHierarchyNavigation):
+        (testWebKitDOMNodeInsertion):
+        (testWebKitDOMNodeTagNames):
+        (beforeAll):
+        (afterAll):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNodeFilter.cpp:
+        (runTest):
+        (beforeAll):
+        (afterAll):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestDOMXPathNSResolver.cpp:
+        (testWebKitDOMXPathNSResolverNative):
+        (testWebKitDOMXPathNSResolverCustom):
+        (beforeAll):
+        (afterAll):
+        (runTest): Deleted.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestFrame.cpp:
+        (webkitFrameTestRun):
+        (beforeAll):
+        (afterAll):
+        * TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.cpp:
+        (testsMap):
+        (WebProcessTest::add):
+        (WebProcessTest::create):
+        (runTest):
+        (windowObjectClearedCallback):
+        (webkit_web_extension_initialize):
+        (methodCallCallback): Deleted.
+        (webkit_web_extension_initialize_with_user_data): Deleted.
+        * TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.h:
+        * TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.cpp: Removed.
+        * TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.h: Removed.
+        * TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
+        (WebViewTest::runWebProcessTest):
+        * TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h:
+
</ins><span class="cx"> 2015-01-19  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] [WK2] TestWebKitWebView snapshot fails
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsTestWebKitAPIGNUmakefileam"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/GNUmakefile.am (182474 => 182475)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/GNUmakefile.am        2015-04-07 16:05:47 UTC (rev 182474)
+++ releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/GNUmakefile.am        2015-04-07 16:32:23 UTC (rev 182475)
</span><span class="lines">@@ -99,8 +99,6 @@
</span><span class="cx">         Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestBus.h \
</span><span class="cx">         Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestServer.cpp \
</span><span class="cx">         Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestServer.h \
</span><del>-        Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.cpp \
-        Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.h \
</del><span class="cx">         Tools/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.cpp \
</span><span class="cx">         Tools/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h \
</span><span class="cx">         Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp \
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsTestWebKitAPITestsWebKit2GtkCMakeListstxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt (182474 => 182475)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt        2015-04-07 16:05:47 UTC (rev 182474)
+++ releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt        2015-04-07 16:32:23 UTC (rev 182475)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx">     ${TOOLS_DIR}/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp
</span><span class="cx">     ${TOOLS_DIR}/TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestBus.cpp
</span><span class="cx">     ${TOOLS_DIR}/TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestServer.cpp
</span><del>-    ${TOOLS_DIR}/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.cpp
</del><span class="cx">     ${TOOLS_DIR}/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.cpp
</span><span class="cx">     ${TOOLS_DIR}/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp
</span><span class="cx"> )
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsTestWebKitAPITestsWebKit2GtkDOMNodeTestcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/DOMNodeTest.cpp (182474 => 182475)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/DOMNodeTest.cpp        2015-04-07 16:05:47 UTC (rev 182474)
+++ releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/DOMNodeTest.cpp        2015-04-07 16:32:23 UTC (rev 182475)
</span><span class="lines">@@ -26,29 +26,11 @@
</span><span class="cx"> 
</span><span class="cx"> class WebKitDOMNodeTest : public WebProcessTest {
</span><span class="cx"> public:
</span><del>-    static PassOwnPtr&lt;WebProcessTest&gt; create() { return adoptPtr(new WebKitDOMNodeTest()); }
</del><ins>+    static std::unique_ptr&lt;WebProcessTest&gt; create() { return std::unique_ptr&lt;WebKitDOMNodeTest&gt;(new WebKitDOMNodeTest()); }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    guint64 webPageFromArgs(GVariant* args)
</del><ins>+    bool testHierarchyNavigation(WebKitWebPage* page)
</ins><span class="cx">     {
</span><del>-        GVariantIter iter;
-        g_variant_iter_init(&amp;iter, args);
-
-        const char* key;
-        GVariant* value;
-        while (g_variant_iter_loop(&amp;iter, &quot;{&amp;sv}&quot;, &amp;key, &amp;value)) {
-            if (!strcmp(key, &quot;pageID&quot;) &amp;&amp; g_variant_classify(value) == G_VARIANT_CLASS_UINT64)
-                return g_variant_get_uint64(value);
-        }
-
-        g_assert_not_reached();
-        return 0;
-    }
-
-    bool testHierarchyNavigation(WebKitWebExtension* extension, GVariant* args)
-    {
-        WebKitWebPage* page = webkit_web_extension_get_page(extension, webPageFromArgs(args));
-        g_assert(WEBKIT_IS_WEB_PAGE(page));
</del><span class="cx">         WebKitDOMDocument* document = webkit_web_page_get_dom_document(page);
</span><span class="cx">         g_assert(WEBKIT_DOM_IS_DOCUMENT(document));
</span><span class="cx"> 
</span><span class="lines">@@ -95,10 +77,8 @@
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool testInsertion(WebKitWebExtension* extension, GVariant* args)
</del><ins>+    bool testInsertion(WebKitWebPage* page)
</ins><span class="cx">     {
</span><del>-        WebKitWebPage* page = webkit_web_extension_get_page(extension, webPageFromArgs(args));
-        g_assert(WEBKIT_IS_WEB_PAGE(page));
</del><span class="cx">         WebKitDOMDocument* document = webkit_web_page_get_dom_document(page);
</span><span class="cx">         g_assert(WEBKIT_DOM_IS_DOCUMENT(document));
</span><span class="cx"> 
</span><span class="lines">@@ -170,12 +150,10 @@
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool testTagNames(WebKitWebExtension* extension, GVariant* args)
</del><ins>+    bool testTagNames(WebKitWebPage* page)
</ins><span class="cx">     {
</span><span class="cx">         static const char* expectedTagNames[] = { &quot;HTML&quot;, &quot;HEAD&quot;, &quot;BODY&quot;, &quot;VIDEO&quot;, &quot;SOURCE&quot;, &quot;VIDEO&quot;, &quot;SOURCE&quot;, &quot;INPUT&quot; };
</span><span class="cx"> 
</span><del>-        WebKitWebPage* page = webkit_web_extension_get_page(extension, webPageFromArgs(args));
-        g_assert(WEBKIT_IS_WEB_PAGE(page));
</del><span class="cx">         WebKitDOMDocument* document = webkit_web_page_get_dom_document(page);
</span><span class="cx">         g_assert(WEBKIT_DOM_IS_DOCUMENT(document));
</span><span class="cx"> 
</span><span class="lines">@@ -192,14 +170,14 @@
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual bool runTest(const char* testName, WebKitWebExtension* extension, GVariant* args)
</del><ins>+    bool runTest(const char* testName, WebKitWebPage* page) override
</ins><span class="cx">     {
</span><span class="cx">         if (!strcmp(testName, &quot;hierarchy-navigation&quot;))
</span><del>-            return testHierarchyNavigation(extension, args);
</del><ins>+            return testHierarchyNavigation(page);
</ins><span class="cx">         if (!strcmp(testName, &quot;insertion&quot;))
</span><del>-            return testInsertion(extension, args);
</del><ins>+            return testInsertion(page);
</ins><span class="cx">         if (!strcmp(testName, &quot;tag-names&quot;))
</span><del>-            return testTagNames(extension, args);
</del><ins>+            return testTagNames(page);
</ins><span class="cx"> 
</span><span class="cx">         g_assert_not_reached();
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsTestWebKitAPITestsWebKit2GtkFrameTestcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/FrameTest.cpp (182474 => 182475)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/FrameTest.cpp        2015-04-07 16:05:47 UTC (rev 182474)
+++ releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/FrameTest.cpp        2015-04-07 16:32:23 UTC (rev 182475)
</span><span class="lines">@@ -25,30 +25,11 @@
</span><span class="cx"> 
</span><span class="cx"> class WebKitFrameTest : public WebProcessTest {
</span><span class="cx"> public:
</span><del>-    static PassOwnPtr&lt;WebProcessTest&gt; create() { return adoptPtr(new WebKitFrameTest()); }
</del><ins>+    static std::unique_ptr&lt;WebProcessTest&gt; create() { return std::unique_ptr&lt;WebProcessTest&gt;(new WebKitFrameTest()); }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    guint64 webPageFromArgs(GVariant* args)
</del><ins>+    bool testMainFrame(WebKitWebPage* page)
</ins><span class="cx">     {
</span><del>-        GVariantIter iter;
-        g_variant_iter_init(&amp;iter, args);
-
-        const char* key;
-        GVariant* value;
-        while (g_variant_iter_loop(&amp;iter, &quot;{&amp;sv}&quot;, &amp;key, &amp;value)) {
-            if (!strcmp(key, &quot;pageID&quot;) &amp;&amp; g_variant_classify(value) == G_VARIANT_CLASS_UINT64)
-                return g_variant_get_uint64(value);
-        }
-
-        g_assert_not_reached();
-        return 0;
-    }
-
-    bool testMainFrame(WebKitWebExtension* extension, GVariant* args)
-    {
-        WebKitWebPage* page = webkit_web_extension_get_page(extension, webPageFromArgs(args));
-        g_assert(WEBKIT_IS_WEB_PAGE(page));
-
</del><span class="cx">         WebKitFrame* frame = webkit_web_page_get_main_frame(page);
</span><span class="cx">         g_assert(WEBKIT_IS_FRAME(frame));
</span><span class="cx">         g_assert(webkit_frame_is_main_frame(frame));
</span><span class="lines">@@ -56,11 +37,8 @@
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool testURI(WebKitWebExtension* extension, GVariant* args)
</del><ins>+    bool testURI(WebKitWebPage* page)
</ins><span class="cx">     {
</span><del>-        WebKitWebPage* page = webkit_web_extension_get_page(extension, webPageFromArgs(args));
-        g_assert(WEBKIT_IS_WEB_PAGE(page));
-
</del><span class="cx">         WebKitFrame* frame = webkit_web_page_get_main_frame(page);
</span><span class="cx">         g_assert(WEBKIT_IS_FRAME(frame));
</span><span class="cx">         g_assert_cmpstr(webkit_web_page_get_uri(page), ==, webkit_frame_get_uri(frame));
</span><span class="lines">@@ -68,11 +46,8 @@
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool testJavaScriptContext(WebKitWebExtension* extension, GVariant* args)
</del><ins>+    bool testJavaScriptContext(WebKitWebPage* page)
</ins><span class="cx">     {
</span><del>-        WebKitWebPage* page = webkit_web_extension_get_page(extension, webPageFromArgs(args));
-        g_assert(WEBKIT_IS_WEB_PAGE(page));
-
</del><span class="cx">         WebKitFrame* frame = webkit_web_page_get_main_frame(page);
</span><span class="cx">         g_assert(WEBKIT_IS_FRAME(frame));
</span><span class="cx">         g_assert(webkit_frame_get_javascript_global_context(frame));
</span><span class="lines">@@ -80,14 +55,14 @@
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual bool runTest(const char* testName, WebKitWebExtension* extension, GVariant* args)
</del><ins>+    bool runTest(const char* testName, WebKitWebPage* page) override
</ins><span class="cx">     {
</span><span class="cx">         if (!strcmp(testName, &quot;main-frame&quot;))
</span><del>-            return testMainFrame(extension, args);
</del><ins>+            return testMainFrame(page);
</ins><span class="cx">         if (!strcmp(testName, &quot;uri&quot;))
</span><del>-            return testURI(extension, args);
</del><ins>+            return testURI(page);
</ins><span class="cx">         if (!strcmp(testName, &quot;javascript-context&quot;))
</span><del>-            return testJavaScriptContext(extension, args);
</del><ins>+            return testJavaScriptContext(page);
</ins><span class="cx"> 
</span><span class="cx">         g_assert_not_reached();
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsTestWebKitAPITestsWebKit2GtkTestDOMNodecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNode.cpp (182474 => 182475)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNode.cpp        2015-04-07 16:05:47 UTC (rev 182474)
+++ releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNode.cpp        2015-04-07 16:32:23 UTC (rev 182475)
</span><span class="lines">@@ -19,23 +19,17 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;WebProcessTestRunner.h&quot;
</del><span class="cx"> #include &quot;WebViewTest.h&quot;
</span><span class="cx"> #include &lt;gtk/gtk.h&gt;
</span><span class="cx"> #include &lt;webkit2/webkit2.h&gt;
</span><span class="cx"> 
</span><del>-static WebProcessTestRunner* testRunner;
-
</del><span class="cx"> static void testWebKitDOMNodeHierarchyNavigation(WebViewTest* test, gconstpointer)
</span><span class="cx"> {
</span><span class="cx">     static const char* testHTML = &quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;This is the title&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;1&lt;/p&gt;&lt;p&gt;2&lt;/p&gt;&lt;p&gt;3&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;&quot;;
</span><span class="cx">     test-&gt;loadHtml(testHTML, 0);
</span><span class="cx">     test-&gt;waitUntilLoadFinished();
</span><span class="cx"> 
</span><del>-    GVariantBuilder builder;
-    g_variant_builder_init(&amp;builder, G_VARIANT_TYPE_VARDICT);
-    g_variant_builder_add(&amp;builder, &quot;{sv}&quot;, &quot;pageID&quot;, g_variant_new_uint64(webkit_web_view_get_page_id(test-&gt;m_webView)));
-    g_assert(testRunner-&gt;runTest(&quot;WebKitDOMNode&quot;, &quot;hierarchy-navigation&quot;, g_variant_builder_end(&amp;builder)));
</del><ins>+    g_assert(test-&gt;runWebProcessTest(&quot;WebKitDOMNode&quot;, &quot;hierarchy-navigation&quot;));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void testWebKitDOMNodeInsertion(WebViewTest* test, gconstpointer)
</span><span class="lines">@@ -44,10 +38,7 @@
</span><span class="cx">     test-&gt;loadHtml(testHTML, 0);
</span><span class="cx">     test-&gt;waitUntilLoadFinished();
</span><span class="cx"> 
</span><del>-    GVariantBuilder builder;
-    g_variant_builder_init(&amp;builder, G_VARIANT_TYPE_VARDICT);
-    g_variant_builder_add(&amp;builder, &quot;{sv}&quot;, &quot;pageID&quot;, g_variant_new_uint64(webkit_web_view_get_page_id(test-&gt;m_webView)));
-    g_assert(testRunner-&gt;runTest(&quot;WebKitDOMNode&quot;, &quot;insertion&quot;, g_variant_builder_end(&amp;builder)));
</del><ins>+    g_assert(test-&gt;runWebProcessTest(&quot;WebKitDOMNode&quot;, &quot;insertion&quot;));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void testWebKitDOMNodeTagNames(WebViewTest* test, gconstpointer)
</span><span class="lines">@@ -65,15 +56,11 @@
</span><span class="cx">     test-&gt;loadHtml(testHTML, 0);
</span><span class="cx">     test-&gt;waitUntilLoadFinished();
</span><span class="cx"> 
</span><del>-    GVariantBuilder builder;
-    g_variant_builder_init(&amp;builder, G_VARIANT_TYPE_VARDICT);
-    g_variant_builder_add(&amp;builder, &quot;{sv}&quot;, &quot;pageID&quot;, g_variant_new_uint64(webkit_web_view_get_page_id(test-&gt;m_webView)));
-    g_assert(testRunner-&gt;runTest(&quot;WebKitDOMNode&quot;, &quot;tag-names&quot;, g_variant_builder_end(&amp;builder)));
</del><ins>+    g_assert(test-&gt;runWebProcessTest(&quot;WebKitDOMNode&quot;, &quot;tag-names&quot;));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void beforeAll()
</span><span class="cx"> {
</span><del>-    testRunner = new WebProcessTestRunner();
</del><span class="cx">     webkit_web_context_set_web_extensions_directory(webkit_web_context_get_default(), WEBKIT_TEST_WEB_EXTENSIONS_DIR);
</span><span class="cx"> 
</span><span class="cx">     WebViewTest::add(&quot;WebKitDOMNode&quot;, &quot;hierarchy-navigation&quot;, testWebKitDOMNodeHierarchyNavigation);
</span><span class="lines">@@ -83,5 +70,4 @@
</span><span class="cx"> 
</span><span class="cx"> void afterAll()
</span><span class="cx"> {
</span><del>-    delete testRunner;
</del><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsTestWebKitAPITestsWebKit2GtkTestFramecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestFrame.cpp (182474 => 182475)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestFrame.cpp        2015-04-07 16:05:47 UTC (rev 182474)
+++ releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestFrame.cpp        2015-04-07 16:32:23 UTC (rev 182475)
</span><span class="lines">@@ -19,23 +19,17 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;WebProcessTestRunner.h&quot;
</del><span class="cx"> #include &quot;WebViewTest.h&quot;
</span><span class="cx"> #include &lt;gtk/gtk.h&gt;
</span><span class="cx"> #include &lt;webkit2/webkit2.h&gt;
</span><span class="cx"> 
</span><del>-static WebProcessTestRunner* testRunner;
-
</del><span class="cx"> static void webkitFrameTestRun(WebViewTest* test, const char* testName)
</span><span class="cx"> {
</span><span class="cx">     static const char* testHTML = &quot;&lt;html&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;&quot;;
</span><span class="cx">     test-&gt;loadHtml(testHTML, 0);
</span><span class="cx">     test-&gt;waitUntilLoadFinished();
</span><span class="cx"> 
</span><del>-    GVariantBuilder builder;
-    g_variant_builder_init(&amp;builder, G_VARIANT_TYPE_VARDICT);
-    g_variant_builder_add(&amp;builder, &quot;{sv}&quot;, &quot;pageID&quot;, g_variant_new_uint64(webkit_web_view_get_page_id(test-&gt;m_webView)));
-    g_assert(testRunner-&gt;runTest(&quot;WebKitFrame&quot;, testName, g_variant_builder_end(&amp;builder)));
</del><ins>+    g_assert(test-&gt;runWebProcessTest(&quot;WebKitFrame&quot;, testName));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void testWebKitFrameMainFrame(WebViewTest* test, gconstpointer)
</span><span class="lines">@@ -55,7 +49,6 @@
</span><span class="cx"> 
</span><span class="cx"> void beforeAll()
</span><span class="cx"> {
</span><del>-    testRunner = new WebProcessTestRunner();
</del><span class="cx">     webkit_web_context_set_web_extensions_directory(webkit_web_context_get_default(), WEBKIT_TEST_WEB_EXTENSIONS_DIR);
</span><span class="cx"> 
</span><span class="cx">     WebViewTest::add(&quot;WebKitFrame&quot;, &quot;main-frame&quot;, testWebKitFrameMainFrame);
</span><span class="lines">@@ -65,5 +58,4 @@
</span><span class="cx"> 
</span><span class="cx"> void afterAll()
</span><span class="cx"> {
</span><del>-    delete testRunner;
</del><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsTestWebKitAPITestsWebKit2GtkWebProcessTestcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.cpp (182474 => 182475)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.cpp        2015-04-07 16:05:47 UTC (rev 182474)
+++ releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.cpp        2015-04-07 16:32:23 UTC (rev 182475)
</span><span class="lines">@@ -20,87 +20,73 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebProcessTest.h&quot;
</span><span class="cx"> 
</span><ins>+#include &lt;JavaScriptCore/JSRetainPtr.h&gt;
</ins><span class="cx"> #include &lt;gio/gio.h&gt;
</span><ins>+#include &lt;wtf/NeverDestroyed.h&gt;
</ins><span class="cx"> #include &lt;wtf/gobject/GUniquePtr.h&gt;
</span><span class="cx"> 
</span><del>-typedef HashMap&lt;String, std::function&lt;PassOwnPtr&lt;WebProcessTest&gt; ()&gt;&gt; TestsMap;
</del><ins>+typedef HashMap&lt;String, std::function&lt;std::unique_ptr&lt;WebProcessTest&gt; ()&gt;&gt; TestsMap;
</ins><span class="cx"> static TestsMap&amp; testsMap()
</span><span class="cx"> {
</span><del>-    DEFINE_STATIC_LOCAL(TestsMap, s_testsMap, ());
</del><ins>+    static NeverDestroyed&lt;TestsMap&gt; s_testsMap;
</ins><span class="cx">     return s_testsMap;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebProcessTest::add(const String&amp; testName, std::function&lt;PassOwnPtr&lt;WebProcessTest&gt; ()&gt; closure)
</del><ins>+void WebProcessTest::add(const String&amp; testName, std::function&lt;std::unique_ptr&lt;WebProcessTest&gt; ()&gt; closure)
</ins><span class="cx"> {
</span><del>-    testsMap().add(testName, std::forward&lt;std::function&lt;PassOwnPtr&lt;WebProcessTest&gt; ()&gt;&gt;(closure));
</del><ins>+    testsMap().add(testName, std::move(closure));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassOwnPtr&lt;WebProcessTest&gt; WebProcessTest::create(const String&amp; testName)
</del><ins>+std::unique_ptr&lt;WebProcessTest&gt; WebProcessTest::create(const String&amp; testName)
</ins><span class="cx"> {
</span><span class="cx">     g_assert(testsMap().contains(testName));
</span><span class="cx">     return testsMap().get(testName)();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static const char introspectionXML[] =
-    &quot;&lt;node&gt;&quot;
-    &quot; &lt;interface name='org.webkit.gtk.WebProcessTest'&gt;&quot;
-    &quot;  &lt;method name='RunTest'&gt;&quot;
-    &quot;   &lt;arg type='s' name='path' direction='in'/&gt;&quot;
-    &quot;   &lt;arg type='a{sv}' name='args' direction='in'/&gt;&quot;
-    &quot;   &lt;arg type='b' name='result' direction='out'/&gt;&quot;
-    &quot;  &lt;/method&gt;&quot;
-    &quot; &lt;/interface&gt;&quot;
-    &quot;&lt;/node&gt;&quot;;
-
-static void methodCallCallback(GDBusConnection* connection, const char* sender, const char* objectPath, const char* interfaceName, const char* methodName, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer userData)
</del><ins>+static JSValueRef runTest(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</ins><span class="cx"> {
</span><del>-    if (g_strcmp0(interfaceName, &quot;org.webkit.gtk.WebProcessTest&quot;))
-        return;
</del><ins>+    JSRetainPtr&lt;JSStringRef&gt; stringValue(Adopt, JSValueToStringCopy(context, arguments[0], nullptr));
+    g_assert(stringValue);
+    size_t testPathLength = JSStringGetMaximumUTF8CStringSize(stringValue.get());
+    GUniquePtr&lt;char&gt; testPath(static_cast&lt;char*&gt;(g_malloc(testPathLength)));
+    JSStringGetUTF8CString(stringValue.get(), testPath.get(), testPathLength);
</ins><span class="cx"> 
</span><del>-    if (!g_strcmp0(methodName, &quot;RunTest&quot;)) {
-        const char* testPath;
-        GVariant* args;
-        g_variant_get(parameters, &quot;(&amp;s@a{sv})&quot;, &amp;testPath, &amp;args);
-        OwnPtr&lt;WebProcessTest&gt; test = WebProcessTest::create(String::fromUTF8(testPath));
-        bool result = test-&gt;runTest(g_strrstr(testPath, &quot;/&quot;) + 1, WEBKIT_WEB_EXTENSION(userData), args);
-        g_variant_unref(args);
</del><ins>+    WebKitWebPage* webPage = WEBKIT_WEB_PAGE(JSObjectGetPrivate(thisObject));
+    g_assert(WEBKIT_IS_WEB_PAGE(webPage));
</ins><span class="cx"> 
</span><del>-        g_dbus_method_invocation_return_value(invocation, g_variant_new(&quot;(b)&quot;, result));
-    } else
-        g_assert_not_reached();
</del><ins>+    std::unique_ptr&lt;WebProcessTest&gt; test = WebProcessTest::create(String::fromUTF8(testPath.get()));
+    return JSValueMakeBoolean(context, test-&gt;runTest(g_strrstr(testPath.get(), &quot;/&quot;) + 1, webPage));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static const GDBusInterfaceVTable interfaceVirtualTable = {
-    methodCallCallback, 0, 0, { 0, }
</del><ins>+static const JSStaticFunction webProcessTestRunnerStaticFunctions[] =
+{
+    { &quot;runTest&quot;, runTest, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+    { nullptr, nullptr, 0 }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-static void busAcquiredCallback(GDBusConnection* connection, const char* name, gpointer userData)
</del><ins>+static void webProcessTestRunnerFinalize(JSObjectRef object)
</ins><span class="cx"> {
</span><del>-    static GDBusNodeInfo* introspectionData = 0;
-    if (!introspectionData)
-        introspectionData = g_dbus_node_info_new_for_xml(introspectionXML, 0);
</del><ins>+    g_object_unref(JSObjectGetPrivate(object));
+}
</ins><span class="cx"> 
</span><del>-    GUniqueOutPtr&lt;GError&gt; error;
-    unsigned registrationID = g_dbus_connection_register_object(
-        connection,
-        &quot;/org/webkit/gtk/WebProcessTest&quot;,
-        introspectionData-&gt;interfaces[0],
-        &amp;interfaceVirtualTable,
-        g_object_ref(userData),
-        static_cast&lt;GDestroyNotify&gt;(g_object_unref),
-        &amp;error.outPtr());
-    if (!registrationID)
-        g_warning(&quot;Failed to register object: %s\n&quot;, error-&gt;message);
</del><ins>+static void windowObjectClearedCallback(WebKitScriptWorld* world, WebKitWebPage* webPage, WebKitFrame* frame, WebKitWebExtension* extension)
+{
+    JSGlobalContextRef context = webkit_frame_get_javascript_context_for_script_world(frame, world);
+    JSObjectRef globalObject = JSContextGetGlobalObject(context);
+
+    JSClassDefinition classDefinition = kJSClassDefinitionEmpty;
+    classDefinition.className = &quot;WebProcessTestRunner&quot;;
+    classDefinition.staticFunctions = webProcessTestRunnerStaticFunctions;
+    classDefinition.finalize = webProcessTestRunnerFinalize;
+
+    JSClassRef jsClass = JSClassCreate(&amp;classDefinition);
+    JSObjectRef classObject = JSObjectMake(context, jsClass, g_object_ref(webPage));
+    JSRetainPtr&lt;JSStringRef&gt; propertyString(Adopt, JSStringCreateWithUTF8CString(&quot;WebProcessTestRunner&quot;));
+    JSObjectSetProperty(context, globalObject, propertyString.get(), classObject, kJSPropertyAttributeNone, nullptr);
+    JSClassRelease(jsClass);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> extern &quot;C&quot; void webkit_web_extension_initialize(WebKitWebExtension* extension)
</span><span class="cx"> {
</span><del>-    g_bus_own_name(
-        G_BUS_TYPE_SESSION,
-        &quot;org.webkit.gtk.WebProcessTest&quot;,
-        G_BUS_NAME_OWNER_FLAGS_NONE,
-        busAcquiredCallback,
-        0, 0,
-        g_object_ref(extension),
-        static_cast&lt;GDestroyNotify&gt;(g_object_unref));
</del><ins>+    g_signal_connect(webkit_script_world_get_default(), &quot;window-object-cleared&quot;, G_CALLBACK(windowObjectClearedCallback), extension);
</ins><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsTestWebKitAPITestsWebKit2GtkWebProcessTesth"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.h (182474 => 182475)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.h        2015-04-07 16:05:47 UTC (rev 182474)
+++ releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.h        2015-04-07 16:32:23 UTC (rev 182475)
</span><span class="lines">@@ -19,7 +19,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;webkit2/webkit-web-extension.h&gt;
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><del>-#include &lt;wtf/PassOwnPtr.h&gt;
</del><span class="cx"> #include &lt;wtf/gobject/GRefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringHash.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="lines">@@ -27,10 +26,10 @@
</span><span class="cx"> class WebProcessTest {
</span><span class="cx"> public:
</span><span class="cx">     virtual ~WebProcessTest() { }
</span><del>-    virtual bool runTest(const char* testName, WebKitWebExtension*, GVariant* args) = 0;
</del><ins>+    virtual bool runTest(const char* testName, WebKitWebPage*) = 0;
</ins><span class="cx"> 
</span><del>-    static void add(const String&amp; testName, std::function&lt;PassOwnPtr&lt;WebProcessTest&gt; ()&gt;);
-    static PassOwnPtr&lt;WebProcessTest&gt; create(const String&amp; testName);
</del><ins>+    static void add(const String&amp; testName, std::function&lt;std::unique_ptr&lt;WebProcessTest&gt; ()&gt;);
+    static std::unique_ptr&lt;WebProcessTest&gt; create(const String&amp; testName);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> #define REGISTER_TEST(ClassName, TestName) \
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsTestWebKitAPIgtkWebKit2GtkWebProcessTestRunnercpp"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.cpp (182474 => 182475)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.cpp        2015-04-07 16:05:47 UTC (rev 182474)
+++ releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.cpp        2015-04-07 16:32:23 UTC (rev 182475)
</span><span class="lines">@@ -1,115 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Igalia S.L.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include &quot;config.h&quot;
-#include &quot;WebProcessTestRunner.h&quot;
-
-#include &lt;wtf/gobject/GUniquePtr.h&gt;
-
-WebProcessTestRunner::WebProcessTestRunner()
-    : m_mainLoop(g_main_loop_new(0, TRUE))
-    , m_bus(adoptGRef(g_test_dbus_new(G_TEST_DBUS_NONE)))
-{
-    // Save the DISPLAY env var to restore it after calling g_test_dbus_up() that unsets it.
-    // See https://bugs.webkit.org/show_bug.cgi?id=125621.
-    const char* display = g_getenv(&quot;DISPLAY&quot;);
-    g_test_dbus_up(m_bus.get());
-    g_setenv(&quot;DISPLAY&quot;, display, FALSE);
-    m_connection = adoptGRef(g_bus_get_sync(G_BUS_TYPE_SESSION, 0, 0));
-}
-
-WebProcessTestRunner::~WebProcessTestRunner()
-{
-    g_main_loop_unref(m_mainLoop);
-
-    // g_test_dbus_down waits until the connection is freed, so release our refs explicitly before calling it.
-    m_connection = 0;
-    m_proxy = 0;
-    g_test_dbus_down(m_bus.get());
-}
-
-void WebProcessTestRunner::proxyCreatedCallback(GObject*, GAsyncResult* result, WebProcessTestRunner* testRunner)
-{
-    testRunner-&gt;m_proxy = adoptGRef(g_dbus_proxy_new_finish(result, 0));
-    g_main_loop_quit(testRunner-&gt;m_mainLoop);
-}
-
-GDBusProxy* WebProcessTestRunner::proxy()
-{
-    if (m_proxy)
-        return m_proxy.get();
-
-    g_dbus_proxy_new(m_connection.get(), G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, 0,
-        &quot;org.webkit.gtk.WebProcessTest&quot;, &quot;/org/webkit/gtk/WebProcessTest&quot;, &quot;org.webkit.gtk.WebProcessTest&quot;,
-        0, reinterpret_cast&lt;GAsyncReadyCallback&gt;(WebProcessTestRunner::proxyCreatedCallback), this);
-    g_main_loop_run(m_mainLoop);
-    g_assert(m_proxy.get());
-
-    return m_proxy.get();
-}
-
-void WebProcessTestRunner::onNameAppeared(GDBusConnection*, const char*, const char*, gpointer userData)
-{
-    WebProcessTestRunner* testRunner = static_cast&lt;WebProcessTestRunner*&gt;(userData);
-    g_main_loop_quit(testRunner-&gt;m_mainLoop);
-}
-
-void WebProcessTestRunner::onNameVanished(GDBusConnection*, const char* name, gpointer userData)
-{
-    _exit(1);
-}
-
-void WebProcessTestRunner::testFinishedCallback(GDBusProxy* proxy, GAsyncResult* result, WebProcessTestRunner* testRunner)
-{
-    GRefPtr&lt;GVariant&gt; returnValue = adoptGRef(g_dbus_proxy_call_finish(proxy, result, 0));
-    g_assert(returnValue.get());
-    gboolean testResult;
-    g_variant_get(returnValue.get(), &quot;(b)&quot;, &amp;testResult);
-    testRunner-&gt;finishTest(testResult);
-}
-
-bool WebProcessTestRunner::runTest(const char* suiteName, const char* testName, GVariant* args)
-{
-    g_assert(g_variant_is_of_type(args, G_VARIANT_TYPE_VARDICT));
-
-    unsigned watcherID = g_bus_watch_name_on_connection(m_connection.get(), &quot;org.webkit.gtk.WebProcessTest&quot;, G_BUS_NAME_WATCHER_FLAGS_NONE,
-        WebProcessTestRunner::onNameAppeared, WebProcessTestRunner::onNameVanished, this, 0);
-    g_main_loop_run(m_mainLoop);
-
-    m_testResult = false;
-    GUniquePtr&lt;char&gt; testPath(g_strdup_printf(&quot;%s/%s&quot;, suiteName, testName));
-    g_dbus_proxy_call(
-        proxy(),
-        &quot;RunTest&quot;,
-        g_variant_new(&quot;(s@a{sv})&quot;, testPath.get(), args),
-        G_DBUS_CALL_FLAGS_NONE,
-        -1, 0,
-        reinterpret_cast&lt;GAsyncReadyCallback&gt;(WebProcessTestRunner::testFinishedCallback),
-        this);
-    g_main_loop_run(m_mainLoop);
-    g_bus_unwatch_name(watcherID);
-
-    return m_testResult;
-}
-
-void WebProcessTestRunner::finishTest(bool result)
-{
-    m_testResult = result;
-    g_main_loop_quit(m_mainLoop);
-}
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsTestWebKitAPIgtkWebKit2GtkWebProcessTestRunnerh"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.h (182474 => 182475)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.h        2015-04-07 16:05:47 UTC (rev 182474)
+++ releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.h        2015-04-07 16:32:23 UTC (rev 182475)
</span><span class="lines">@@ -1,50 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Igalia S.L.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef WebProcessTestRunner_h
-#define WebProcessTestRunner_h
-
-#include &lt;gio/gio.h&gt;
-#include &lt;webkit2/webkit2.h&gt;
-#include &lt;wtf/gobject/GRefPtr.h&gt;
-
-class WebProcessTestRunner {
-public:
-    WebProcessTestRunner();
-    ~WebProcessTestRunner();
-
-    bool runTest(const char* suiteName, const char* testName, GVariant* args);
-
-private:
-    static void proxyCreatedCallback(GObject*, GAsyncResult*, WebProcessTestRunner*);
-    static void onNameAppeared(GDBusConnection*, const char*, const char*, gpointer);
-    static void onNameVanished(GDBusConnection*, const char*, gpointer);
-    static void testFinishedCallback(GDBusProxy*, GAsyncResult*, WebProcessTestRunner*);
-
-    GDBusProxy* proxy();
-    void finishTest(bool result);
-
-    GMainLoop* m_mainLoop;
-    GRefPtr&lt;GTestDBus&gt; m_bus;
-    GRefPtr&lt;GDBusConnection&gt; m_connection;
-    GRefPtr&lt;GDBusProxy&gt; m_proxy;
-    bool m_testResult;
-};
-
-#endif // WebProcessTestRunner_h
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsTestWebKitAPIgtkWebKit2GtkWebViewTestcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp (182474 => 182475)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp        2015-04-07 16:05:47 UTC (rev 182474)
+++ releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp        2015-04-07 16:32:23 UTC (rev 182475)
</span><span class="lines">@@ -444,3 +444,12 @@
</span><span class="cx">     g_main_loop_run(m_mainLoop);
</span><span class="cx">     return m_surface;
</span><span class="cx"> }
</span><ins>+
+bool WebViewTest::runWebProcessTest(const char* suiteName, const char* testName)
+{
+    GUniquePtr&lt;char&gt; script(g_strdup_printf(&quot;WebProcessTestRunner.runTest('%s/%s');&quot;, suiteName, testName));
+    GUniqueOutPtr&lt;GError&gt; error;
+    WebKitJavascriptResult* javascriptResult = runJavaScriptAndWaitUntilFinished(script.get(), &amp;error.outPtr());
+    g_assert(!error);
+    return javascriptResultToBoolean(javascriptResult);
+}
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsTestWebKitAPIgtkWebKit2GtkWebViewTesth"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h (182474 => 182475)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h        2015-04-07 16:05:47 UTC (rev 182474)
+++ releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h        2015-04-07 16:32:23 UTC (rev 182475)
</span><span class="lines">@@ -68,6 +68,8 @@
</span><span class="cx"> 
</span><span class="cx">     cairo_surface_t* getSnapshotAndWaitUntilReady(WebKitSnapshotRegion, WebKitSnapshotOptions);
</span><span class="cx"> 
</span><ins>+    bool runWebProcessTest(const char* suiteName, const char* testName);
+
</ins><span class="cx">     WebKitWebView* m_webView;
</span><span class="cx">     GMainLoop* m_mainLoop;
</span><span class="cx">     CString m_activeURI;
</span></span></pre>
</div>
</div>

</body>
</html>