<!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>[176256] trunk</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/176256">176256</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2014-11-18 06:19:15 -0800 (Tue, 18 Nov 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] Add API to create a WebKitWebContext
https://bugs.webkit.org/show_bug.cgi?id=138826

Reviewed by Gustavo Noronha Silva.

Source/WebKit2:

We have always used a default web context without providing API to
create others. The main reason was that nobody requested it and we
haven't needed it either. The main problem of the default web
context is that you can't configure anything during
construction. This hasn't been a problem so far because all the
web context configuration we expose in the API can be configured
after construction. But now we need to expose API to allow the
user to configure the local storage directory, which is a
construct only configuration. The default web context was also a
problem for our unit tests, because sharing the same context made
it difficult to ensure tests cases are independent to each other.

* UIProcess/API/gtk/WebKitGeolocationProvider.cpp:
(WebKitGeolocationProvider::~WebKitGeolocationProvider): Reset the
provider to avoid crashes when web context is destroyed and a new
one is created.
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextConstructed): Add constructed implementation to
create the WebContext and initialize it.
(webkitWebContextDispose): Detach web context clients to avoid
crashes when a client callback is called on a disposed WebKitWebContext.
(webkit_web_context_class_init): Initialize gettext, add
constructed implementation and add the pointer to the vmethods
when creating signals.
(createDefaultWebContext): Simply create a WebKitWebContext.
(webkit_web_context_new): New public method to create a WebKitWebContext.
(injectedBundleFilename): Deleted.
* UIProcess/API/gtk/WebKitWebContext.h: Add virtual methods for
signals, so that users can inherit from WebKitWebContext and
override the virtual methods.
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbol.

Tools:

Use a different WebKitWebContext for every test to ensure test
cases are independent to each other. Tests using DBus to
communicate with the injected bundle extension now use a unique
name for the well known DBus name.

