<!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>[207097] releases/WebKitGTK/webkit-2.14/Tools</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/206302">r206302</a> - [GTK] Make all WebView tests have a WebKitUserContentManager
https://bugs.webkit.org/show_bug.cgi?id=162487

Reviewed by Michael Catanzaro.

It simplifies tests using the user content manager, and allows to use it without having to subclass WebViewTest.

* TestWebKitAPI/Tests/WebKit2Gtk/TestConsoleMessage.cpp:
(ConsoleMessageTest::ConsoleMessageTest):
(ConsoleMessageTest::~ConsoleMessageTest):
* TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp:
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitUserContentManager.cpp:
(testUserContentManagerInjectedStyleSheet):
(testUserContentManagerInjectedScript):
(UserScriptMessageTest::UserScriptMessageTest):
(beforeAll):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:
(testWebViewIsPlayingAudio):
* TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
(WebViewTest::WebViewTest):
* TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit214ToolsChangeLog">releases/WebKitGTK/webkit-2.14/Tools/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit214ToolsTestWebKitAPITestsWebKit2GtkTestConsoleMessagecpp">releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestConsoleMessage.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214ToolsTestWebKitAPITestsWebKit2GtkTestUIClientcpp">releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214ToolsTestWebKitAPITestsWebKit2GtkTestWebKitUserContentManagercpp">releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitUserContentManager.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214ToolsTestWebKitAPITestsWebKit2GtkTestWebKitWebViewcpp">releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214ToolsTestWebKitAPIgtkWebKit2GtkWebViewTestcpp">releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214ToolsTestWebKitAPIgtkWebKit2GtkWebViewTesth">releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit214ToolsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Tools/ChangeLog (207096 => 207097)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Tools/ChangeLog        2016-10-11 11:58:38 UTC (rev 207096)
+++ releases/WebKitGTK/webkit-2.14/Tools/ChangeLog        2016-10-11 12:00:15 UTC (rev 207097)
</span><span class="lines">@@ -1,5 +1,29 @@
</span><span class="cx"> 2016-09-23  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><ins>+        [GTK] Make all WebView tests have a WebKitUserContentManager
+        https://bugs.webkit.org/show_bug.cgi?id=162487
+
+        Reviewed by Michael Catanzaro.
+
+        It simplifies tests using the user content manager, and allows to use it without having to subclass WebViewTest.
+
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestConsoleMessage.cpp:
+        (ConsoleMessageTest::ConsoleMessageTest):
+        (ConsoleMessageTest::~ConsoleMessageTest):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp:
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitUserContentManager.cpp:
+        (testUserContentManagerInjectedStyleSheet):
+        (testUserContentManagerInjectedScript):
+        (UserScriptMessageTest::UserScriptMessageTest):
+        (beforeAll):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:
+        (testWebViewIsPlayingAudio):
+        * TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
+        (WebViewTest::WebViewTest):
+        * TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h:
+
+2016-09-23  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
</ins><span class="cx">         REGRESSION(r194387): Crash on github.com in IntlDateTimeFormat::resolvedOptions in C locale
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=162139
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214ToolsTestWebKitAPITestsWebKit2GtkTestConsoleMessagecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestConsoleMessage.cpp (207096 => 207097)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestConsoleMessage.cpp        2016-10-11 11:58:38 UTC (rev 207096)
+++ releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestConsoleMessage.cpp        2016-10-11 12:00:15 UTC (rev 207097)
</span><span class="lines">@@ -64,18 +64,15 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ConsoleMessageTest()
</span><del>-        : WebViewTest(webkit_user_content_manager_new())
</del><span class="cx">     {
</span><del>-        WebKitUserContentManager* manager = webkit_web_view_get_user_content_manager(m_webView);
-        webkit_user_content_manager_register_script_message_handler(manager, &quot;console&quot;);
-        g_signal_connect(manager, &quot;script-message-received::console&quot;, G_CALLBACK(consoleMessageReceivedCallback), this);
</del><ins>+        webkit_user_content_manager_register_script_message_handler(m_userContentManager.get(), &quot;console&quot;);
+        g_signal_connect(m_userContentManager.get(), &quot;script-message-received::console&quot;, G_CALLBACK(consoleMessageReceivedCallback), this);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ~ConsoleMessageTest()
</span><span class="cx">     {
</span><del>-        WebKitUserContentManager* manager = webkit_web_view_get_user_content_manager(m_webView);
-        g_signal_handlers_disconnect_matched(manager, G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this);
-        webkit_user_content_manager_unregister_script_message_handler(manager, &quot;console&quot;);
</del><ins>+        g_signal_handlers_disconnect_matched(m_userContentManager.get(), G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this);
+        webkit_user_content_manager_unregister_script_message_handler(m_userContentManager.get(), &quot;console&quot;);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     void waitUntilConsoleMessageReceived()
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214ToolsTestWebKitAPITestsWebKit2GtkTestUIClientcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp (207096 => 207097)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp        2016-10-11 11:58:38 UTC (rev 207096)
+++ releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp        2016-10-11 12:00:15 UTC (rev 207097)
</span><span class="lines">@@ -232,8 +232,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     UIClientTest()
</span><del>-        : WebViewTest(webkit_user_content_manager_new())
-        , m_scriptDialogType(WEBKIT_SCRIPT_DIALOG_ALERT)
</del><ins>+        : m_scriptDialogType(WEBKIT_SCRIPT_DIALOG_ALERT)
</ins><span class="cx">         , m_scriptDialogConfirmed(true)
</span><span class="cx">         , m_allowPermissionRequests(false)
</span><span class="cx">         , m_verifyMediaTypes(false)
</span><span class="lines">@@ -246,17 +245,15 @@
</span><span class="cx">         g_signal_connect(m_webView, &quot;script-dialog&quot;, G_CALLBACK(scriptDialog), this);
</span><span class="cx">         g_signal_connect(m_webView, &quot;mouse-target-changed&quot;, G_CALLBACK(mouseTargetChanged), this);
</span><span class="cx">         g_signal_connect(m_webView, &quot;permission-request&quot;, G_CALLBACK(permissionRequested), this);
</span><del>-        WebKitUserContentManager* manager = webkit_web_view_get_user_content_manager(m_webView);
-        webkit_user_content_manager_register_script_message_handler(manager, &quot;permission&quot;);
-        g_signal_connect(manager, &quot;script-message-received::permission&quot;, G_CALLBACK(permissionResultMessageReceivedCallback), this);
</del><ins>+        webkit_user_content_manager_register_script_message_handler(m_userContentManager.get(), &quot;permission&quot;);
+        g_signal_connect(m_userContentManager.get(), &quot;script-message-received::permission&quot;, G_CALLBACK(permissionResultMessageReceivedCallback), this);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ~UIClientTest()
</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><del>-        WebKitUserContentManager* manager = webkit_web_view_get_user_content_manager(m_webView);
-        g_signal_handlers_disconnect_matched(manager, G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, this);
-        webkit_user_content_manager_unregister_script_message_handler(manager, &quot;permission&quot;);
</del><ins>+        g_signal_handlers_disconnect_matched(m_userContentManager.get(), G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, this);
+        webkit_user_content_manager_unregister_script_message_handler(m_userContentManager.get(), &quot;permission&quot;);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static void tryWebViewCloseCallback(UIClientTest* test)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214ToolsTestWebKitAPITestsWebKit2GtkTestWebKitUserContentManagercpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitUserContentManager.cpp (207096 => 207097)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitUserContentManager.cpp        2016-10-11 11:58:38 UTC (rev 207096)
+++ releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitUserContentManager.cpp        2016-10-11 12:00:15 UTC (rev 207097)
</span><span class="lines">@@ -27,23 +27,6 @@
</span><span class="cx"> #include &lt;wtf/glib/GRefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/glib/GUniquePtr.h&gt;
</span><span class="cx"> 
</span><del>-class UserContentManagerTest : public WebViewTest {
-public:
-    MAKE_GLIB_TEST_FIXTURE(UserContentManagerTest);
-
-    UserContentManagerTest()
-        : WebViewTest(webkit_user_content_manager_new())
-    {
-        // A reference is leaked when passing the result of webkit_user_content_manager_new()
-        // directly to webkit_web_view_new_with_user_content_manager() above. Adopting the
-        // reference here avoids the leak.
-        m_userContentManager = adoptGRef(webkit_web_view_get_user_content_manager(m_webView));
-        assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_userContentManager.get()));
-    }
-
-    GRefPtr&lt;WebKitUserContentManager&gt; m_userContentManager;
-};
-
</del><span class="cx"> static WebKitTestServer* kServer;
</span><span class="cx"> 
</span><span class="cx"> // These are all here so that they can be changed easily, if necessary.
</span><span class="lines">@@ -127,7 +110,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void testUserContentManagerInjectedStyleSheet(UserContentManagerTest* test, gconstpointer)
</del><ins>+static void testUserContentManagerInjectedStyleSheet(WebViewTest* test, gconstpointer)
</ins><span class="cx"> {
</span><span class="cx">     char* whitelist[3] = { 0, 0, 0 };
</span><span class="cx">     char* blacklist[3] = { 0, 0, 0 };
</span><span class="lines">@@ -170,7 +153,7 @@
</span><span class="cx">     removeOldInjectedContentAndResetLists(test-&gt;m_userContentManager.get(), whitelist, blacklist);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void testUserContentManagerInjectedScript(UserContentManagerTest* test, gconstpointer)
</del><ins>+static void testUserContentManagerInjectedScript(WebViewTest* test, gconstpointer)
</ins><span class="cx"> {
</span><span class="cx">     char* whitelist[3] = { 0, 0, 0 };
</span><span class="cx">     char* blacklist[3] = { 0, 0, 0 };
</span><span class="lines">@@ -213,13 +196,12 @@
</span><span class="cx">     removeOldInjectedContentAndResetLists(test-&gt;m_userContentManager.get(), whitelist, blacklist);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class UserScriptMessageTest : public UserContentManagerTest {
</del><ins>+class UserScriptMessageTest : public WebViewTest {
</ins><span class="cx"> public:
</span><span class="cx">     MAKE_GLIB_TEST_FIXTURE(UserScriptMessageTest);
</span><span class="cx"> 
</span><span class="cx">     UserScriptMessageTest()
</span><del>-        : UserContentManagerTest()
-        , m_userScriptMessage(nullptr)
</del><ins>+        : m_userScriptMessage(nullptr)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -376,8 +358,8 @@
</span><span class="cx">     kServer-&gt;run(serverCallback);
</span><span class="cx"> 
</span><span class="cx">     Test::add(&quot;WebKitWebView&quot;, &quot;new-with-user-content-manager&quot;, testWebViewNewWithUserContentManager);
</span><del>-    UserContentManagerTest::add(&quot;WebKitUserContentManager&quot;, &quot;injected-style-sheet&quot;, testUserContentManagerInjectedStyleSheet);
-    UserContentManagerTest::add(&quot;WebKitUserContentManager&quot;, &quot;injected-script&quot;, testUserContentManagerInjectedScript);
</del><ins>+    WebViewTest::add(&quot;WebKitUserContentManager&quot;, &quot;injected-style-sheet&quot;, testUserContentManagerInjectedStyleSheet);
+    WebViewTest::add(&quot;WebKitUserContentManager&quot;, &quot;injected-script&quot;, testUserContentManagerInjectedScript);
</ins><span class="cx">     UserScriptMessageTest::add(&quot;WebKitUserContentManager&quot;, &quot;script-message-received&quot;, testUserContentManagerScriptMessageReceived);
</span><span class="cx">     UserScriptMessageTest::add(&quot;WebKitUserContentManager&quot;, &quot;script-message-from-dom-bindings&quot;, testUserContentManagerScriptMessageFromDOMBindings);
</span><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214ToolsTestWebKitAPITestsWebKit2GtkTestWebKitWebViewcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp (207096 => 207097)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp        2016-10-11 11:58:38 UTC (rev 207096)
+++ releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp        2016-10-11 12:00:15 UTC (rev 207097)
</span><span class="lines">@@ -699,23 +699,20 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     NotificationWebViewTest()
</span><del>-        : WebViewTest(webkit_user_content_manager_new())
-        , m_notification(nullptr)
</del><ins>+        : m_notification(nullptr)
</ins><span class="cx">         , m_event(None)
</span><span class="cx">     {
</span><span class="cx">         g_signal_connect(m_webView, &quot;permission-request&quot;, G_CALLBACK(permissionRequestCallback), this);
</span><span class="cx">         g_signal_connect(m_webView, &quot;show-notification&quot;, G_CALLBACK(showNotificationCallback), this);
</span><del>-        WebKitUserContentManager* manager = webkit_web_view_get_user_content_manager(m_webView);
-        webkit_user_content_manager_register_script_message_handler(manager, &quot;notifications&quot;);
-        g_signal_connect(manager, &quot;script-message-received::notifications&quot;, G_CALLBACK(notificationsMessageReceivedCallback), this);
</del><ins>+        webkit_user_content_manager_register_script_message_handler(m_userContentManager.get(), &quot;notifications&quot;);
+        g_signal_connect(m_userContentManager.get(), &quot;script-message-received::notifications&quot;, G_CALLBACK(notificationsMessageReceivedCallback), this);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ~NotificationWebViewTest()
</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><del>-        WebKitUserContentManager* manager = webkit_web_view_get_user_content_manager(m_webView);
-        g_signal_handlers_disconnect_matched(manager, G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, this);
-        webkit_user_content_manager_unregister_script_message_handler(manager, &quot;notifications&quot;);
</del><ins>+        g_signal_handlers_disconnect_matched(m_userContentManager.get(), G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, this);
+        webkit_user_content_manager_unregister_script_message_handler(m_userContentManager.get(), &quot;notifications&quot;);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">    void requestPermissionAndWaitUntilGiven()
</span><span class="lines">@@ -818,13 +815,15 @@
</span><span class="cx">     test-&gt;waitUntilLoadFinished();
</span><span class="cx">     g_assert(!webkit_web_view_is_playing_audio(test-&gt;m_webView));
</span><span class="cx"> 
</span><del>-    webkit_web_view_run_javascript(test-&gt;m_webView, &quot;playVideo();&quot;, nullptr, nullptr, nullptr);
-    test-&gt;waitUntilIsPlayingAudioChanged();
</del><ins>+    test-&gt;runJavaScriptAndWaitUntilFinished(&quot;playVideo();&quot;, nullptr);
+    if (!webkit_web_view_is_playing_audio(test-&gt;m_webView))
+        test-&gt;waitUntilIsPlayingAudioChanged();
</ins><span class="cx">     g_assert(webkit_web_view_is_playing_audio(test-&gt;m_webView));
</span><span class="cx"> 
</span><span class="cx">     // Pause the video, and check again.
</span><del>-    webkit_web_view_run_javascript(test-&gt;m_webView, &quot;document.getElementById('test-video').pause();&quot;, nullptr, nullptr, nullptr);
-    test-&gt;waitUntilIsPlayingAudioChanged();
</del><ins>+    test-&gt;runJavaScriptAndWaitUntilFinished(&quot;document.getElementById('test-video').pause();&quot;, nullptr);
+    if (webkit_web_view_is_playing_audio(test-&gt;m_webView))
+        test-&gt;waitUntilIsPlayingAudioChanged();
</ins><span class="cx">     g_assert(!webkit_web_view_is_playing_audio(test-&gt;m_webView));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214ToolsTestWebKitAPIgtkWebKit2GtkWebViewTestcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp (207096 => 207097)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp        2016-10-11 11:58:38 UTC (rev 207096)
+++ releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp        2016-10-11 12:00:15 UTC (rev 207097)
</span><span class="lines">@@ -24,8 +24,9 @@
</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(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))))
</del><ins>+WebViewTest::WebViewTest()
+    : m_userContentManager(adoptGRef(webkit_user_content_manager_new()))
+    , 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;, m_userContentManager.get(), nullptr))))
</ins><span class="cx">     , m_mainLoop(g_main_loop_new(nullptr, TRUE))
</span><span class="cx">     , m_parentWindow(nullptr)
</span><span class="cx">     , m_javascriptResult(nullptr)
</span><span class="lines">@@ -34,6 +35,7 @@
</span><span class="cx">     , m_expectedWebProcessCrash(false)
</span><span class="cx"> {
</span><span class="cx">     assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_webView));
</span><ins>+    assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_userContentManager.get()));
</ins><span class="cx">     g_signal_connect(m_webView, &quot;web-process-crashed&quot;, G_CALLBACK(WebViewTest::webProcessCrashed), this);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214ToolsTestWebKitAPIgtkWebKit2GtkWebViewTesth"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h (207096 => 207097)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h        2016-10-11 11:58:38 UTC (rev 207096)
+++ releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h        2016-10-11 12:00:15 UTC (rev 207097)
</span><span class="lines">@@ -28,7 +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(WebKitUserContentManager* = nullptr);
</del><ins>+    WebViewTest();
</ins><span class="cx">     virtual ~WebViewTest();
</span><span class="cx"> 
</span><span class="cx">     virtual void loadURI(const char* uri);
</span><span class="lines">@@ -80,6 +80,7 @@
</span><span class="cx"> 
</span><span class="cx">     static gboolean webProcessCrashed(WebKitWebView*, WebViewTest*);
</span><span class="cx"> 
</span><ins>+    GRefPtr&lt;WebKitUserContentManager&gt; m_userContentManager;
</ins><span class="cx">     WebKitWebView* m_webView;
</span><span class="cx">     GMainLoop* m_mainLoop;
</span><span class="cx">     CString m_activeURI;
</span></span></pre>
</div>
</div>

</body>
</html>