* TestWebKitAPI/Tests/WebKit2Gtk/TestAuthentication.cpp:
(beforeAll): Remove comment about the order of the tests and
move the success test before the failed one now that tests don't
depend on each others.
* TestWebKitAPI/Tests/WebKit2Gtk/TestContextMenu.cpp:
(beforeAll): Remove call to set the web extensions directory,
since this is now done for all test in the Test constructor.
* TestWebKitAPI/Tests/WebKit2Gtk/TestCookieManager.cpp:
(beforeAll): Do not create a temporary directory, a temporary data
directory is now created for all tests.
(afterAll):
* TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNode.cpp:
(testWebKitDOMNodeHierarchyNavigation): Pass the web extension ID
to the web process test runner.
(testWebKitDOMNodeInsertion): Ditto.
(testWebKitDOMNodeTagNames): Ditto.
(beforeAll): Remove call to set the web extensions directory.
* TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNodeFilter.cpp:
(runTest): Pass the web extension ID to the web process test runner.
(beforeAll): Remove call to set the web extensions directory.
* TestWebKitAPI/Tests/WebKit2Gtk/TestDOMXPathNSResolver.cpp:
(runTest): Pass the web extension ID to the web process test runner.
(beforeAll): Remove call to set the web extensions directory.
* TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp:
(createFileAtDestination): Use Test::dataDirectory() as base dir
for temporary files.
(beforeAll): Do not create a temporary directory.
(afterAll):
* TestWebKitAPI/Tests/WebKit2Gtk/TestFrame.cpp:
(webkitFrameTestRun): Pass the web extension ID to the web process
test runner.
(beforeAll): Remove call to set the web extensions directory.
* TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp:
(beforeAll): Remove call to set the web extensions directory.
* TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp:
(testProcessPerWebView): Use local member instead of global variable.
(testMultiprocessWebViewCreateReadyClose): Ditto.
(beforeAll): Do not connect to initialize-web-extensions, Test now
connects to the signal for all tests and calls a virtual method
that test can override.
(afterAll):
(initializeWebExtensions): Deleted.
* TestWebKitAPI/Tests/WebKit2Gtk/TestPrinting.cpp:
(testPrintOperationPrint): Use Test::dataDirectory() as base dir
for temporary files.
(beforeAll): Do not create a temporary directory.
(afterAll):
* TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp:
(beforeAll): Remove call to set the web extensions directory.
* TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp:
(beforeAll): Remove comment about the tests order.
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebExtensions.cpp:
(testWebExtensionGetTitle): Build the DBus service name using the
web extension ID.
(testDocumentLoadedSignal): Ditto.
(testWebKitWebViewProcessCrashed): Ditto.
(testWebExtensionIsolatedWorld): Ditto.
(beforeAll): Remove initialization-user-data test, since now all
tests are passing user data to the web extension.
(testWebExtensionInitializationUserData): Deleted.
(initializeWebExtensions): Deleted.
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp:
(testSetDirectory): Use the web context member inherited from Test.
(testClearDatabase): Ditto.
(testGetFaviconURI): Ditto.
(beforeAll): Do not create a temporary directory.
(afterAll):
(webkitFaviconDatabaseFinalizedCallback): Deleted.
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitUserContentManager.cpp:
(UserContentManagerTest::UserContentManagerTest):
(beforeAll): Remove call to set the web extensions directory.
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp:
(testWebContextDefault): Check also that a newly create web
context is not the default web context.
(testWebContextSpellChecker): Use the web context member inherited
from Test.
(testWebContextLanguages): Ditto.
* TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp:
(methodCallCallback): Remove GetInitializationUserData method.
(webkit_web_extension_initialize_with_user_data): Always create
the DBus name using the user data provided.
(makeBusName): Deleted.
* TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.cpp:
(webkit_web_extension_initialize_with_user_data): Create the DBus
name using the user data provided.
(webkit_web_extension_initialize): Deleted.
* TestWebKitAPI/gtk/WebKit2Gtk/TestMain.cpp:
(Test::dataDirectory): Return the temporary data directory.
(removeNonEmptyDirectory): Also remove directories recursively.
(main): Remove the disk cache directory initialization, since this
is now done in the Test constructor.
* TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h:
(Test::initializeWebExtensionsCallback): Call the virtual method
initializeWebExtensions()
(Test::Test): Create a new WebKitWebContext and initialize it.
(Test::~Test): Disconnect initialize-web-extensions signal.
(Test::initializeWebExtensions): Set the web extensions directory
and user data.
* TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.cpp:
(WebProcessTestRunner::~WebProcessTestRunner): Use nullptr.
(WebProcessTestRunner::runTest): Build the DBus proxy using a
unique name created with the Test web extension ID.
(WebProcessTestRunner::proxy): Deleted.
* TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.h:
* TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
(WebViewTest::WebViewTest): Create the web view with the Test web
context.
* TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h: Add optional user
content manager parameter to the constructor.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitGeolocationProvidercpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebContextcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebContexth">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtksectionstxt">trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestAuthenticationcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestAuthentication.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestContextMenucpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestContextMenu.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestCookieManagercpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestCookieManager.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestDOMNodecpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNode.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestDOMNodeFiltercpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNodeFilter.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestDOMXPathNSResolvercpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMXPathNSResolver.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestDownloadscpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestFramecpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestFrame.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestLoaderClientcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestMultiprocesscpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestPrintingcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestPrinting.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestResourcescpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestSSLcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestWebExtensionscpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebExtensions.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestWebKitFaviconDatabasecpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestWebKitUserContentManagercpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitUserContentManager.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestWebKitWebContextcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkWebExtensionTestcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkWebProcessTestcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPIgtkWebKit2GtkTestMaincpp">trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPIgtkWebKit2GtkTestMainh">trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h</a></li>
<li><a href="#trunkToolsTestWebKitAPIgtkWebKit2GtkWebProcessTestRunnercpp">trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPIgtkWebKit2GtkWebProcessTestRunnerh">trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.h</a></li>
<li><a href="#trunkToolsTestWebKitAPIgtkWebKit2GtkWebViewTestcpp">trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPIgtkWebKit2GtkWebViewTesth">trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Source/WebKit2/ChangeLog        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2014-11-18  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Add API to create a WebKitWebContext
+        https://bugs.webkit.org/show_bug.cgi?id=138826
+
+        Reviewed by Gustavo Noronha Silva.
+
+        We have always used a default web context without providing API to
+        create others. The main reason was that nobody requested it and we
+        haven't needed it either. The main problem of the default web
+        context is that you can't configure anything during
+        construction. This hasn't been a problem so far because all the
+        web context configuration we expose in the API can be configured
+        after construction. But now we need to expose API to allow the
+        user to configure the local storage directory, which is a
+        construct only configuration. The default web context was also a
+        problem for our unit tests, because sharing the same context made
+        it difficult to ensure tests cases are independent to each other.
+
+        * UIProcess/API/gtk/WebKitGeolocationProvider.cpp:
+        (WebKitGeolocationProvider::~WebKitGeolocationProvider): Reset the
+        provider to avoid crashes when web context is destroyed and a new
+        one is created.
+        * UIProcess/API/gtk/WebKitWebContext.cpp:
+        (webkitWebContextConstructed): Add constructed implementation to
+        create the WebContext and initialize it.
+        (webkitWebContextDispose): Detach web context clients to avoid
+        crashes when a client callback is called on a disposed WebKitWebContext.
+        (webkit_web_context_class_init): Initialize gettext, add
+        constructed implementation and add the pointer to the vmethods
+        when creating signals.
+        (createDefaultWebContext): Simply create a WebKitWebContext.
+        (webkit_web_context_new): New public method to create a WebKitWebContext.
+        (injectedBundleFilename): Deleted.
+        * UIProcess/API/gtk/WebKitWebContext.h: Add virtual methods for
+        signals, so that users can inherit from WebKitWebContext and
+        override the virtual methods.
+        * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbol.
+
</ins><span class="cx"> 2014-11-18  Carlos Alberto Lopez Perez  &lt;clopez@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [SOUP] [GnuTLS] Don't use a SSL3.0 record version in client hello.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitGeolocationProvidercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -51,6 +51,7 @@
</span><span class="cx"> WebKitGeolocationProvider::~WebKitGeolocationProvider()
</span><span class="cx"> {
</span><span class="cx">     m_provider.stopUpdating();
</span><ins>+    WKGeolocationManagerSetProvider(toAPI(m_geolocationManager.get()), nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;WebKitGeolocationProvider&gt; WebKitGeolocationProvider::create(WebGeolocationManagerProxy* geolocationManager)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -20,6 +20,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebKitWebContext.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;APIDownloadClient.h&quot;
</ins><span class="cx"> #include &quot;APIString.h&quot;
</span><span class="cx"> #include &quot;WebBatteryManagerProxy.h&quot;
</span><span class="cx"> #include &quot;WebCertificateInfo.h&quot;
</span><span class="lines">@@ -144,6 +145,7 @@
</span><span class="cx"> 
</span><span class="cx"> struct _WebKitWebContextPrivate {
</span><span class="cx">     RefPtr&lt;WebContext&gt; context;
</span><ins>+    bool clientsDetached;
</ins><span class="cx"> 
</span><span class="cx">     GRefPtr&lt;WebKitCookieManager&gt; cookieManager;
</span><span class="cx">     GRefPtr&lt;WebKitFaviconDatabase&gt; faviconDatabase;
</span><span class="lines">@@ -199,10 +201,73 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static const char* injectedBundleDirectory()
+{
+    const char* bundleDirectory = g_getenv(&quot;WEBKIT_INJECTED_BUNDLE_PATH&quot;);
+    if (bundleDirectory &amp;&amp; g_file_test(bundleDirectory, G_FILE_TEST_IS_DIR))
+        return bundleDirectory;
+
+    static const char* injectedBundlePath = LIBDIR G_DIR_SEPARATOR_S &quot;webkit2gtk-&quot; WEBKITGTK_API_VERSION_STRING
+        G_DIR_SEPARATOR_S &quot;injected-bundle&quot; G_DIR_SEPARATOR_S;
+    return injectedBundlePath;
+}
+
+static void webkitWebContextConstructed(GObject* object)
+{
+    G_OBJECT_CLASS(webkit_web_context_parent_class)-&gt;constructed(object);
+
+    GUniquePtr&lt;char&gt; bundleFilename(g_build_filename(injectedBundleDirectory(), &quot;libwebkit2gtkinjectedbundle.so&quot;, nullptr));
+    WebContextConfiguration webContextConfiguration;
+    webContextConfiguration.injectedBundlePath = WebCore::filenameToString(bundleFilename.get());
+    WebContext::applyPlatformSpecificConfigurationDefaults(webContextConfiguration);
+
+    WebKitWebContext* webContext = WEBKIT_WEB_CONTEXT(object);
+    WebKitWebContextPrivate* priv = webContext-&gt;priv;
+    priv-&gt;context = WebContext::create(WTF::move(webContextConfiguration));
+
+    priv-&gt;requestManager = priv-&gt;context-&gt;supplement&lt;WebSoupCustomProtocolRequestManager&gt;();
+    priv-&gt;context-&gt;setCacheModel(CacheModelPrimaryWebBrowser);
+
+    priv-&gt;tlsErrorsPolicy = WEBKIT_TLS_ERRORS_POLICY_FAIL;
+    priv-&gt;context-&gt;setIgnoreTLSErrors(false);
+
+    attachInjectedBundleClientToContext(webContext);
+    attachDownloadClientToContext(webContext);
+    attachRequestManagerClientToContext(webContext);
+
+#if ENABLE(GEOLOCATION)
+    priv-&gt;geolocationProvider = WebKitGeolocationProvider::create(priv-&gt;context-&gt;supplement&lt;WebGeolocationManagerProxy&gt;());
+#endif
+#if ENABLE(BATTERY_STATUS)
+    priv-&gt;batteryProvider = WebKitBatteryProvider::create(priv-&gt;context-&gt;supplement&lt;WebBatteryManagerProxy&gt;());
+#endif
+#if ENABLE(SPELLCHECK)
+    priv-&gt;textChecker = WebKitTextChecker::create();
+#endif
+}
+
+static void webkitWebContextDispose(GObject* object)
+{
+    WebKitWebContextPrivate* priv = WEBKIT_WEB_CONTEXT(object)-&gt;priv;
+    if (!priv-&gt;clientsDetached) {
+        priv-&gt;clientsDetached = true;
+        priv-&gt;context-&gt;initializeInjectedBundleClient(nullptr);
+        priv-&gt;context-&gt;setDownloadClient(nullptr);
+    }
+
+    G_OBJECT_CLASS(webkit_web_context_parent_class)-&gt;dispose(object);
+}
+
</ins><span class="cx"> static void webkit_web_context_class_init(WebKitWebContextClass* webContextClass)
</span><span class="cx"> {
</span><span class="cx">     GObjectClass* gObjectClass = G_OBJECT_CLASS(webContextClass);
</span><span class="cx"> 
</span><ins>+    bindtextdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
+    bind_textdomain_codeset(GETTEXT_PACKAGE, &quot;UTF-8&quot;);
+
+    gObjectClass-&gt;constructed = webkitWebContextConstructed;
+    gObjectClass-&gt;dispose = webkitWebContextDispose;
+
</ins><span class="cx">     /**
</span><span class="cx">      * WebKitWebContext::download-started:
</span><span class="cx">      * @context: the #WebKitWebContext
</span><span class="lines">@@ -212,12 +277,13 @@
</span><span class="cx">      */
</span><span class="cx">     signals[DOWNLOAD_STARTED] =
</span><span class="cx">         g_signal_new(&quot;download-started&quot;,
</span><del>-                     G_TYPE_FROM_CLASS(gObjectClass),
-                     G_SIGNAL_RUN_LAST,
-                     0, 0, 0,
-                     g_cclosure_marshal_VOID__OBJECT,
-                     G_TYPE_NONE, 1,
-                     WEBKIT_TYPE_DOWNLOAD);
</del><ins>+            G_TYPE_FROM_CLASS(gObjectClass),
+            G_SIGNAL_RUN_LAST,
+            G_STRUCT_OFFSET(WebKitWebContextClass, download_started),
+            nullptr, nullptr,
+            g_cclosure_marshal_VOID__OBJECT,
+            G_TYPE_NONE, 1,
+            WEBKIT_TYPE_DOWNLOAD);
</ins><span class="cx"> 
</span><span class="cx">     /**
</span><span class="cx">      * WebKitWebContext::initialize-web-extensions:
</span><span class="lines">@@ -234,60 +300,15 @@
</span><span class="cx">         g_signal_new(&quot;initialize-web-extensions&quot;,
</span><span class="cx">             G_TYPE_FROM_CLASS(gObjectClass),
</span><span class="cx">             G_SIGNAL_RUN_LAST,
</span><del>-            0, nullptr, nullptr,
</del><ins>+            G_STRUCT_OFFSET(WebKitWebContextClass, initialize_web_extensions),
+            nullptr, nullptr,
</ins><span class="cx">             g_cclosure_marshal_VOID__VOID,
</span><span class="cx">             G_TYPE_NONE, 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static CString injectedBundleDirectory()
-{
-    const char* bundleDirectory = g_getenv(&quot;WEBKIT_INJECTED_BUNDLE_PATH&quot;);
-    if (bundleDirectory &amp;&amp; g_file_test(bundleDirectory, G_FILE_TEST_IS_DIR))
-        return bundleDirectory;
-
-    static const char* injectedBundlePath = LIBDIR G_DIR_SEPARATOR_S &quot;webkit2gtk-&quot; WEBKITGTK_API_VERSION_STRING
-        G_DIR_SEPARATOR_S &quot;injected-bundle&quot; G_DIR_SEPARATOR_S;
-    return injectedBundlePath;
-}
-
-static CString injectedBundleFilename()
-{
-    GUniquePtr&lt;char&gt; bundleFilename(g_build_filename(injectedBundleDirectory().data(), &quot;libwebkit2gtkinjectedbundle.so&quot;, NULL));
-    return bundleFilename.get();
-}
-
</del><span class="cx"> static gpointer createDefaultWebContext(gpointer)
</span><span class="cx"> {
</span><del>-    bindtextdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
-    bind_textdomain_codeset(GETTEXT_PACKAGE, &quot;UTF-8&quot;);
-
-    static GRefPtr&lt;WebKitWebContext&gt; webContext = adoptGRef(WEBKIT_WEB_CONTEXT(g_object_new(WEBKIT_TYPE_WEB_CONTEXT, NULL)));
-    WebKitWebContextPrivate* priv = webContext-&gt;priv;
-
-    WebContextConfiguration webContextConfiguration;
-    webContextConfiguration.injectedBundlePath = WebCore::filenameToString(injectedBundleFilename().data());
-    WebContext::applyPlatformSpecificConfigurationDefaults(webContextConfiguration);
-    priv-&gt;context = WebContext::create(WTF::move(webContextConfiguration));
-
-    priv-&gt;requestManager = webContext-&gt;priv-&gt;context-&gt;supplement&lt;WebSoupCustomProtocolRequestManager&gt;();
-    priv-&gt;context-&gt;setCacheModel(CacheModelPrimaryWebBrowser);
-
-    priv-&gt;tlsErrorsPolicy = WEBKIT_TLS_ERRORS_POLICY_FAIL;
-    priv-&gt;context-&gt;setIgnoreTLSErrors(false);
-
-    attachInjectedBundleClientToContext(webContext.get());
-    attachDownloadClientToContext(webContext.get());
-    attachRequestManagerClientToContext(webContext.get());
-
-#if ENABLE(GEOLOCATION)
-    priv-&gt;geolocationProvider = WebKitGeolocationProvider::create(priv-&gt;context-&gt;supplement&lt;WebGeolocationManagerProxy&gt;());
-#endif
-#if ENABLE(BATTERY_STATUS)
-    priv-&gt;batteryProvider = WebKitBatteryProvider::create(priv-&gt;context-&gt;supplement&lt;WebBatteryManagerProxy&gt;());
-#endif
-#if ENABLE(SPELLCHECK)
-    priv-&gt;textChecker = WebKitTextChecker::create();
-#endif
</del><ins>+    static GRefPtr&lt;WebKitWebContext&gt; webContext = adoptGRef(WEBKIT_WEB_CONTEXT(g_object_new(WEBKIT_TYPE_WEB_CONTEXT, nullptr)));
</ins><span class="cx">     return webContext.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -305,6 +326,20 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * webkit_web_context_new:
+ *
+ * Create a new #WebKitWebContext
+ *
+ * Returns: (transfer full): a newly created #WebKitWebContext
+ *
+ * Since: 2.8
+ */
+WebKitWebContext* webkit_web_context_new(void)
+{
+    return WEBKIT_WEB_CONTEXT(g_object_new(WEBKIT_TYPE_WEB_CONTEXT, nullptr));
+}
+
+/**
</ins><span class="cx">  * webkit_web_context_set_cache_model:
</span><span class="cx">  * @context: the #WebKitWebContext
</span><span class="cx">  * @cache_model: a #WebKitCacheModel
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -127,14 +127,16 @@
</span><span class="cx"> struct _WebKitWebContextClass {
</span><span class="cx">     GObjectClass parent;
</span><span class="cx"> 
</span><ins>+    void (* download_started)          (WebKitWebContext *context,
+                                        WebKitDownload   *download);
+    void (* initialize_web_extensions) (WebKitWebContext *context);
+
</ins><span class="cx">     void (*_webkit_reserved0) (void);
</span><span class="cx">     void (*_webkit_reserved1) (void);
</span><span class="cx">     void (*_webkit_reserved2) (void);
</span><span class="cx">     void (*_webkit_reserved3) (void);
</span><span class="cx">     void (*_webkit_reserved4) (void);
</span><span class="cx">     void (*_webkit_reserved5) (void);
</span><del>-    void (*_webkit_reserved6) (void);
-    void (*_webkit_reserved7) (void);
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WEBKIT_API GType
</span><span class="lines">@@ -143,6 +145,9 @@
</span><span class="cx"> WEBKIT_API WebKitWebContext *
</span><span class="cx"> webkit_web_context_get_default                      (void);
</span><span class="cx"> 
</span><ins>+WEBKIT_API WebKitWebContext *
+webkit_web_context_new                              (void);
+
</ins><span class="cx"> WEBKIT_API void
</span><span class="cx"> webkit_web_context_set_cache_model                  (WebKitWebContext              *context,
</span><span class="cx">                                                      WebKitCacheModel               cache_model);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtksectionstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> WebKitProcessModel
</span><span class="cx"> WebKitTLSErrorsPolicy
</span><span class="cx"> webkit_web_context_get_default
</span><ins>+webkit_web_context_new
</ins><span class="cx"> webkit_web_context_get_cache_model
</span><span class="cx"> webkit_web_context_set_cache_model
</span><span class="cx"> webkit_web_context_clear_cache
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/ChangeLog        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -1,3 +1,125 @@
</span><ins>+2014-11-18  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Add API to create a WebKitWebContext
+        https://bugs.webkit.org/show_bug.cgi?id=138826
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Use a different WebKitWebContext for every test to ensure test
+        cases are independent to each other. Tests using DBus to
+        communicate with the injected bundle extension now use a unique
+        name for the well known DBus name.
+
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestAuthentication.cpp:
+        (beforeAll): Remove comment about the order of the tests and
+        move the success test before the failed one now that tests don't
+        depend on each others.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestContextMenu.cpp:
+        (beforeAll): Remove call to set the web extensions directory,
+        since this is now done for all test in the Test constructor.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestCookieManager.cpp:
+        (beforeAll): Do not create a temporary directory, a temporary data
+        directory is now created for all tests.
+        (afterAll):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNode.cpp:
+        (testWebKitDOMNodeHierarchyNavigation): Pass the web extension ID
+        to the web process test runner.
+        (testWebKitDOMNodeInsertion): Ditto.
+        (testWebKitDOMNodeTagNames): Ditto.
+        (beforeAll): Remove call to set the web extensions directory.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNodeFilter.cpp:
+        (runTest): Pass the web extension ID to the web process test runner.
+        (beforeAll): Remove call to set the web extensions directory.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestDOMXPathNSResolver.cpp:
+        (runTest): Pass the web extension ID to the web process test runner.
+        (beforeAll): Remove call to set the web extensions directory.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp:
+        (createFileAtDestination): Use Test::dataDirectory() as base dir
+        for temporary files.
+        (beforeAll): Do not create a temporary directory.
+        (afterAll):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestFrame.cpp:
+        (webkitFrameTestRun): Pass the web extension ID to the web process
+        test runner.
+        (beforeAll): Remove call to set the web extensions directory.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp:
+        (beforeAll): Remove call to set the web extensions directory.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp:
+        (testProcessPerWebView): Use local member instead of global variable.
+        (testMultiprocessWebViewCreateReadyClose): Ditto.
+        (beforeAll): Do not connect to initialize-web-extensions, Test now
+        connects to the signal for all tests and calls a virtual method
+        that test can override.
+        (afterAll):
+        (initializeWebExtensions): Deleted.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestPrinting.cpp:
+        (testPrintOperationPrint): Use Test::dataDirectory() as base dir
+        for temporary files.
+        (beforeAll): Do not create a temporary directory.
+        (afterAll):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp:
+        (beforeAll): Remove call to set the web extensions directory.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp:
+        (beforeAll): Remove comment about the tests order.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestWebExtensions.cpp:
+        (testWebExtensionGetTitle): Build the DBus service name using the
+        web extension ID.
+        (testDocumentLoadedSignal): Ditto.
+        (testWebKitWebViewProcessCrashed): Ditto.
+        (testWebExtensionIsolatedWorld): Ditto.
+        (beforeAll): Remove initialization-user-data test, since now all
+        tests are passing user data to the web extension.
+        (testWebExtensionInitializationUserData): Deleted.
+        (initializeWebExtensions): Deleted.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp:
+        (testSetDirectory): Use the web context member inherited from Test.
+        (testClearDatabase): Ditto.
+        (testGetFaviconURI): Ditto.
+        (beforeAll): Do not create a temporary directory.
+        (afterAll):
+        (webkitFaviconDatabaseFinalizedCallback): Deleted.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitUserContentManager.cpp:
+        (UserContentManagerTest::UserContentManagerTest):
+        (beforeAll): Remove call to set the web extensions directory.
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp:
+        (testWebContextDefault): Check also that a newly create web
+        context is not the default web context.
+        (testWebContextSpellChecker): Use the web context member inherited
+        from Test.
+        (testWebContextLanguages): Ditto.
+        * TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp:
+        (methodCallCallback): Remove GetInitializationUserData method.
+        (webkit_web_extension_initialize_with_user_data): Always create
+        the DBus name using the user data provided.
+        (makeBusName): Deleted.
+        * TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.cpp:
+        (webkit_web_extension_initialize_with_user_data): Create the DBus
+        name using the user data provided.
+        (webkit_web_extension_initialize): Deleted.
+        * TestWebKitAPI/gtk/WebKit2Gtk/TestMain.cpp:
+        (Test::dataDirectory): Return the temporary data directory.
+        (removeNonEmptyDirectory): Also remove directories recursively.
+        (main): Remove the disk cache directory initialization, since this
+        is now done in the Test constructor.
+        * TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h:
+        (Test::initializeWebExtensionsCallback): Call the virtual method
+        initializeWebExtensions()
+        (Test::Test): Create a new WebKitWebContext and initialize it.
+        (Test::~Test): Disconnect initialize-web-extensions signal.
+        (Test::initializeWebExtensions): Set the web extensions directory
+        and user data.
+        * TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.cpp:
+        (WebProcessTestRunner::~WebProcessTestRunner): Use nullptr.
+        (WebProcessTestRunner::runTest): Build the DBus proxy using a
+        unique name created with the Test web extension ID.
+        (WebProcessTestRunner::proxy): Deleted.
+        * TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.h:
+        * TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
+        (WebViewTest::WebViewTest): Create the web view with the Test web
+        context.
+        * TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h: Add optional user
+        content manager parameter to the constructor.
+
</ins><span class="cx"> 2014-11-18  ChangSeok Oh  &lt;changseok.oh@collabora.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Mesa build fails over llvm-3.5
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestAuthenticationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestAuthentication.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestAuthentication.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestAuthentication.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -272,12 +272,10 @@
</span><span class="cx">     AuthenticationTest::add(&quot;WebKitWebView&quot;, &quot;authentication-request&quot;, testWebViewAuthenticationRequest);
</span><span class="cx">     AuthenticationTest::add(&quot;WebKitWebView&quot;, &quot;authentication-cancel&quot;, testWebViewAuthenticationCancel);
</span><span class="cx">     AuthenticationTest::add(&quot;WebKitWebView&quot;, &quot;authentication-load-cancelled&quot;, testWebViewAuthenticationLoadCancelled);
</span><ins>+    AuthenticationTest::add(&quot;WebKitWebView&quot;, &quot;authentication-success&quot;, testWebViewAuthenticationSuccess);
</ins><span class="cx">     AuthenticationTest::add(&quot;WebKitWebView&quot;, &quot;authentication-failure&quot;, testWebViewAuthenticationFailure);
</span><span class="cx">     AuthenticationTest::add(&quot;WebKitWebView&quot;, &quot;authentication-no-credential&quot;, testWebViewAuthenticationNoCredential);
</span><span class="cx">     AuthenticationTest::add(&quot;WebKitWebView&quot;, &quot;authentication-storage&quot;, testWebViewAuthenticationStorage);
</span><del>-    // Testing authentication success must be done last because libsoup will never fire
-    // the authenticate signal again once authentication is successful.
-    AuthenticationTest::add(&quot;WebKitWebView&quot;, &quot;authentication-success&quot;, testWebViewAuthenticationSuccess);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void afterAll()
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestContextMenucpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestContextMenu.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestContextMenu.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestContextMenu.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -1040,7 +1040,6 @@
</span><span class="cx"> 
</span><span class="cx"> void beforeAll()
</span><span class="cx"> {
</span><del>-    webkit_web_context_set_web_extensions_directory(webkit_web_context_get_default(), WEBKIT_TEST_WEB_EXTENSIONS_DIR);
</del><span class="cx">     ContextMenuDefaultTest::add(&quot;WebKitWebView&quot;, &quot;default-menu&quot;, testContextMenuDefaultMenu);
</span><span class="cx">     ContextMenuCustomTest::add(&quot;WebKitWebView&quot;, &quot;populate-menu&quot;, testContextMenuPopulateMenu);
</span><span class="cx">     ContextMenuCustomFullTest::add(&quot;WebKitWebView&quot;, &quot;custom-menu&quot;, testContextMenuCustomMenu);
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestCookieManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestCookieManager.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestCookieManager.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestCookieManager.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -24,7 +24,6 @@
</span><span class="cx"> #include &lt;glib/gstdio.h&gt;
</span><span class="cx"> 
</span><span class="cx"> static WebKitTestServer* kServer;
</span><del>-static char* kTempDirectory;
</del><span class="cx"> 
</span><span class="cx"> static const char* kFirstPartyDomain = &quot;127.0.0.1&quot;;
</span><span class="cx"> static const char* kThirdPartyDomain = &quot;localhost&quot;;
</span><span class="lines">@@ -72,12 +71,12 @@
</span><span class="cx">         switch (storage) {
</span><span class="cx">         case WEBKIT_COOKIE_PERSISTENT_STORAGE_TEXT:
</span><span class="cx">             if (!m_cookiesTextFile)
</span><del>-                m_cookiesTextFile.reset(g_build_filename(kTempDirectory, &quot;cookies.txt&quot;, NULL));
</del><ins>+                m_cookiesTextFile.reset(g_build_filename(Test::dataDirectory(), &quot;cookies.txt&quot;, nullptr));
</ins><span class="cx">             filename = m_cookiesTextFile.get();
</span><span class="cx">             break;
</span><span class="cx">         case WEBKIT_COOKIE_PERSISTENT_STORAGE_SQLITE:
</span><span class="cx">             if (!m_cookiesSQLiteFile)
</span><del>-                m_cookiesSQLiteFile.reset(g_build_filename(kTempDirectory, &quot;cookies.db&quot;, NULL));
</del><ins>+                m_cookiesSQLiteFile.reset(g_build_filename(Test::dataDirectory(), &quot;cookies.db&quot;, nullptr));
</ins><span class="cx">             filename = m_cookiesSQLiteFile.get();
</span><span class="cx">             break;
</span><span class="cx">         default:
</span><span class="lines">@@ -315,9 +314,6 @@
</span><span class="cx">     kServer = new WebKitTestServer();
</span><span class="cx">     kServer-&gt;run(serverCallback);
</span><span class="cx"> 
</span><del>-    kTempDirectory = g_dir_make_tmp(&quot;WebKit2Tests-XXXXXX&quot;, 0);
-    g_assert(kTempDirectory);
-
</del><span class="cx">     CookieManagerTest::add(&quot;WebKitCookieManager&quot;, &quot;accept-policy&quot;, testCookieManagerAcceptPolicy);
</span><span class="cx">     CookieManagerTest::add(&quot;WebKitCookieManager&quot;, &quot;delete-cookies&quot;, testCookieManagerDeleteCookies);
</span><span class="cx">     CookieManagerTest::add(&quot;WebKitCookieManager&quot;, &quot;cookies-changed&quot;, testCookieManagerCookiesChanged);
</span><span class="lines">@@ -327,5 +323,4 @@
</span><span class="cx"> void afterAll()
</span><span class="cx"> {
</span><span class="cx">     delete kServer;
</span><del>-    g_rmdir(kTempDirectory);
</del><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestDOMNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNode.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNode.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNode.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx">     GVariantBuilder builder;
</span><span class="cx">     g_variant_builder_init(&amp;builder, G_VARIANT_TYPE_VARDICT);
</span><span class="cx">     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)));
</span><del>-    g_assert(testRunner-&gt;runTest(&quot;WebKitDOMNode&quot;, &quot;hierarchy-navigation&quot;, g_variant_builder_end(&amp;builder)));
</del><ins>+    g_assert(testRunner-&gt;runTest(&quot;WebKitDOMNode&quot;, &quot;hierarchy-navigation&quot;, Test::s_webExtensionID, g_variant_builder_end(&amp;builder)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void testWebKitDOMNodeInsertion(WebViewTest* test, gconstpointer)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx">     GVariantBuilder builder;
</span><span class="cx">     g_variant_builder_init(&amp;builder, G_VARIANT_TYPE_VARDICT);
</span><span class="cx">     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)));
</span><del>-    g_assert(testRunner-&gt;runTest(&quot;WebKitDOMNode&quot;, &quot;insertion&quot;, g_variant_builder_end(&amp;builder)));
</del><ins>+    g_assert(testRunner-&gt;runTest(&quot;WebKitDOMNode&quot;, &quot;insertion&quot;, Test::s_webExtensionID, g_variant_builder_end(&amp;builder)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void testWebKitDOMNodeTagNames(WebViewTest* test, gconstpointer)
</span><span class="lines">@@ -68,13 +68,12 @@
</span><span class="cx">     GVariantBuilder builder;
</span><span class="cx">     g_variant_builder_init(&amp;builder, G_VARIANT_TYPE_VARDICT);
</span><span class="cx">     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)));
</span><del>-    g_assert(testRunner-&gt;runTest(&quot;WebKitDOMNode&quot;, &quot;tag-names&quot;, g_variant_builder_end(&amp;builder)));
</del><ins>+    g_assert(testRunner-&gt;runTest(&quot;WebKitDOMNode&quot;, &quot;tag-names&quot;, Test::s_webExtensionID, g_variant_builder_end(&amp;builder)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void beforeAll()
</span><span class="cx"> {
</span><span class="cx">     testRunner = new WebProcessTestRunner();
</span><del>-    webkit_web_context_set_web_extensions_directory(webkit_web_context_get_default(), WEBKIT_TEST_WEB_EXTENSIONS_DIR);
</del><span class="cx"> 
</span><span class="cx">     WebViewTest::add(&quot;WebKitDOMNode&quot;, &quot;hierarchy-navigation&quot;, testWebKitDOMNodeHierarchyNavigation);
</span><span class="cx">     WebViewTest::add(&quot;WebKitDOMNode&quot;, &quot;insertion&quot;, testWebKitDOMNodeInsertion);
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestDOMNodeFiltercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNodeFilter.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNodeFilter.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNodeFilter.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx">     GVariantBuilder builder;
</span><span class="cx">     g_variant_builder_init(&amp;builder, G_VARIANT_TYPE_VARDICT);
</span><span class="cx">     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)));
</span><del>-    g_assert(testRunner-&gt;runTest(&quot;WebKitDOMNodeFilter&quot;, name, g_variant_builder_end(&amp;builder)));
</del><ins>+    g_assert(testRunner-&gt;runTest(&quot;WebKitDOMNodeFilter&quot;, name, Test::s_webExtensionID, g_variant_builder_end(&amp;builder)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void testWebKitDOMNodeFilterTreeWalker(WebViewTest* test, gconstpointer)
</span><span class="lines">@@ -53,7 +53,6 @@
</span><span class="cx"> void beforeAll()
</span><span class="cx"> {
</span><span class="cx">     testRunner = new WebProcessTestRunner();
</span><del>-    webkit_web_context_set_web_extensions_directory(webkit_web_context_get_default(), WEBKIT_TEST_WEB_EXTENSIONS_DIR);
</del><span class="cx"> 
</span><span class="cx">     WebViewTest::add(&quot;WebKitDOMNodeFilter&quot;, &quot;tree-walker&quot;, testWebKitDOMNodeFilterTreeWalker);
</span><span class="cx">     WebViewTest::add(&quot;WebKitDOMNodeFilter&quot;, &quot;node-iterator&quot;, testWebKitDOMNodeFilterNodeIterator);
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestDOMXPathNSResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMXPathNSResolver.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMXPathNSResolver.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMXPathNSResolver.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx">     GVariantBuilder builder;
</span><span class="cx">     g_variant_builder_init(&amp;builder, G_VARIANT_TYPE_VARDICT);
</span><span class="cx">     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)));
</span><del>-    g_assert(testRunner-&gt;runTest(&quot;WebKitDOMXPathNSResolver&quot;, name, g_variant_builder_end(&amp;builder)));
</del><ins>+    g_assert(testRunner-&gt;runTest(&quot;WebKitDOMXPathNSResolver&quot;, name, Test::s_webExtensionID, g_variant_builder_end(&amp;builder)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void testWebKitDOMXPathNSResolverNative(WebViewTest* test, gconstpointer)
</span><span class="lines">@@ -55,7 +55,6 @@
</span><span class="cx"> void beforeAll()
</span><span class="cx"> {
</span><span class="cx">     testRunner = new WebProcessTestRunner();
</span><del>-    webkit_web_context_set_web_extensions_directory(webkit_web_context_get_default(), WEBKIT_TEST_WEB_EXTENSIONS_DIR);
</del><span class="cx"> 
</span><span class="cx">     WebViewTest::add(&quot;WebKitDOMXPathNSResolver&quot;, &quot;native&quot;, testWebKitDOMXPathNSResolverNative);
</span><span class="cx">     WebViewTest::add(&quot;WebKitDOMXPathNSResolver&quot;, &quot;custom&quot;, testWebKitDOMXPathNSResolverCustom);
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestDownloadscpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -31,8 +31,6 @@
</span><span class="cx"> #include &lt;wtf/gobject/GUniquePtr.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><del>-static char* kTempDirectory;
-
</del><span class="cx"> class DownloadTest: public Test {
</span><span class="cx"> public:
</span><span class="cx">     MAKE_GLIB_TEST_FIXTURE(DownloadTest);
</span><span class="lines">@@ -105,17 +103,16 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     DownloadTest()
</span><del>-        : m_webContext(webkit_web_context_get_default())
-        , m_mainLoop(g_main_loop_new(0, TRUE))
</del><ins>+        : m_mainLoop(g_main_loop_new(nullptr, TRUE))
</ins><span class="cx">         , m_downloadSize(0)
</span><span class="cx">         , m_allowOverwrite(false)
</span><span class="cx">     {
</span><del>-        g_signal_connect(m_webContext, &quot;download-started&quot;, G_CALLBACK(downloadStartedCallback), this);
</del><ins>+        g_signal_connect(m_webContext.get(), &quot;download-started&quot;, G_CALLBACK(downloadStartedCallback), this);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ~DownloadTest()
</span><span class="cx">     {
</span><del>-        g_signal_handlers_disconnect_matched(m_webContext, G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, this);
</del><ins>+        g_signal_handlers_disconnect_matched(m_webContext.get(), G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, this);
</ins><span class="cx">         g_main_loop_unref(m_mainLoop);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -157,14 +154,14 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void decideDestination(WebKitDownload* download, const gchar* suggestedFilename)
</span><span class="cx">     {
</span><del>-        GUniquePtr&lt;char&gt; destination(g_build_filename(kTempDirectory, suggestedFilename, NULL));
</del><ins>+        GUniquePtr&lt;char&gt; destination(g_build_filename(Test::dataDirectory(), suggestedFilename, nullptr));
</ins><span class="cx">         GUniquePtr&lt;char&gt; destinationURI(g_filename_to_uri(destination.get(), 0, 0));
</span><span class="cx">         webkit_download_set_destination(download, destinationURI.get());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     WebKitDownload* downloadURIAndWaitUntilFinishes(const CString&amp; requestURI)
</span><span class="cx">     {
</span><del>-        WebKitDownload* download = webkit_web_context_download_uri(m_webContext, requestURI.data());
</del><ins>+        WebKitDownload* download = webkit_web_context_download_uri(m_webContext.get(), requestURI.data());
</ins><span class="cx">         assertObjectIsDeletedWhenTestFinishes(G_OBJECT(download));
</span><span class="cx"> 
</span><span class="cx">         g_assert(!webkit_download_get_allow_overwrite(download));
</span><span class="lines">@@ -191,7 +188,6 @@
</span><span class="cx">         g_file_delete(destFile.get(), 0, 0);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    WebKitWebContext* m_webContext;
</del><span class="cx">     GMainLoop* m_mainLoop;
</span><span class="cx">     Vector&lt;DownloadEvent&gt; m_downloadEvents;
</span><span class="cx">     guint64 m_downloadSize;
</span><span class="lines">@@ -235,7 +231,7 @@
</span><span class="cx"> 
</span><span class="cx"> static void createFileAtDestination(const char* filename)
</span><span class="cx"> {
</span><del>-    GUniquePtr&lt;char&gt; path(g_build_filename(kTempDirectory, filename, nullptr));
</del><ins>+    GUniquePtr&lt;char&gt; path(g_build_filename(Test::dataDirectory(), filename, nullptr));
</ins><span class="cx">     GRefPtr&lt;GFile&gt; file = adoptGRef(g_file_new_for_path(path.get()));
</span><span class="cx">     GUniqueOutPtr&lt;GError&gt; error;
</span><span class="cx">     g_file_create(file.get(), G_FILE_CREATE_NONE, nullptr, &amp;error.outPtr());
</span><span class="lines">@@ -536,7 +532,7 @@
</span><span class="cx"> 
</span><span class="cx">     static gboolean downloadDecideDestinationCallback(WebKitDownload* download, const gchar* suggestedFilename, WebViewDownloadTest* test)
</span><span class="cx">     {
</span><del>-        GUniquePtr&lt;char&gt; destination(g_build_filename(kTempDirectory, suggestedFilename, NULL));
</del><ins>+        GUniquePtr&lt;char&gt; destination(g_build_filename(Test::dataDirectory(), suggestedFilename, nullptr));
</ins><span class="cx">         GUniquePtr&lt;char&gt; destinationURI(g_filename_to_uri(destination.get(), 0, 0));
</span><span class="cx">         webkit_download_set_destination(download, destinationURI.get());
</span><span class="cx">         return TRUE;
</span><span class="lines">@@ -621,9 +617,6 @@
</span><span class="cx">     kServer = new WebKitTestServer();
</span><span class="cx">     kServer-&gt;run(serverCallback);
</span><span class="cx"> 
</span><del>-    kTempDirectory = g_dir_make_tmp(&quot;WebKit2Tests-XXXXXX&quot;, 0);
-    g_assert(kTempDirectory);
-
</del><span class="cx">     DownloadTest::add(&quot;Downloads&quot;, &quot;local-file&quot;, testDownloadLocalFile);
</span><span class="cx">     DownloadTest::add(&quot;Downloads&quot;, &quot;overwrite-destination-allowed&quot;, testDownloadOverwriteDestinationAllowed);
</span><span class="cx">     DownloadErrorTest::add(&quot;Downloads&quot;, &quot;overwrite-destination-disallowed&quot;, testDownloadOverwriteDestinationDisallowed);
</span><span class="lines">@@ -637,5 +630,4 @@
</span><span class="cx"> void afterAll()
</span><span class="cx"> {
</span><span class="cx">     delete kServer;
</span><del>-    g_rmdir(kTempDirectory);
</del><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestFrame.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestFrame.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestFrame.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx">     GVariantBuilder builder;
</span><span class="cx">     g_variant_builder_init(&amp;builder, G_VARIANT_TYPE_VARDICT);
</span><span class="cx">     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)));
</span><del>-    g_assert(testRunner-&gt;runTest(&quot;WebKitFrame&quot;, testName, g_variant_builder_end(&amp;builder)));
</del><ins>+    g_assert(testRunner-&gt;runTest(&quot;WebKitFrame&quot;, testName, Test::s_webExtensionID, g_variant_builder_end(&amp;builder)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void testWebKitFrameMainFrame(WebViewTest* test, gconstpointer)
</span><span class="lines">@@ -56,7 +56,6 @@
</span><span class="cx"> void beforeAll()
</span><span class="cx"> {
</span><span class="cx">     testRunner = new WebProcessTestRunner();
</span><del>-    webkit_web_context_set_web_extensions_directory(webkit_web_context_get_default(), WEBKIT_TEST_WEB_EXTENSIONS_DIR);
</del><span class="cx"> 
</span><span class="cx">     WebViewTest::add(&quot;WebKitFrame&quot;, &quot;main-frame&quot;, testWebKitFrameMainFrame);
</span><span class="cx">     WebViewTest::add(&quot;WebKitFrame&quot;, &quot;uri&quot;, testWebKitFrameURI);
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -315,7 +315,8 @@
</span><span class="cx"> 
</span><span class="cx">     WebPageURITest()
</span><span class="cx">     {
</span><del>-        GRefPtr&lt;GDBusProxy&gt; proxy = adoptGRef(bus-&gt;createProxy(&quot;org.webkit.gtk.WebExtensionTest&quot;,
</del><ins>+        GUniquePtr&lt;char&gt; extensionBusName(g_strdup_printf(&quot;org.webkit.gtk.WebExtensionTest%u&quot;, Test::s_webExtensionID));
+        GRefPtr&lt;GDBusProxy&gt; proxy = adoptGRef(bus-&gt;createProxy(extensionBusName.get(),
</ins><span class="cx">             &quot;/org/webkit/gtk/WebExtensionTest&quot;, &quot;org.webkit.gtk.WebExtensionTest&quot;, m_mainLoop));
</span><span class="cx">         m_uriChangedSignalID = g_dbus_connection_signal_subscribe(
</span><span class="cx">             g_dbus_proxy_get_connection(proxy.get()),
</span><span class="lines">@@ -465,7 +466,6 @@
</span><span class="cx"> 
</span><span class="cx"> void beforeAll()
</span><span class="cx"> {
</span><del>-    webkit_web_context_set_web_extensions_directory(webkit_web_context_get_default(), WEBKIT_TEST_WEB_EXTENSIONS_DIR);
</del><span class="cx">     bus = new WebKitTestBus();
</span><span class="cx">     if (!bus-&gt;run())
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestMultiprocesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -26,8 +26,6 @@
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><span class="cx"> static const unsigned numViews = 2;
</span><del>-static guint32 nextInitializationId = 1;
-static unsigned initializeWebExtensionsSignalCount;
</del><span class="cx"> static WebKitTestBus* bus;
</span><span class="cx"> 
</span><span class="cx"> class MultiprocessTest: public Test {
</span><span class="lines">@@ -36,9 +34,19 @@
</span><span class="cx"> 
</span><span class="cx">     MultiprocessTest()
</span><span class="cx">         : m_mainLoop(g_main_loop_new(nullptr, TRUE))
</span><ins>+        , m_initializeWebExtensionsSignalCount(0)
</ins><span class="cx">         , m_webViewBusNames(numViews)
</span><del>-        , m_webViews(numViews) { }
</del><ins>+        , m_webViews(numViews)
+    {
+        webkit_web_context_set_process_model(m_webContext.get(), WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);
+    }
</ins><span class="cx"> 
</span><ins>+    void initializeWebExtensions() override
+    {
+        Test::initializeWebExtensions();
+        m_initializeWebExtensionsSignalCount++;
+    }
+
</ins><span class="cx">     static void loadChanged(WebKitWebView* webView, WebKitLoadEvent loadEvent, MultiprocessTest* test)
</span><span class="cx">     {
</span><span class="cx">         if (loadEvent != WEBKIT_LOAD_FINISHED)
</span><span class="lines">@@ -51,11 +59,11 @@
</span><span class="cx">     {
</span><span class="cx">         g_assert_cmpuint(index, &lt;, numViews);
</span><span class="cx"> 
</span><del>-        m_webViewBusNames[index] = GUniquePtr&lt;char&gt;(g_strdup_printf(&quot;org.webkit.gtk.WebExtensionTest%u&quot;, nextInitializationId));
-
-        m_webViews[index] = WEBKIT_WEB_VIEW(webkit_web_view_new());
</del><ins>+        m_webViews[index] = WEBKIT_WEB_VIEW(webkit_web_view_new_with_context(m_webContext.get()));
</ins><span class="cx">         assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_webViews[index].get()));
</span><span class="cx"> 
</span><ins>+        m_webViewBusNames[index] = GUniquePtr&lt;char&gt;(g_strdup_printf(&quot;org.webkit.gtk.WebExtensionTest%u&quot;, Test::s_webExtensionID));
+
</ins><span class="cx">         webkit_web_view_load_html(m_webViews[index].get(), &quot;&lt;html&gt;&lt;/html&gt;&quot;, nullptr);
</span><span class="cx">         g_signal_connect(m_webViews[index].get(), &quot;load-changed&quot;, G_CALLBACK(loadChanged), this);
</span><span class="cx">         g_main_loop_run(m_mainLoop);
</span><span class="lines">@@ -98,6 +106,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     GMainLoop* m_mainLoop;
</span><ins>+    unsigned m_initializeWebExtensionsSignalCount;
</ins><span class="cx">     Vector&lt;GUniquePtr&lt;char&gt;, numViews&gt; m_webViewBusNames;
</span><span class="cx">     Vector&lt;GRefPtr&lt;WebKitWebView&gt;, numViews&gt; m_webViews;
</span><span class="cx"> };
</span><span class="lines">@@ -116,7 +125,7 @@
</span><span class="cx">         g_assert(test-&gt;m_webViewBusNames[i]);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    g_assert_cmpuint(initializeWebExtensionsSignalCount, ==, numViews);
</del><ins>+    g_assert_cmpuint(test-&gt;m_initializeWebExtensionsSignalCount, ==, numViews);
</ins><span class="cx">     g_assert_cmpstr(test-&gt;m_webViewBusNames[0].get(), !=, test-&gt;m_webViewBusNames[1].get());
</span><span class="cx">     g_assert_cmpuint(test-&gt;webProcessPid(0), !=, test-&gt;webProcessPid(1));
</span><span class="cx"> 
</span><span class="lines">@@ -128,7 +137,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class UIClientMultiprocessTest: public WebViewTest {
</del><ins>+class UIClientMultiprocessTest: public Test {
</ins><span class="cx"> public:
</span><span class="cx">     MAKE_GLIB_TEST_FIXTURE(UIClientMultiprocessTest);
</span><span class="cx"> 
</span><span class="lines">@@ -154,16 +163,28 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     UIClientMultiprocessTest()
</span><ins>+        : m_mainLoop(g_main_loop_new(nullptr, TRUE))
+        , m_initializeWebExtensionsSignalCount(0)
</ins><span class="cx">     {
</span><ins>+        webkit_web_context_set_process_model(m_webContext.get(), WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);
+        m_webView = WEBKIT_WEB_VIEW(g_object_ref_sink(webkit_web_view_new_with_context(m_webContext.get())));
</ins><span class="cx">         webkit_settings_set_javascript_can_open_windows_automatically(webkit_web_view_get_settings(m_webView), TRUE);
</span><ins>+
</ins><span class="cx">         g_signal_connect(m_webView, &quot;create&quot;, G_CALLBACK(viewCreateCallback), this);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ~UIClientMultiprocessTest()
</span><span class="cx">     {
</span><span class="cx">         g_signal_handlers_disconnect_matched(m_webView, G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, this);
</span><ins>+        gtk_widget_destroy(GTK_WIDGET(m_webView));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    void initializeWebExtensions() override
+    {
+        Test::initializeWebExtensions();
+        m_initializeWebExtensionsSignalCount++;
+    }
+
</ins><span class="cx">     GtkWidget* viewCreate(WebKitWebView* webView)
</span><span class="cx">     {
</span><span class="cx">         g_assert(webView == m_webView);
</span><span class="lines">@@ -199,16 +220,15 @@
</span><span class="cx">         g_main_loop_run(m_mainLoop);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    WebKitWebView* m_webView;
+    GMainLoop* m_mainLoop;
+    unsigned m_initializeWebExtensionsSignalCount;
</ins><span class="cx">     Vector&lt;WebViewEvents&gt; m_webViewEvents;
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> static void testMultiprocessWebViewCreateReadyClose(UIClientMultiprocessTest* test, gconstpointer)
</span><span class="cx"> {
</span><del>-    // At this point the web process of the current view has already been created.
-    // We save it here to check that after window.open() the number of processes
-    // is the same.
-    guint32 processCountBefore = nextInitializationId - 1;
-    test-&gt;loadHtml(&quot;&lt;html&gt;&lt;body onLoad=\&quot;window.open().close();\&quot;&gt;&lt;/html&gt;&quot;, nullptr);
</del><ins>+    webkit_web_view_load_html(test-&gt;m_webView, &quot;&lt;html&gt;&lt;body onLoad=\&quot;window.open().close();\&quot;&gt;&lt;/html&gt;&quot;, nullptr);
</ins><span class="cx">     test-&gt;waitUntilNewWebViewClose();
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;UIClientMultiprocessTest::WebViewEvents&gt;&amp; events = test-&gt;m_webViewEvents;
</span><span class="lines">@@ -217,23 +237,11 @@
</span><span class="cx">     g_assert_cmpint(events[1], ==, UIClientMultiprocessTest::ReadyToShow);
</span><span class="cx">     g_assert_cmpint(events[2], ==, UIClientMultiprocessTest::Close);
</span><span class="cx"> 
</span><del>-    guint32 processesCountAfter =  nextInitializationId - 1;
-    g_assert_cmpuint(processesCountAfter, ==, processCountBefore);
</del><ins>+    g_assert_cmpuint(test-&gt;m_initializeWebExtensionsSignalCount, ==, 1);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void initializeWebExtensions(WebKitWebContext* context, gpointer)
-{
-    initializeWebExtensionsSignalCount++;
-    webkit_web_context_set_web_extensions_directory(context, WEBKIT_TEST_WEB_EXTENSIONS_DIR);
-    webkit_web_context_set_web_extensions_initialization_user_data(context,
-        g_variant_new_uint32(nextInitializationId++));
-}
-
</del><span class="cx"> void beforeAll()
</span><span class="cx"> {
</span><del>-    g_signal_connect(webkit_web_context_get_default(),
-        &quot;initialize-web-extensions&quot;, G_CALLBACK(initializeWebExtensions), nullptr);
-
</del><span class="cx">     // Check that default setting is the one stated in the documentation
</span><span class="cx">     g_assert_cmpuint(webkit_web_context_get_process_model(webkit_web_context_get_default()),
</span><span class="cx">         ==, WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS);
</span><span class="lines">@@ -256,6 +264,4 @@
</span><span class="cx"> void afterAll()
</span><span class="cx"> {
</span><span class="cx">     delete bus;
</span><del>-    g_signal_handlers_disconnect_by_func(webkit_web_context_get_default(),
-        reinterpret_cast&lt;void*&gt;(initializeWebExtensions), nullptr);
</del><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestPrintingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestPrinting.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestPrinting.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestPrinting.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -26,8 +26,6 @@
</span><span class="cx"> #include &lt;gtk/gtkunixprint.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-static char* kTempDirectory;
-
</del><span class="cx"> static void testPrintOperationPrintSettings(WebViewTest* test, gconstpointer)
</span><span class="cx"> {
</span><span class="cx">     GRefPtr&lt;WebKitPrintOperation&gt; printOperation = adoptGRef(webkit_print_operation_new(test-&gt;m_webView));
</span><span class="lines">@@ -134,7 +132,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    GUniquePtr&lt;char&gt; outputFilename(g_build_filename(kTempDirectory, &quot;webkit-print.pdf&quot;, NULL));
</del><ins>+    GUniquePtr&lt;char&gt; outputFilename(g_build_filename(Test::dataDirectory(), &quot;webkit-print.pdf&quot;, nullptr));
</ins><span class="cx">     GRefPtr&lt;GFile&gt; outputFile = adoptGRef(g_file_new_for_path(outputFilename.get()));
</span><span class="cx">     GUniquePtr&lt;char&gt; outputURI(g_file_get_uri(outputFile.get()));
</span><span class="cx"> 
</span><span class="lines">@@ -228,7 +226,7 @@
</span><span class="cx"> 
</span><span class="cx">     GtkWidget* createWebView()
</span><span class="cx">     {
</span><del>-        GtkWidget* newWebView = webkit_web_view_new();
</del><ins>+        GtkWidget* newWebView = webkit_web_view_new_with_context(m_webContext.get());
</ins><span class="cx">         g_object_ref_sink(newWebView);
</span><span class="cx"> 
</span><span class="cx">         assertObjectIsDeletedWhenTestFinishes(G_OBJECT(newWebView));
</span><span class="lines">@@ -247,7 +245,7 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        GUniquePtr&lt;char&gt; outputFilename(g_build_filename(kTempDirectory, &quot;webkit-close-after-print.pdf&quot;, NULL));
</del><ins>+        GUniquePtr&lt;char&gt; outputFilename(g_build_filename(Test::dataDirectory(), &quot;webkit-close-after-print.pdf&quot;, nullptr));
</ins><span class="cx">         m_outputFile = adoptGRef(g_file_new_for_path(outputFilename.get()));
</span><span class="cx">         GUniquePtr&lt;char&gt; outputURI(g_file_get_uri(m_outputFile.get()));
</span><span class="cx"> 
</span><span class="lines">@@ -292,9 +290,6 @@
</span><span class="cx"> 
</span><span class="cx"> void beforeAll()
</span><span class="cx"> {
</span><del>-    kTempDirectory = g_dir_make_tmp(&quot;WebKit2Tests-XXXXXX&quot;, 0);
-    g_assert(kTempDirectory);
-
</del><span class="cx">     WebViewTest::add(&quot;WebKitPrintOperation&quot;, &quot;printing-settings&quot;, testPrintOperationPrintSettings);
</span><span class="cx">     WebViewTest::add(&quot;WebKitWebView&quot;, &quot;print&quot;, testWebViewPrint);
</span><span class="cx"> #ifdef HAVE_GTK_UNIX_PRINTING
</span><span class="lines">@@ -306,5 +301,4 @@
</span><span class="cx"> 
</span><span class="cx"> void afterAll()
</span><span class="cx"> {
</span><del>-    g_rmdir(kTempDirectory);
</del><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestResourcescpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -770,8 +770,6 @@
</span><span class="cx">     kServer = new WebKitTestServer();
</span><span class="cx">     kServer-&gt;run(serverCallback);
</span><span class="cx"> 
</span><del>-    webkit_web_context_set_web_extensions_directory(webkit_web_context_get_default(), WEBKIT_TEST_WEB_EXTENSIONS_DIR);
-
</del><span class="cx">     ResourcesTest::add(&quot;WebKitWebView&quot;, &quot;resources&quot;, testWebViewResources);
</span><span class="cx">     SingleResourceLoadTest::add(&quot;WebKitWebResource&quot;, &quot;loading&quot;, testWebResourceLoading);
</span><span class="cx">     SingleResourceLoadTest::add(&quot;WebKitWebResource&quot;, &quot;response&quot;, testWebResourceResponse);
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestSSLcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -403,9 +403,6 @@
</span><span class="cx"> 
</span><span class="cx">     SSLTest::add(&quot;WebKitWebView&quot;, &quot;ssl&quot;, testSSL);
</span><span class="cx">     InsecureContentTest::add(&quot;WebKitWebView&quot;, &quot;insecure-content&quot;, testInsecureContent);
</span><del>-    // In this case the order of the tests does matter because tls-errors-policy expects
-    // that no exception will have been added for this certificate and host pair as is
-    // done in the load-failed-with-tls-errors test.
</del><span class="cx">     SSLTest::add(&quot;WebKitWebView&quot;, &quot;tls-errors-policy&quot;, testTLSErrorsPolicy);
</span><span class="cx">     SSLTest::add(&quot;WebKitWebView&quot;, &quot;tls-errors-redirect-to-http&quot;, testTLSErrorsRedirect);
</span><span class="cx">     SSLTest::add(&quot;WebKitWebView&quot;, &quot;tls-http-auth&quot;, testTLSErrorsHTTPAuth);
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestWebExtensionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebExtensions.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebExtensions.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebExtensions.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -32,8 +32,9 @@
</span><span class="cx">     test-&gt;loadHtml(&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;WebKitGTK+ Web Extensions Test&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;&quot;, 0);
</span><span class="cx">     test-&gt;waitUntilLoadFinished();
</span><span class="cx"> 
</span><del>-    GRefPtr&lt;GDBusProxy&gt; proxy = adoptGRef(bus-&gt;createProxy(&quot;org.webkit.gtk.WebExtensionTest&quot;,
-        &quot;/org/webkit/gtk/WebExtensionTest&quot; , &quot;org.webkit.gtk.WebExtensionTest&quot;, test-&gt;m_mainLoop));
</del><ins>+    GUniquePtr&lt;char&gt; extensionBusName(g_strdup_printf(&quot;org.webkit.gtk.WebExtensionTest%u&quot;, Test::s_webExtensionID));
+    GRefPtr&lt;GDBusProxy&gt; proxy = adoptGRef(bus-&gt;createProxy(extensionBusName.get(),
+        &quot;/org/webkit/gtk/WebExtensionTest&quot;, &quot;org.webkit.gtk.WebExtensionTest&quot;, test-&gt;m_mainLoop));
</ins><span class="cx">     GRefPtr&lt;GVariant&gt; result = adoptGRef(g_dbus_proxy_call_sync(
</span><span class="cx">         proxy.get(),
</span><span class="cx">         &quot;GetTitle&quot;,
</span><span class="lines">@@ -54,7 +55,8 @@
</span><span class="cx"> 
</span><span class="cx"> static void testDocumentLoadedSignal(WebViewTest* test, gconstpointer)
</span><span class="cx"> {
</span><del>-    GRefPtr&lt;GDBusProxy&gt; proxy = adoptGRef(bus-&gt;createProxy(&quot;org.webkit.gtk.WebExtensionTest&quot;,
</del><ins>+    GUniquePtr&lt;char&gt; extensionBusName(g_strdup_printf(&quot;org.webkit.gtk.WebExtensionTest%u&quot;, Test::s_webExtensionID));
+    GRefPtr&lt;GDBusProxy&gt; proxy = adoptGRef(bus-&gt;createProxy(extensionBusName.get(),
</ins><span class="cx">         &quot;/org/webkit/gtk/WebExtensionTest&quot;, &quot;org.webkit.gtk.WebExtensionTest&quot;, test-&gt;m_mainLoop));
</span><span class="cx">     GDBusConnection* connection = g_dbus_proxy_get_connection(proxy.get());
</span><span class="cx">     guint id = g_dbus_connection_signal_subscribe(connection,
</span><span class="lines">@@ -89,7 +91,8 @@
</span><span class="cx">     g_signal_connect(test-&gt;m_webView, &quot;web-process-crashed&quot;,
</span><span class="cx">         G_CALLBACK(webProcessCrashedCallback), test);
</span><span class="cx"> 
</span><del>-    GRefPtr&lt;GDBusProxy&gt; proxy = adoptGRef(bus-&gt;createProxy(&quot;org.webkit.gtk.WebExtensionTest&quot;,
</del><ins>+    GUniquePtr&lt;char&gt; extensionBusName(g_strdup_printf(&quot;org.webkit.gtk.WebExtensionTest%u&quot;, Test::s_webExtensionID));
+    GRefPtr&lt;GDBusProxy&gt; proxy = adoptGRef(bus-&gt;createProxy(extensionBusName.get(),
</ins><span class="cx">         &quot;/org/webkit/gtk/WebExtensionTest&quot;, &quot;org.webkit.gtk.WebExtensionTest&quot;, test-&gt;m_mainLoop));
</span><span class="cx"> 
</span><span class="cx">     GRefPtr&lt;GVariant&gt; result = adoptGRef(g_dbus_proxy_call_sync(
</span><span class="lines">@@ -152,7 +155,8 @@
</span><span class="cx">         &quot;document.getElementById('console').innerHTML = top.foo;\n&quot;
</span><span class="cx">         &quot;window.open = function () { alert('Isolated World'); }\n&quot;
</span><span class="cx">         &quot;document.open(1, 2, 3);&quot;;
</span><del>-    GRefPtr&lt;GDBusProxy&gt; proxy = adoptGRef(bus-&gt;createProxy(&quot;org.webkit.gtk.WebExtensionTest&quot;,
</del><ins>+    GUniquePtr&lt;char&gt; extensionBusName(g_strdup_printf(&quot;org.webkit.gtk.WebExtensionTest%u&quot;, Test::s_webExtensionID));
+    GRefPtr&lt;GDBusProxy&gt; proxy = adoptGRef(bus-&gt;createProxy(extensionBusName.get(),
</ins><span class="cx">         &quot;/org/webkit/gtk/WebExtensionTest&quot; , &quot;org.webkit.gtk.WebExtensionTest&quot;, test-&gt;m_mainLoop));
</span><span class="cx">     g_dbus_proxy_call(proxy.get(),
</span><span class="cx">         &quot;RunJavaScriptInIsolatedWorld&quot;,
</span><span class="lines">@@ -173,44 +177,12 @@
</span><span class="cx">     g_signal_handler_disconnect(test-&gt;m_webView, scriptDialogID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void testWebExtensionInitializationUserData(WebViewTest* test, gconstpointer)
-{
-    test-&gt;loadHtml(&quot;&lt;html&gt;&lt;/html&gt;&quot;, 0);
-    test-&gt;waitUntilLoadFinished();
-
-    GRefPtr&lt;GDBusProxy&gt; proxy = adoptGRef(bus-&gt;createProxy(&quot;org.webkit.gtk.WebExtensionTest&quot;,
-        &quot;/org/webkit/gtk/WebExtensionTest&quot;, &quot;org.webkit.gtk.WebExtensionTest&quot;, test-&gt;m_mainLoop));
-
-    GRefPtr&lt;GVariant&gt; result = adoptGRef(g_dbus_proxy_call_sync(
-        proxy.get(),
-        &quot;GetInitializationUserData&quot;,
-        nullptr,
-        G_DBUS_CALL_FLAGS_NONE,
-        -1, 0, 0));
-    g_assert(result);
-
-    const gchar* userData = nullptr;
-    g_variant_get(result.get(), &quot;(&amp;s)&quot;, &amp;userData);
-    g_assert_cmpstr(userData, ==, webExtensionsUserData);
-}
-
-static void initializeWebExtensions(WebKitWebContext* context, gpointer)
-{
-    webkit_web_context_set_web_extensions_directory(context, WEBKIT_TEST_WEB_EXTENSIONS_DIR);
-    webkit_web_context_set_web_extensions_initialization_user_data(context,
-        g_variant_new(&quot;&amp;s&quot;, webExtensionsUserData));
-}
-
</del><span class="cx"> void beforeAll()
</span><span class="cx"> {
</span><del>-    g_signal_connect(webkit_web_context_get_default(),
-        &quot;initialize-web-extensions&quot;, G_CALLBACK(initializeWebExtensions), nullptr);
-
</del><span class="cx">     bus = new WebKitTestBus();
</span><span class="cx">     if (!bus-&gt;run())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    WebViewTest::add(&quot;WebKitWebContext&quot;, &quot;initialization-user-data&quot;, testWebExtensionInitializationUserData);
</del><span class="cx">     WebViewTest::add(&quot;WebKitWebExtension&quot;, &quot;dom-document-title&quot;, testWebExtensionGetTitle);
</span><span class="cx">     WebViewTest::add(&quot;WebKitWebExtension&quot;, &quot;document-loaded-signal&quot;, testDocumentLoadedSignal);
</span><span class="cx">     WebViewTest::add(&quot;WebKitWebView&quot;, &quot;web-process-crashed&quot;, testWebKitWebViewProcessCrashed);
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestWebKitFaviconDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -26,18 +26,16 @@
</span><span class="cx"> #include &lt;wtf/gobject/GUniquePtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> static WebKitTestServer* kServer;
</span><del>-static char* kTempDirectory;
</del><span class="cx"> 
</span><span class="cx"> class FaviconDatabaseTest: public WebViewTest {
</span><span class="cx"> public:
</span><span class="cx">     MAKE_GLIB_TEST_FIXTURE(FaviconDatabaseTest);
</span><span class="cx"> 
</span><span class="cx">     FaviconDatabaseTest()
</span><del>-        : m_webContext(webkit_web_context_get_default())
-        , m_favicon(0)
</del><ins>+        : m_favicon(nullptr)
</ins><span class="cx">         , m_faviconNotificationReceived(false)
</span><span class="cx">     {
</span><del>-        WebKitFaviconDatabase* database = webkit_web_context_get_favicon_database(m_webContext);
</del><ins>+        WebKitFaviconDatabase* database = webkit_web_context_get_favicon_database(m_webContext.get());
</ins><span class="cx">         g_signal_connect(database, &quot;favicon-changed&quot;, G_CALLBACK(faviconChangedCallback), this);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -46,7 +44,7 @@
</span><span class="cx">         if (m_favicon)
</span><span class="cx">             cairo_surface_destroy(m_favicon);
</span><span class="cx"> 
</span><del>-        WebKitFaviconDatabase* database = webkit_web_context_get_favicon_database(m_webContext);
</del><ins>+        WebKitFaviconDatabase* database = webkit_web_context_get_favicon_database(m_webContext.get());
</ins><span class="cx">         g_signal_handlers_disconnect_matched(database, G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, this);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -67,7 +65,7 @@
</span><span class="cx">     static void getFaviconCallback(GObject* sourceObject, GAsyncResult* result, void* data)
</span><span class="cx">     {
</span><span class="cx">         FaviconDatabaseTest* test = static_cast&lt;FaviconDatabaseTest*&gt;(data);
</span><del>-        WebKitFaviconDatabase* database = webkit_web_context_get_favicon_database(test-&gt;m_webContext);
</del><ins>+        WebKitFaviconDatabase* database = webkit_web_context_get_favicon_database(test-&gt;m_webContext.get());
</ins><span class="cx">         test-&gt;m_favicon = webkit_favicon_database_get_favicon_finish(database, result, &amp;test-&gt;m_error.outPtr());
</span><span class="cx">         test-&gt;quitMainLoop();
</span><span class="cx">     }
</span><span class="lines">@@ -87,12 +85,11 @@
</span><span class="cx">             m_favicon = 0;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        WebKitFaviconDatabase* database = webkit_web_context_get_favicon_database(m_webContext);
</del><ins>+        WebKitFaviconDatabase* database = webkit_web_context_get_favicon_database(m_webContext.get());
</ins><span class="cx">         webkit_favicon_database_get_favicon(database, pageURI, 0, getFaviconCallback, this);
</span><span class="cx">         g_main_loop_run(m_mainLoop);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    WebKitWebContext* m_webContext;
</del><span class="cx">     cairo_surface_t* m_favicon;
</span><span class="cx">     CString m_faviconURI;
</span><span class="cx">     GUniqueOutPtr&lt;GError&gt; m_error;
</span><span class="lines">@@ -142,13 +139,13 @@
</span><span class="cx"> 
</span><span class="cx"> static void testSetDirectory(FaviconDatabaseTest* test)
</span><span class="cx"> {
</span><del>-    webkit_web_context_set_favicon_database_directory(test-&gt;m_webContext, kTempDirectory);
-    g_assert_cmpstr(kTempDirectory, ==, webkit_web_context_get_favicon_database_directory(test-&gt;m_webContext));
</del><ins>+    webkit_web_context_set_favicon_database_directory(test-&gt;m_webContext.get(), Test::dataDirectory());
+    g_assert_cmpstr(Test::dataDirectory(), ==, webkit_web_context_get_favicon_database_directory(test-&gt;m_webContext.get()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void testClearDatabase(FaviconDatabaseTest* test)
</span><span class="cx"> {
</span><del>-    WebKitFaviconDatabase* database = webkit_web_context_get_favicon_database(test-&gt;m_webContext);
</del><ins>+    WebKitFaviconDatabase* database = webkit_web_context_get_favicon_database(test-&gt;m_webContext.get());
</ins><span class="cx">     webkit_favicon_database_clear(database);
</span><span class="cx"> 
</span><span class="cx">     GUniquePtr&lt;char&gt; iconURI(webkit_favicon_database_get_favicon_uri(database, kServer-&gt;getURIForPath(&quot;/foo&quot;).data()));
</span><span class="lines">@@ -198,7 +195,7 @@
</span><span class="cx"> 
</span><span class="cx"> static void testGetFaviconURI(FaviconDatabaseTest* test)
</span><span class="cx"> {
</span><del>-    WebKitFaviconDatabase* database = webkit_web_context_get_favicon_database(test-&gt;m_webContext);
</del><ins>+    WebKitFaviconDatabase* database = webkit_web_context_get_favicon_database(test-&gt;m_webContext.get());
</ins><span class="cx"> 
</span><span class="cx">     CString baseURI = kServer-&gt;getURIForPath(&quot;/foo&quot;);
</span><span class="cx">     GUniquePtr&lt;char&gt; iconURI(webkit_favicon_database_get_favicon_uri(database, baseURI.data()));
</span><span class="lines">@@ -243,30 +240,11 @@
</span><span class="cx">     kServer = new WebKitTestServer();
</span><span class="cx">     kServer-&gt;run(serverCallback);
</span><span class="cx"> 
</span><del>-    kTempDirectory = g_dir_make_tmp(&quot;WebKit2Tests-XXXXXX&quot;, 0);
-    g_assert(kTempDirectory);
-
</del><span class="cx">     // Add tests to the suite.
</span><span class="cx">     FaviconDatabaseTest::add(&quot;WebKitFaviconDatabase&quot;, &quot;favicon-database-test&quot;, testFaviconDatabase);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void webkitFaviconDatabaseFinalizedCallback(gpointer, GObject*)
-{
-    if (!g_file_test(kTempDirectory, G_FILE_TEST_IS_DIR))
-        return;
-
-    GUniquePtr&lt;char&gt; filename(g_build_filename(kTempDirectory, &quot;WebpageIcons.db&quot;, nullptr));
-    g_unlink(filename.get());
-
-    g_rmdir(kTempDirectory);
-}
-
</del><span class="cx"> void afterAll()
</span><span class="cx"> {
</span><span class="cx">     delete kServer;
</span><del>-
-    // Delete the temporary files after the IconDatabase has been
-    // closed, that is, once WebKitFaviconDatabase is being destroyed.
-    WebKitFaviconDatabase* database = webkit_web_context_get_favicon_database(webkit_web_context_get_default());
-    g_object_weak_ref(G_OBJECT(database), webkitFaviconDatabaseFinalizedCallback, 0);
</del><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestWebKitUserContentManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitUserContentManager.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitUserContentManager.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitUserContentManager.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx">     MAKE_GLIB_TEST_FIXTURE(UserContentManagerTest);
</span><span class="cx"> 
</span><span class="cx">     UserContentManagerTest()
</span><del>-        : WebViewTest(WEBKIT_WEB_VIEW(webkit_web_view_new_with_user_content_manager(webkit_user_content_manager_new())))
</del><ins>+        : WebViewTest(webkit_user_content_manager_new())
</ins><span class="cx">     {
</span><span class="cx">         // A reference is leaked when passing the result of webkit_user_content_manager_new()
</span><span class="cx">         // directly to webkit_web_view_new_with_user_content_manager() above. Adopting the
</span><span class="lines">@@ -367,7 +367,6 @@
</span><span class="cx"> 
</span><span class="cx"> void beforeAll()
</span><span class="cx"> {
</span><del>-    webkit_web_context_set_web_extensions_directory(webkit_web_context_get_default(), WEBKIT_TEST_WEB_EXTENSIONS_DIR);
</del><span class="cx">     kServer = new WebKitTestServer();
</span><span class="cx">     kServer-&gt;run(serverCallback);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestWebKitWebContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> {
</span><span class="cx">     // Check there's a single instance of the default web context.
</span><span class="cx">     g_assert(webkit_web_context_get_default() == webkit_web_context_get_default());
</span><ins>+    g_assert(webkit_web_context_get_default() != test-&gt;m_webContext.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> class PluginsTest: public Test {
</span><span class="lines">@@ -41,11 +42,10 @@
</span><span class="cx">     MAKE_GLIB_TEST_FIXTURE(PluginsTest);
</span><span class="cx"> 
</span><span class="cx">     PluginsTest()
</span><del>-        : m_context(webkit_web_context_get_default())
-        , m_mainLoop(g_main_loop_new(0, TRUE))
-        , m_plugins(0)
</del><ins>+        : m_mainLoop(g_main_loop_new(nullptr, TRUE))
+        , m_plugins(nullptr)
</ins><span class="cx">     {
</span><del>-        webkit_web_context_set_additional_plugins_directory(m_context, WEBKIT_TEST_PLUGIN_DIR);
</del><ins>+        webkit_web_context_set_additional_plugins_directory(m_webContext.get(), WEBKIT_TEST_PLUGIN_DIR);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ~PluginsTest()
</span><span class="lines">@@ -56,19 +56,18 @@
</span><span class="cx"> 
</span><span class="cx">     static void getPluginsAsyncReadyCallback(GObject*, GAsyncResult* result, PluginsTest* test)
</span><span class="cx">     {
</span><del>-        test-&gt;m_plugins = webkit_web_context_get_plugins_finish(test-&gt;m_context, result, 0);
</del><ins>+        test-&gt;m_plugins = webkit_web_context_get_plugins_finish(test-&gt;m_webContext.get(), result, nullptr);
</ins><span class="cx">         g_main_loop_quit(test-&gt;m_mainLoop);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     GList* getPlugins()
</span><span class="cx">     {
</span><span class="cx">         g_list_free_full(m_plugins, g_object_unref);
</span><del>-        webkit_web_context_get_plugins(m_context, 0, reinterpret_cast&lt;GAsyncReadyCallback&gt;(getPluginsAsyncReadyCallback), this);
</del><ins>+        webkit_web_context_get_plugins(m_webContext.get(), nullptr, reinterpret_cast&lt;GAsyncReadyCallback&gt;(getPluginsAsyncReadyCallback), this);
</ins><span class="cx">         g_main_loop_run(m_mainLoop);
</span><span class="cx">         return m_plugins;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    WebKitWebContext* m_context;
</del><span class="cx">     GMainLoop* m_mainLoop;
</span><span class="cx">     GList* m_plugins;
</span><span class="cx"> };
</span><span class="lines">@@ -177,7 +176,7 @@
</span><span class="cx">     void registerURISchemeHandler(const char* scheme, const char* reply, int replyLength, const char* mimeType)
</span><span class="cx">     {
</span><span class="cx">         m_handlersMap.set(String::fromUTF8(scheme), URISchemeHandler(reply, replyLength, mimeType));
</span><del>-        webkit_web_context_register_uri_scheme(webkit_web_context_get_default(), scheme, uriSchemeRequestCallback, this, 0);
</del><ins>+        webkit_web_context_register_uri_scheme(m_webContext.get(), scheme, uriSchemeRequestCallback, this, 0);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     GRefPtr&lt;WebKitURISchemeRequest&gt; m_uriSchemeRequest;
</span><span class="lines">@@ -236,7 +235,7 @@
</span><span class="cx"> 
</span><span class="cx"> static void testWebContextSpellChecker(Test* test, gconstpointer)
</span><span class="cx"> {
</span><del>-    WebKitWebContext* webContext = webkit_web_context_get_default();
</del><ins>+    WebKitWebContext* webContext = test-&gt;m_webContext.get();
</ins><span class="cx"> 
</span><span class="cx">     // Check what happens if no spell checking language has been set.
</span><span class="cx">     const gchar* const* currentLanguage = webkit_web_context_get_spell_checking_languages(webContext);
</span><span class="lines">@@ -302,7 +301,7 @@
</span><span class="cx">     g_ptr_array_add(languages.get(), const_cast&lt;gpointer&gt;(static_cast&lt;const void*&gt;(&quot;ES_es&quot;)));
</span><span class="cx">     g_ptr_array_add(languages.get(), const_cast&lt;gpointer&gt;(static_cast&lt;const void*&gt;(&quot;dE&quot;)));
</span><span class="cx">     g_ptr_array_add(languages.get(), 0);
</span><del>-    webkit_web_context_set_preferred_languages(webkit_web_context_get_default(), reinterpret_cast&lt;const char* const*&gt;(languages-&gt;pdata));
</del><ins>+    webkit_web_context_set_preferred_languages(test-&gt;m_webContext.get(), reinterpret_cast&lt;const char* const*&gt;(languages-&gt;pdata));
</ins><span class="cx"> 
</span><span class="cx">     static const char* expectedLanguages = &quot;en, es-es;q=0.90, de;q=0.80&quot;;
</span><span class="cx">     test-&gt;loadURI(kServer-&gt;getURIForPath(&quot;/&quot;).data());
</span><span class="lines">@@ -343,7 +342,7 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     SecurityPolicyTest()
</span><del>-        : m_manager(webkit_web_context_get_security_manager(webkit_web_context_get_default()))
</del><ins>+        : m_manager(webkit_web_context_get_security_manager(m_webContext.get()))
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkWebExtensionTestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -51,9 +51,6 @@
</span><span class="cx">     &quot;   &lt;arg type='t' name='pageID' direction='in'/&gt;&quot;
</span><span class="cx">     &quot;   &lt;arg type='s' name='script' direction='in'/&gt;&quot;
</span><span class="cx">     &quot;  &lt;/method&gt;&quot;
</span><del>-    &quot;  &lt;method name='GetInitializationUserData'&gt;&quot;
-    &quot;   &lt;arg type='s' name='userData' direction='out'/&gt;&quot;
-    &quot;  &lt;/method&gt;&quot;
</del><span class="cx">     &quot;  &lt;method name='GetProcessIdentifier'&gt;&quot;
</span><span class="cx">     &quot;   &lt;arg type='u' name='identifier' direction='out'/&gt;&quot;
</span><span class="cx">     &quot;  &lt;/method&gt;&quot;
</span><span class="lines">@@ -64,9 +61,7 @@
</span><span class="cx">     &quot; &lt;/interface&gt;&quot;
</span><span class="cx">     &quot;&lt;/node&gt;&quot;;
</span><span class="cx"> 
</span><del>-static GRefPtr&lt;GVariant&gt; initializationUserData;
</del><span class="cx"> 
</span><del>-
</del><span class="cx"> typedef enum {
</span><span class="cx">     DocumentLoadedSignal,
</span><span class="cx">     URIChangedSignal,
</span><span class="lines">@@ -304,11 +299,6 @@
</span><span class="cx">         g_dbus_method_invocation_return_value(invocation, 0);
</span><span class="cx">     } else if (!g_strcmp0(methodName, &quot;AbortProcess&quot;)) {
</span><span class="cx">         abort();
</span><del>-    } else if (!g_strcmp0(methodName, &quot;GetInitializationUserData&quot;)) {
-        g_assert(initializationUserData);
-        g_assert(g_variant_is_of_type(initializationUserData.get(), G_VARIANT_TYPE_STRING));
-        g_dbus_method_invocation_return_value(invocation, g_variant_new(&quot;(s)&quot;,
-            g_variant_get_string(initializationUserData.get(), nullptr)));
</del><span class="cx">     } else if (!g_strcmp0(methodName, &quot;GetProcessIdentifier&quot;)) {
</span><span class="cx">         g_dbus_method_invocation_return_value(invocation,
</span><span class="cx">             g_variant_new(&quot;(u)&quot;, static_cast&lt;guint32&gt;(getCurrentProcessID())));
</span><span class="lines">@@ -351,26 +341,14 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static GUniquePtr&lt;char&gt; makeBusName(GVariant* userData)
-{
-    // When the web extension is used by TestMultiprocess, an uint32
-    // identifier is passed as user data. It uniquely identifies
-    // the web process, and the UI side expects it added as suffix to
-    // the bus name.
-    if (userData &amp;&amp; g_variant_is_of_type(userData, G_VARIANT_TYPE_UINT32))
-        return GUniquePtr&lt;char&gt;(g_strdup_printf(&quot;org.webkit.gtk.WebExtensionTest%u&quot;, g_variant_get_uint32(userData)));
-
-    return GUniquePtr&lt;char&gt;(g_strdup(&quot;org.webkit.gtk.WebExtensionTest&quot;));
-}
-
</del><span class="cx"> extern &quot;C&quot; void webkit_web_extension_initialize_with_user_data(WebKitWebExtension* extension, GVariant* userData)
</span><span class="cx"> {
</span><del>-    initializationUserData = userData;
-
</del><span class="cx">     g_signal_connect(extension, &quot;page-created&quot;, G_CALLBACK(pageCreatedCallback), extension);
</span><span class="cx">     g_signal_connect(webkit_script_world_get_default(), &quot;window-object-cleared&quot;, G_CALLBACK(windowObjectCleared), 0);
</span><span class="cx"> 
</span><del>-    GUniquePtr&lt;char&gt; busName(makeBusName(userData));
</del><ins>+    g_assert(userData);
+    g_assert(g_variant_is_of_type(userData, G_VARIANT_TYPE_UINT32));
+    GUniquePtr&lt;char&gt; busName(g_strdup_printf(&quot;org.webkit.gtk.WebExtensionTest%u&quot;, g_variant_get_uint32(userData)));
</ins><span class="cx">     g_bus_own_name(
</span><span class="cx">         G_BUS_TYPE_SESSION,
</span><span class="cx">         busName.get(),
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkWebProcessTestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -93,11 +93,14 @@
</span><span class="cx">         g_warning(&quot;Failed to register object: %s\n&quot;, error-&gt;message);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-extern &quot;C&quot; void webkit_web_extension_initialize(WebKitWebExtension* extension)
</del><ins>+extern &quot;C&quot; void webkit_web_extension_initialize_with_user_data(WebKitWebExtension* extension, GVariant* userData)
</ins><span class="cx"> {
</span><ins>+    g_assert(userData);
+    g_assert(g_variant_is_of_type(userData, G_VARIANT_TYPE_UINT32));
+    GUniquePtr&lt;char&gt; busName(g_strdup_printf(&quot;org.webkit.gtk.WebProcessTest%u&quot;, g_variant_get_uint32(userData)));
</ins><span class="cx">     g_bus_own_name(
</span><span class="cx">         G_BUS_TYPE_SESSION,
</span><del>-        &quot;org.webkit.gtk.WebProcessTest&quot;,
</del><ins>+        busName.get(),
</ins><span class="cx">         G_BUS_NAME_OWNER_FLAGS_NONE,
</span><span class="cx">         busAcquiredCallback,
</span><span class="cx">         0, 0,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIgtkWebKit2GtkTestMaincpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -22,12 +22,19 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;glib/gstdio.h&gt;
</span><span class="cx"> #include &lt;gtk/gtk.h&gt;
</span><del>-#include &lt;webkit2/webkit2.h&gt;
-#include &lt;wtf/gobject/GUniquePtr.h&gt;
</del><span class="cx"> 
</span><ins>+uint32_t Test::s_webExtensionID = 0;
+
</ins><span class="cx"> void beforeAll();
</span><span class="cx"> void afterAll();
</span><span class="cx"> 
</span><ins>+static GUniquePtr&lt;char&gt; testDataDirectory(g_dir_make_tmp(&quot;WebKit2GtkTests-XXXXXX&quot;, nullptr));
+
+const char* Test::dataDirectory()
+{
+    return testDataDirectory.get();
+}
+
</ins><span class="cx"> static void registerGResource(void)
</span><span class="cx"> {
</span><span class="cx">     GUniquePtr&lt;char&gt; resourcesPath(g_build_filename(WEBKIT_EXEC_PATH, &quot;TestWebKitAPI&quot;, &quot;WebKit2Gtk&quot;, &quot;resources&quot;, &quot;webkit2gtk-tests-resources.gresource&quot;, nullptr));
</span><span class="lines">@@ -45,7 +52,10 @@
</span><span class="cx">     const char* fileName;
</span><span class="cx">     while ((fileName = g_dir_read_name(directory))) {
</span><span class="cx">         GUniquePtr&lt;char&gt; filePath(g_build_filename(directoryPath, fileName, nullptr));
</span><del>-        g_unlink(filePath.get());
</del><ins>+        if (g_file_test(filePath.get(), G_FILE_TEST_IS_DIR))
+            removeNonEmptyDirectory(filePath.get());
+        else
+            g_unlink(filePath.get());
</ins><span class="cx">     }
</span><span class="cx">     g_dir_close(directory);
</span><span class="cx">     g_rmdir(directoryPath);
</span><span class="lines">@@ -66,15 +76,12 @@
</span><span class="cx"> 
</span><span class="cx">     registerGResource();
</span><span class="cx"> 
</span><del>-    GUniquePtr&lt;char&gt; diskCacheTempDirectory(g_dir_make_tmp(&quot;WebKit2TestsDiskCache-XXXXXX&quot;, 0));
-    g_assert(diskCacheTempDirectory.get());
-    webkit_web_context_set_disk_cache_directory(webkit_web_context_get_default(), diskCacheTempDirectory.get());
-
</del><span class="cx">     beforeAll();
</span><span class="cx">     int returnValue = g_test_run();
</span><span class="cx">     afterAll();
</span><span class="cx"> 
</span><del>-    removeNonEmptyDirectory(diskCacheTempDirectory.get());
</del><ins>+    removeNonEmptyDirectory(testDataDirectory.get());
</ins><span class="cx"> 
</span><span class="cx">     return returnValue;
</span><span class="cx"> }
</span><ins>+
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPIgtkWebKit2GtkTestMainh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -22,7 +22,9 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;cairo.h&gt;
</span><span class="cx"> #include &lt;glib-object.h&gt;
</span><ins>+#include &lt;webkit2/webkit2.h&gt;
</ins><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><ins>+#include &lt;wtf/gobject/GRefPtr.h&gt;
</ins><span class="cx"> #include &lt;wtf/gobject/GUniquePtr.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -56,8 +58,24 @@
</span><span class="cx"> public:
</span><span class="cx">     MAKE_GLIB_TEST_FIXTURE(Test);
</span><span class="cx"> 
</span><ins>+    static const char* dataDirectory();
+
+    static void initializeWebExtensionsCallback(WebKitWebContext* context, Test* test)
+    {
+        test-&gt;initializeWebExtensions();
+    }
+
+    Test()
+        : m_webContext(adoptGRef(webkit_web_context_new()))
+    {
+        g_signal_connect(m_webContext.get(), &quot;initialize-web-extensions&quot;, G_CALLBACK(initializeWebExtensionsCallback), this);
+        GUniquePtr&lt;char&gt; diskCacheDirectory(g_build_filename(dataDirectory(), &quot;disk-cache&quot;, nullptr));
+        webkit_web_context_set_disk_cache_directory(m_webContext.get(), diskCacheDirectory.get());
+    }
+
</ins><span class="cx">     ~Test()
</span><span class="cx">     {
</span><ins>+        g_signal_handlers_disconnect_matched(m_webContext.get(), G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this);
</ins><span class="cx">         if (m_watchedObjects.isEmpty())
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="lines">@@ -70,6 +88,12 @@
</span><span class="cx">         g_assert(m_watchedObjects.isEmpty());
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    virtual void initializeWebExtensions()
+    {
+        webkit_web_context_set_web_extensions_directory(m_webContext.get(), WEBKIT_TEST_WEB_EXTENSIONS_DIR);
+        webkit_web_context_set_web_extensions_initialization_user_data(m_webContext.get(), g_variant_new_uint32(++s_webExtensionID));
+    }
+
</ins><span class="cx">     static void objectFinalized(Test* test, GObject* finalizedObject)
</span><span class="cx">     {
</span><span class="cx">         test-&gt;m_watchedObjects.remove(finalizedObject);
</span><span class="lines">@@ -113,6 +137,8 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     HashSet&lt;GObject*&gt; m_watchedObjects;
</span><ins>+    GRefPtr&lt;WebKitWebContext&gt; m_webContext;
+    static uint32_t s_webExtensionID;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> #endif // TestMain_h
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIgtkWebKit2GtkWebProcessTestRunnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -39,8 +39,8 @@
</span><span class="cx">     g_main_loop_unref(m_mainLoop);
</span><span class="cx"> 
</span><span class="cx">     // g_test_dbus_down waits until the connection is freed, so release our refs explicitly before calling it.
</span><del>-    m_connection = 0;
-    m_proxy = 0;
</del><ins>+    m_connection = nullptr;
+    m_proxy = nullptr;
</ins><span class="cx">     g_test_dbus_down(m_bus.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -50,20 +50,6 @@
</span><span class="cx">     g_main_loop_quit(testRunner-&gt;m_mainLoop);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-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();
-}
-
</del><span class="cx"> void WebProcessTestRunner::onNameAppeared(GDBusConnection*, const char*, const char*, gpointer userData)
</span><span class="cx"> {
</span><span class="cx">     WebProcessTestRunner* testRunner = static_cast&lt;WebProcessTestRunner*&gt;(userData);
</span><span class="lines">@@ -84,18 +70,25 @@
</span><span class="cx">     testRunner-&gt;finishTest(testResult);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool WebProcessTestRunner::runTest(const char* suiteName, const char* testName, GVariant* args)
</del><ins>+bool WebProcessTestRunner::runTest(const char* suiteName, const char* testName, uint32_t testID, GVariant* args)
</ins><span class="cx"> {
</span><span class="cx">     g_assert(g_variant_is_of_type(args, G_VARIANT_TYPE_VARDICT));
</span><span class="cx"> 
</span><del>-    unsigned watcherID = g_bus_watch_name_on_connection(m_connection.get(), &quot;org.webkit.gtk.WebProcessTest&quot;, G_BUS_NAME_WATCHER_FLAGS_NONE,
</del><ins>+    GUniquePtr&lt;char&gt; testBusName(g_strdup_printf(&quot;org.webkit.gtk.WebProcessTest%u&quot;, testID));
+    unsigned watcherID = g_bus_watch_name_on_connection(m_connection.get(), testBusName.get(), G_BUS_NAME_WATCHER_FLAGS_NONE,
</ins><span class="cx">         WebProcessTestRunner::onNameAppeared, WebProcessTestRunner::onNameVanished, this, 0);
</span><span class="cx">     g_main_loop_run(m_mainLoop);
</span><span class="cx"> 
</span><ins>+    g_dbus_proxy_new(m_connection.get(), G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, nullptr,
+        testBusName.get(), &quot;/org/webkit/gtk/WebProcessTest&quot;, &quot;org.webkit.gtk.WebProcessTest&quot;,
+        nullptr, reinterpret_cast&lt;GAsyncReadyCallback&gt;(WebProcessTestRunner::proxyCreatedCallback), this);
+    g_main_loop_run(m_mainLoop);
+    g_assert(m_proxy.get());
+
</ins><span class="cx">     m_testResult = false;
</span><span class="cx">     GUniquePtr&lt;char&gt; testPath(g_strdup_printf(&quot;%s/%s&quot;, suiteName, testName));
</span><span class="cx">     g_dbus_proxy_call(
</span><del>-        proxy(),
</del><ins>+        m_proxy.get(),
</ins><span class="cx">         &quot;RunTest&quot;,
</span><span class="cx">         g_variant_new(&quot;(s@a{sv})&quot;, testPath.get(), args),
</span><span class="cx">         G_DBUS_CALL_FLAGS_NONE,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIgtkWebKit2GtkWebProcessTestRunnerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.h (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.h        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebProcessTestRunner.h        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx">     WebProcessTestRunner();
</span><span class="cx">     ~WebProcessTestRunner();
</span><span class="cx"> 
</span><del>-    bool runTest(const char* suiteName, const char* testName, GVariant* args);
</del><ins>+    bool runTest(const char* suiteName, const char* testName, uint32_t testID, GVariant* args);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     static void proxyCreatedCallback(GObject*, GAsyncResult*, WebProcessTestRunner*);
</span><span class="lines">@@ -37,7 +37,6 @@
</span><span class="cx">     static void onNameVanished(GDBusConnection*, const char*, gpointer);
</span><span class="cx">     static void testFinishedCallback(GDBusProxy*, GAsyncResult*, WebProcessTestRunner*);
</span><span class="cx"> 
</span><del>-    GDBusProxy* proxy();
</del><span class="cx">     void finishTest(bool result);
</span><span class="cx"> 
</span><span class="cx">     GMainLoop* m_mainLoop;
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIgtkWebKit2GtkWebViewTestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -24,16 +24,13 @@
</span><span class="cx"> #include &lt;JavaScriptCore/JSRetainPtr.h&gt;
</span><span class="cx"> #include &lt;WebCore/GUniquePtrGtk.h&gt;
</span><span class="cx"> 
</span><del>-WebViewTest::WebViewTest()
-    : WebViewTest(WEBKIT_WEB_VIEW(webkit_web_view_new())) { }
-
-WebViewTest::WebViewTest(WebKitWebView* webView)
-    : m_webView(WEBKIT_WEB_VIEW(g_object_ref_sink(webView)))
-    , m_mainLoop(g_main_loop_new(0, TRUE))
-    , m_parentWindow(0)
-    , m_javascriptResult(0)
</del><ins>+WebViewTest::WebViewTest(WebKitUserContentManager* userContentManager)
+    : m_webView(WEBKIT_WEB_VIEW(g_object_ref_sink(g_object_new(WEBKIT_TYPE_WEB_VIEW, &quot;web-context&quot;, m_webContext.get(), &quot;user-content-manager&quot;, userContentManager, nullptr))))
+    , m_mainLoop(g_main_loop_new(nullptr, TRUE))
+    , m_parentWindow(nullptr)
+    , m_javascriptResult(nullptr)
</ins><span class="cx">     , m_resourceDataSize(0)
</span><del>-    , m_surface(0)
</del><ins>+    , m_surface(nullptr)
</ins><span class="cx"> {
</span><span class="cx">     assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_webView));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIgtkWebKit2GtkWebViewTesth"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h (176255 => 176256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h        2014-11-18 13:40:49 UTC (rev 176255)
+++ trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h        2014-11-18 14:19:15 UTC (rev 176256)
</span><span class="lines">@@ -28,8 +28,7 @@
</span><span class="cx"> class WebViewTest: public Test {
</span><span class="cx"> public:
</span><span class="cx">     MAKE_GLIB_TEST_FIXTURE(WebViewTest);
</span><del>-    WebViewTest(WebKitWebView*);
-    WebViewTest();
</del><ins>+    WebViewTest(WebKitUserContentManager* = nullptr);
</ins><span class="cx">     virtual ~WebViewTest();
</span><span class="cx"> 
</span><span class="cx">     virtual void loadURI(const char* uri);
</span></span></pre>
</div>
</div>

</body>
</html>