<!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>[188452] releases/WebKitGTK/webkit-2.10/LayoutTests</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/188452">188452</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-08-14 03:38:42 -0700 (Fri, 14 Aug 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/188406">r188406</a> - Web Inspector: refactor ProtocolTest to be an InjectedTestHarness subclass
https://bugs.webkit.org/show_bug.cgi?id=147954

Reviewed by Joseph Pecoraro.

In preparation for sharing the same test harness API between protocol tests
and frontend tests, this patch refactors ProtocolTest into the desired
class structure. Each type of test (currently: protocol, frontend) extends
InjectedTestHarness and fills in a few key methods for communicating with
the test page-side code.

This patch standardizes on assert() only logging when the condition is false.
Update protocol tests to use ProtocolTestHarness.expectThat, rather than assert.

* http/tests/inspector/resources/ProtocolTestStub.js:
(window.InjectedTestHarness):
(window.InjectedTestHarness.prototype.createAsyncSuite):
(window.InjectedTestHarness.prototype.createSyncSuite):
(window.InjectedTestHarness.prototype.completeTest):
(window.InjectedTestHarness.prototype.addResult):
(window.InjectedTestHarness.prototype.debugLog):
(window.InjectedTestHarness.prototype.evaluateInPage):
(window.InjectedTestHarness.prototype.importScript):
(window.InjectedTestHarness.prototype.get logCount):
(window.InjectedTestHarness.prototype.log):
(window.InjectedTestHarness.prototype.assert):
(window.InjectedTestHarness.prototype.expectThat):

(InjectedTestHarness.AsyncTestSuite): Use a stored reference to the harness
rather than hardcoding a specific InjectedTestHarness instance.

(InjectedTestHarness.AsyncTestSuite.prototype.runTestCasesAndFinish.finish):
(InjectedTestHarness.AsyncTestSuite.prototype.runTestCasesAndFinish):
(InjectedTestHarness.AsyncTestSuite.prototype.runTestCases):

(InjectedTestHarness.SyncTestSuite): Use a stored reference to the harness
rather than hardcoding a specific InjectedTestHarness instance.

(InjectedTestHarness.SyncTestSuite.prototype.runTestCasesAndFinish):
(InjectedTestHarness.SyncTestSuite.prototype.runTestCases):

(ProtocolTestHarness.prototype.completeTest):
(ProtocolTestHarness.prototype.addResult):
(ProtocolTestHarness.prototype.debugLog):
(ProtocolTestHarness.prototype.evaluateInPage):
(ProtocolTestHarness):
(InspectorProtocol.sendCommand):
(InspectorProtocol.awaitCommand):
(InspectorProtocol.awaitEvent.):
(InspectorProtocol.awaitEvent):
(InspectorProtocol.addEventListener):
(InspectorProtocol.sendMessage):
(InspectorProtocol.checkForError):
(InspectorFrontendAPI.dispatchMessageAsync):
(ProtocolTest.AsyncTestSuite): Moved.
(ProtocolTest.AsyncTestSuite.prototype.runTestCasesAndFinish.finish): Moved.
(ProtocolTest.AsyncTestSuite.prototype.runTestCasesAndFinish): Moved.
(ProtocolTest.AsyncTestSuite.prototype.runTestCases): Moved.
(ProtocolTest.SyncTestSuite): Moved.
(ProtocolTest.SyncTestSuite.prototype.runTestCasesAndFinish): Moved.
(ProtocolTest.SyncTestSuite.prototype.runTestCases): Moved.
(ProtocolTest.log): Moved.
(ProtocolTest.assert): Moved.
(ProtocolTest.debugLog): Moved.
(ProtocolTest.completeTest): Moved.
(ProtocolTest.importScript): Moved.
* http/tests/inspector/resources/console-test.js:
(.suite.addTestCase.):
(.suite.addTestCase):
(ProtocolTest.Console.addTestCase):
* http/tests/inspector/resources/protocol-test.js:
(closeTest):
* inspector/console/console-message.html:
* inspector/console/x-frame-options-message.html:
* inspector/debugger/didSampleProbe-multiple-probes.html:
* inspector/dom-debugger/node-removed.html:
* inspector/dom/dom-remove-events.html:
* inspector/runtime/getProperties.html:
* inspector/unit-tests/async-test-suite-expected.txt:
* inspector/unit-tests/async-test-suite.html:
* inspector/unit-tests/sync-test-suite-expected.txt:
* inspector/unit-tests/sync-test-suite.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestshttptestsinspectorresourcesProtocolTestStubjs">releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/inspector/resources/ProtocolTestStub.js</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestshttptestsinspectorresourcesconsoletestjs">releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/inspector/resources/console-test.js</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestshttptestsinspectorresourcesprotocoltestjs">releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/inspector/resources/protocol-test.js</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsinspectorconsoleconsolemessagehtml">releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/console/console-message.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsinspectorconsolexframeoptionsmessagehtml">releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/console/x-frame-options-message.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsinspectordebuggerdidSampleProbemultipleprobeshtml">releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/debugger/didSampleProbe-multiple-probes.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsinspectordomdomremoveeventshtml">releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/dom/dom-remove-events.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsinspectordomdebuggernoderemovedhtml">releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/dom-debugger/node-removed.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsinspectorruntimegetPropertieshtml">releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/runtime/getProperties.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsinspectorunittestsasynctestsuiteexpectedtxt">releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/unit-tests/async-test-suite-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsinspectorunittestsasynctestsuitehtml">releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/unit-tests/async-test-suite.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsinspectorunittestssynctestsuiteexpectedtxt">releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/unit-tests/sync-test-suite-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsinspectorunittestssynctestsuitehtml">releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/unit-tests/sync-test-suite.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit210LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog (188451 => 188452)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog        2015-08-14 10:36:28 UTC (rev 188451)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog        2015-08-14 10:38:42 UTC (rev 188452)
</span><span class="lines">@@ -1,3 +1,88 @@
</span><ins>+2015-08-13  Brian Burg  &lt;bburg@apple.com&gt;
+
+        Web Inspector: refactor ProtocolTest to be an InjectedTestHarness subclass
+        https://bugs.webkit.org/show_bug.cgi?id=147954
+
+        Reviewed by Joseph Pecoraro.
+
+        In preparation for sharing the same test harness API between protocol tests
+        and frontend tests, this patch refactors ProtocolTest into the desired
+        class structure. Each type of test (currently: protocol, frontend) extends
+        InjectedTestHarness and fills in a few key methods for communicating with
+        the test page-side code.
+
+        This patch standardizes on assert() only logging when the condition is false.
+        Update protocol tests to use ProtocolTestHarness.expectThat, rather than assert.
+
+        * http/tests/inspector/resources/ProtocolTestStub.js:
+        (window.InjectedTestHarness):
+        (window.InjectedTestHarness.prototype.createAsyncSuite):
+        (window.InjectedTestHarness.prototype.createSyncSuite):
+        (window.InjectedTestHarness.prototype.completeTest):
+        (window.InjectedTestHarness.prototype.addResult):
+        (window.InjectedTestHarness.prototype.debugLog):
+        (window.InjectedTestHarness.prototype.evaluateInPage):
+        (window.InjectedTestHarness.prototype.importScript):
+        (window.InjectedTestHarness.prototype.get logCount):
+        (window.InjectedTestHarness.prototype.log):
+        (window.InjectedTestHarness.prototype.assert):
+        (window.InjectedTestHarness.prototype.expectThat):

+        (InjectedTestHarness.AsyncTestSuite): Use a stored reference to the harness
+        rather than hardcoding a specific InjectedTestHarness instance.
+
+        (InjectedTestHarness.AsyncTestSuite.prototype.runTestCasesAndFinish.finish):
+        (InjectedTestHarness.AsyncTestSuite.prototype.runTestCasesAndFinish):
+        (InjectedTestHarness.AsyncTestSuite.prototype.runTestCases):

+        (InjectedTestHarness.SyncTestSuite): Use a stored reference to the harness
+        rather than hardcoding a specific InjectedTestHarness instance.
+
+        (InjectedTestHarness.SyncTestSuite.prototype.runTestCasesAndFinish):
+        (InjectedTestHarness.SyncTestSuite.prototype.runTestCases):
+
+        (ProtocolTestHarness.prototype.completeTest):
+        (ProtocolTestHarness.prototype.addResult):
+        (ProtocolTestHarness.prototype.debugLog):
+        (ProtocolTestHarness.prototype.evaluateInPage):
+        (ProtocolTestHarness):
+        (InspectorProtocol.sendCommand):
+        (InspectorProtocol.awaitCommand):
+        (InspectorProtocol.awaitEvent.):
+        (InspectorProtocol.awaitEvent):
+        (InspectorProtocol.addEventListener):
+        (InspectorProtocol.sendMessage):
+        (InspectorProtocol.checkForError):
+        (InspectorFrontendAPI.dispatchMessageAsync):
+        (ProtocolTest.AsyncTestSuite): Moved.
+        (ProtocolTest.AsyncTestSuite.prototype.runTestCasesAndFinish.finish): Moved.
+        (ProtocolTest.AsyncTestSuite.prototype.runTestCasesAndFinish): Moved.
+        (ProtocolTest.AsyncTestSuite.prototype.runTestCases): Moved.
+        (ProtocolTest.SyncTestSuite): Moved.
+        (ProtocolTest.SyncTestSuite.prototype.runTestCasesAndFinish): Moved.
+        (ProtocolTest.SyncTestSuite.prototype.runTestCases): Moved.
+        (ProtocolTest.log): Moved.
+        (ProtocolTest.assert): Moved.
+        (ProtocolTest.debugLog): Moved.
+        (ProtocolTest.completeTest): Moved.
+        (ProtocolTest.importScript): Moved.
+        * http/tests/inspector/resources/console-test.js:
+        (.suite.addTestCase.):
+        (.suite.addTestCase):
+        (ProtocolTest.Console.addTestCase):
+        * http/tests/inspector/resources/protocol-test.js:
+        (closeTest):
+        * inspector/console/console-message.html:
+        * inspector/console/x-frame-options-message.html:
+        * inspector/debugger/didSampleProbe-multiple-probes.html:
+        * inspector/dom-debugger/node-removed.html:
+        * inspector/dom/dom-remove-events.html:
+        * inspector/runtime/getProperties.html:
+        * inspector/unit-tests/async-test-suite-expected.txt:
+        * inspector/unit-tests/async-test-suite.html:
+        * inspector/unit-tests/sync-test-suite-expected.txt:
+        * inspector/unit-tests/sync-test-suite.html:
+
</ins><span class="cx"> 2015-08-13  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: A {Map, WeakMap, Set, WeakSet} object contains itself will hang the console
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestshttptestsinspectorresourcesProtocolTestStubjs"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/inspector/resources/ProtocolTestStub.js (188451 => 188452)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/inspector/resources/ProtocolTestStub.js        2015-08-14 10:36:28 UTC (rev 188451)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/inspector/resources/ProtocolTestStub.js        2015-08-14 10:38:42 UTC (rev 188452)
</span><span class="lines">@@ -25,160 +25,105 @@
</span><span class="cx">  */
</span><span class="cx"> InspectorFrontendAPI = {};
</span><span class="cx"> 
</span><del>-InspectorProtocol = {};
-InspectorProtocol._dispatchTable = [];
-InspectorProtocol._requestId = -1;
-InspectorProtocol.eventHandler = {};
-
-ProtocolTest = {};
-ProtocolTest.logCount = 0;
-
-ProtocolTest.forceSyncDebugLogging = false;
-InspectorProtocol.dumpInspectorProtocolMessages = false;
-
-InspectorProtocol.sendCommand = function(methodOrObject, params, handler)
</del><ins>+InjectedTestHarness = class InjectedTestHarness
</ins><span class="cx"> {
</span><del>-    // Allow new-style arguments object, as in awaitCommand.
-    var method = methodOrObject;
-    if (typeof methodOrObject === &quot;object&quot;)
-        var {method, params, handler} = methodOrObject;
</del><ins>+    constructor()
+    {
+        this._logCount = 0;
+        this.forceSyncDebugLogging = false;
+    }
</ins><span class="cx"> 
</span><del>-    this._dispatchTable[++this._requestId] = handler;
-    var messageObject = {method, params, &quot;id&quot;: this._requestId};
-    this.sendMessage(messageObject);
</del><ins>+    completeTest()
+    {
+        throw new Error(&quot;Must be implemented by subclasses.&quot;);
+    }
</ins><span class="cx"> 
</span><del>-    return this._requestId;
-}
</del><ins>+    addResult()
+    {
+        throw new Error(&quot;Must be implemented by subclasses.&quot;);
+    }
</ins><span class="cx"> 
</span><del>-InspectorProtocol.awaitCommand = function(args)
-{
-    var {method, params} = args;
-    return new Promise(function(resolve, reject) {
-        this._dispatchTable[++this._requestId] = {resolve, reject};
-        var messageObject = {method, params, &quot;id&quot;: this._requestId};
-        this.sendMessage(messageObject);
-    }.bind(this));
-}
</del><ins>+    debugLog()
+    {
+        throw new Error(&quot;Must be implemented by subclasses.&quot;);
+    }
</ins><span class="cx"> 
</span><del>-InspectorProtocol.awaitEvent = function(args)
-{
-    var {event} = args;
-    if (typeof event !== &quot;string&quot;)
-        throw new Error(&quot;Event must be a string.&quot;);
</del><ins>+    evaluateInPage(string, callback)
+    {
+        throw new Error(&quot;Must be implemented by subclasses.&quot;);
+    }
</ins><span class="cx"> 
</span><del>-    return new Promise(function(resolve, reject) {
-        InspectorProtocol.eventHandler[event] = function(message) {
-            InspectorProtocol.eventHandler[event] = undefined;
-            resolve(message);
-        }
-    });
-}
</del><ins>+    createAsyncSuite(name)
+    {
+        return new InjectedTestHarness.AsyncTestSuite(this, name);
+    }
</ins><span class="cx"> 
</span><del>-InspectorProtocol.addEventListener = function(eventTypeOrObject, listener)
-{
-    var event = eventTypeOrObject;
-    if (typeof eventTypeOrObject === &quot;object&quot;)
-        var {event, listener} = eventTypeOrObject;
</del><ins>+    createSyncSuite(name)
+    {
+        return new InjectedTestHarness.SyncTestSuite(this, name);
+    }
</ins><span class="cx"> 
</span><del>-    if (typeof event !== &quot;string&quot;)
-        throw new Error(&quot;Event name must be a string.&quot;);
</del><ins>+    importScript(scriptName)
+    {
+        var xhr = new XMLHttpRequest();
+        var isAsyncRequest = false;
+        xhr.open(&quot;GET&quot;, scriptName, isAsyncRequest);
+        xhr.send(null);
+        if (xhr.status !== 0 &amp;&amp; xhr.status !== 200)
+            throw new Error(&quot;Invalid script URL: &quot; + scriptName);
+        var script = `// From InjectedTestHarness.importScript(${scriptName})
+try {
+    ${xhr.responseText}
+} catch (e) {
+    alert(${JSON.stringify(&quot;Error in: &quot; + scriptName)});
+    throw e;
+}`;
+        window.eval(script);
+    }
</ins><span class="cx"> 
</span><del>-    if (typeof listener !== &quot;function&quot;)
-        throw new Error(&quot;Event listener must be callable.&quot;);
</del><ins>+    get logCount()
+    {
+        return this._logCount;
+    }
</ins><span class="cx"> 
</span><del>-    // Convert to an array of listeners.
-    var listeners = InspectorProtocol.eventHandler[event];
-    if (!listeners)
-        listeners = InspectorProtocol.eventHandler[event] = [];
-    else if (typeof listeners === &quot;function&quot;)
-        listeners = InspectorProtocol.eventHandler[event] = [listeners];
</del><ins>+    log(message)
+    {
+        ++this._logCount;
</ins><span class="cx"> 
</span><del>-    // Prevent registering multiple times.
-    if (listeners.includes(listener))
-        throw new Error(&quot;Cannot register the same listener more than once.&quot;);
-
-    listeners.push(listener);
-}
-
-InspectorProtocol.sendMessage = function(messageObject)
-{
-    // This matches the debug dumping in InspectorBackend, which is bypassed
-    // by InspectorProtocol. Return messages should be dumped by InspectorBackend.
-    if (this.dumpInspectorProtocolMessages)
-        console.log(&quot;frontend: &quot; + JSON.stringify(messageObject));
-
-    InspectorFrontendHost.sendMessageToBackend(JSON.stringify(messageObject));
-}
-
-InspectorProtocol.checkForError = function(responseObject)
-{
-    if (responseObject.error) {
-        ProtocolTest.log(&quot;PROTOCOL ERROR: &quot; + JSON.stringify(responseObject.error));
-        ProtocolTest.completeTest();
-        throw &quot;PROTOCOL ERROR&quot;;
</del><ins>+        if (this.forceSyncDebugLogging)
+            this.debugLog(message);
+        else
+            this.addResult(message);
</ins><span class="cx">     }
</span><del>-}
</del><span class="cx"> 
</span><del>-InspectorFrontendAPI.dispatchMessageAsync = function(messageObject)
-{
-    // If the message has an id, then it is a reply to a command.
-    var messageId = messageObject[&quot;id&quot;];
-    if (typeof messageId === &quot;number&quot;) {
-        var handler = InspectorProtocol._dispatchTable[messageId];
-        if (!handler)
</del><ins>+    assert(condition, message)
+    {
+        if (condition)
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        if (typeof handler === &quot;function&quot;)
-            handler(messageObject);
-        else if (typeof handler === &quot;object&quot;) {
-            var {resolve, reject} = handler;
-            if (&quot;error&quot; in messageObject)
-                reject(messageObject.error.message);
-            else
-                resolve(messageObject.result);
-        }
-    // Otherwise, it is an event.
-    } else {
-        var eventName = messageObject[&quot;method&quot;];
-        var handler = InspectorProtocol.eventHandler[eventName];
-        if (!handler)
-            return;
</del><ins>+        let stringifiedMessage = typeof message !== &quot;object&quot; ? message : JSON.stringify(message);
+        this.addResult(&quot;ASSERT: &quot; + stringifiedMessage);
+    }
</ins><span class="cx"> 
</span><del>-        if (typeof handler === &quot;function&quot;)
-            handler(messageObject);
-        else if (handler instanceof Array) {
-            handler.map(function(listener) {
-                listener.call(null, messageObject);
-            });
-        } else if (typeof handler === &quot;object&quot;) {
-            var {resolve, reject} = handler;
-            if (&quot;error&quot; in messageObject)
-                reject(messageObject.error.message);
-            else
-                resolve(messageObject.result);
-        }
</del><ins>+    expectThat(condition, message)
+    {
+        let prefix = condition ? &quot;PASS&quot; : &quot;FAIL&quot;;
+        let stringifiedMessage = typeof message !== &quot;object&quot; ? message : JSON.stringify(message);
+        this.addResult(prefix + &quot;: &quot; + stringifiedMessage);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-window.addEventListener(&quot;message&quot;, function(event) {
-    try {
-        eval(event.data);
-    } catch (e) {
-        alert(e.stack);
-        ProtocolTest.completeTest();
-        throw e;
-    }
-});
</del><ins>+InjectedTestHarness.AsyncTestSuite = class AsyncTestSuite
+{
+    constructor(harness, name) {
+        if (!(harness instanceof InjectedTestHarness))
+            throw new Error(&quot;Must pass the test's harness as the first argument.&quot;);
</ins><span class="cx"> 
</span><del>-// FIXME: Everything below here should be extracted to a file containing shared test utilities
-// between the two harnesses.
-
-ProtocolTest.AsyncTestSuite = class AsyncTestSuite {
-    constructor(name) {
</del><span class="cx">         if (!name || typeof name !== &quot;string&quot;)
</span><span class="cx">             throw new Error(&quot;Tried to create AsyncTestSuite without string suite name.&quot;);
</span><span class="cx"> 
</span><span class="cx">         this.name = name;
</span><ins>+        this._harness = harness;
</ins><span class="cx"> 
</span><span class="cx">         this.testcases = [];
</span><span class="cx">         this.runCount = 0;
</span><span class="lines">@@ -217,12 +162,12 @@
</span><span class="cx">     runTestCasesAndFinish()
</span><span class="cx">     {
</span><span class="cx">         function finish() {
</span><del>-            ProtocolTest.completeTest();
</del><ins>+            this._harness.completeTest();
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         this.runTestCases()
</span><del>-            .then(finish)
-            .catch(finish);
</del><ins>+            .then(finish.bind(this))
+            .catch(finish.bind(this));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     runTestCases()
</span><span class="lines">@@ -234,19 +179,19 @@
</span><span class="cx"> 
</span><span class="cx">         this._startedRunning = true;
</span><span class="cx"> 
</span><del>-        ProtocolTest.log(&quot;&quot;);
-        ProtocolTest.log(&quot;== Running test suite: &quot; + this.name);
</del><ins>+        this._harness.log(&quot;&quot;);
+        this._harness.log(&quot;== Running test suite: &quot; + this.name);
</ins><span class="cx"> 
</span><span class="cx">         // Avoid adding newlines if nothing was logged.
</span><del>-        var priorLogCount = ProtocolTest.logCount;
</del><ins>+        var priorLogCount = this._harness.logCount;
</ins><span class="cx">         var suite = this;
</span><span class="cx">         var result = this.testcases.reduce(function(chain, testcase, i) {
</span><span class="cx">             return chain.then(function() {
</span><del>-                if (i &gt; 0 &amp;&amp; priorLogCount + 1 &lt; ProtocolTest.logCount)
-                    ProtocolTest.log(&quot;&quot;);
</del><ins>+                if (i &gt; 0 &amp;&amp; priorLogCount + 1 &lt; suite._harness.logCount)
+                    suite._harness.log(&quot;&quot;);
</ins><span class="cx"> 
</span><del>-                priorLogCount = ProtocolTest.logCount;
-                ProtocolTest.log(&quot;-- Running test case: &quot; + testcase.name);
</del><ins>+                priorLogCount = suite._harness.logCount;
+                suite._harness.log(&quot;-- Running test case: &quot; + testcase.name);
</ins><span class="cx">                 suite.runCount++;
</span><span class="cx">                 return new Promise(testcase.test);
</span><span class="cx">             });
</span><span class="lines">@@ -261,18 +206,23 @@
</span><span class="cx">             if (typeof message !== &quot;string&quot;)
</span><span class="cx">                 message = JSON.stringify(message);
</span><span class="cx"> 
</span><del>-            ProtocolTest.log(&quot;!! EXCEPTION: &quot; + message);
</del><ins>+            suite._harness.log(&quot;!! EXCEPTION: &quot; + message);
</ins><span class="cx">             throw e; // Reject this promise by re-throwing the error.
</span><span class="cx">         });
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ProtocolTest.SyncTestSuite = class SyncTestSuite {
-    constructor(name) {
</del><ins>+InjectedTestHarness.SyncTestSuite = class SyncTestSuite
+{
+    constructor(harness, name) {
+        if (!(harness instanceof InjectedTestHarness))
+            throw new Error(&quot;Must pass the test's harness as the first argument.&quot;);
+
</ins><span class="cx">         if (!name || typeof name !== &quot;string&quot;)
</span><span class="cx">             throw new Error(&quot;Tried to create SyncTestSuite without string suite name.&quot;);
</span><span class="cx"> 
</span><span class="cx">         this.name = name;
</span><ins>+        this._harness = harness;
</ins><span class="cx"> 
</span><span class="cx">         this.testcases = [];
</span><span class="cx">         this.runCount = 0;
</span><span class="lines">@@ -310,7 +260,7 @@
</span><span class="cx">     runTestCasesAndFinish()
</span><span class="cx">     {
</span><span class="cx">         this.runTestCases();
</span><del>-        ProtocolTest.completeTest();
</del><ins>+        this._harness.completeTest();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     runTestCases()
</span><span class="lines">@@ -322,19 +272,19 @@
</span><span class="cx"> 
</span><span class="cx">         this._startedRunning = true;
</span><span class="cx"> 
</span><del>-        ProtocolTest.log(&quot;&quot;);
-        ProtocolTest.log(&quot;== Running test suite: &quot; + this.name);
</del><ins>+        this._harness.log(&quot;&quot;);
+        this._harness.log(&quot;== Running test suite: &quot; + this.name);
</ins><span class="cx"> 
</span><del>-        var priorLogCount = ProtocolTest.logCount;
</del><ins>+        var priorLogCount = this._harness.logCount;
</ins><span class="cx">         var suite = this;
</span><span class="cx">         for (var i = 0; i &lt; this.testcases.length; i++) {
</span><span class="cx">             var testcase = this.testcases[i];
</span><del>-            if (i &gt; 0 &amp;&amp; priorLogCount + 1 &lt; ProtocolTest.logCount)
-                ProtocolTest.log(&quot;&quot;);
</del><ins>+            if (i &gt; 0 &amp;&amp; priorLogCount + 1 &lt; this._harness.logCount)
+                this._harness.log(&quot;&quot;);
</ins><span class="cx"> 
</span><del>-            priorLogCount = ProtocolTest.logCount;
</del><ins>+            priorLogCount = this._harness.logCount;
</ins><span class="cx"> 
</span><del>-            ProtocolTest.log(&quot;-- Running test case: &quot; + testcase.name);
</del><ins>+            this._harness.log(&quot;-- Running test case: &quot; + testcase.name);
</ins><span class="cx">             suite.runCount++;
</span><span class="cx">             try {
</span><span class="cx">                 var result = testcase.test.call(null);
</span><span class="lines">@@ -353,7 +303,7 @@
</span><span class="cx">                 if (typeof message !== &quot;string&quot;)
</span><span class="cx">                     message = JSON.stringify(message);
</span><span class="cx"> 
</span><del>-                ProtocolTest.log(&quot;!! EXCEPTION: &quot; + message);
</del><ins>+                this._harness.log(&quot;!! EXCEPTION: &quot; + message);
</ins><span class="cx">                 return false;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -362,46 +312,187 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// Logs a message to test document.
-ProtocolTest.log = function(message)
</del><ins>+class ProtocolTestHarness extends InjectedTestHarness
</ins><span class="cx"> {
</span><del>-    ++ProtocolTest.logCount;
</del><ins>+    // InjectedTestHarness Overrides
</ins><span class="cx"> 
</span><del>-    if (this.forceSyncDebugLogging)
-        this.debugLog(message);
-    else
-        InspectorProtocol.sendCommand(&quot;Runtime.evaluate&quot;, { &quot;expression&quot;: &quot;log(&quot; + JSON.stringify(message) + &quot;)&quot; } );
</del><ins>+    completeTest()
+    {
+        this.evaluateInPage(&quot;closeTest();&quot;);
+    }
+
+    addResult(message)
+    {
+        // Unfortunately, every string argument must be escaped because tests are not consistent
+        // with respect to escaping with single or double quotes. Some exceptions use single quotes.
+        var stringifiedMessage = typeof message !== &quot;string&quot; ? JSON.stringify(message) : message;
+        this.evaluateInPage(&quot;log(unescape('&quot; + escape(stringifiedMessage) + &quot;'));&quot;);
+    }
+
+    debugLog(message)
+    {
+        var stringifiedMessage = typeof message !== &quot;string&quot; ? JSON.stringify(message) : message;
+        this.evaluateInPage(&quot;debugLog(unescape('&quot; + escape(stringifiedMessage) + &quot;'));&quot;)
+    }
+
+    evaluateInPage(expression, callback)
+    {
+        let args = {
+            method: &quot;Runtime.evaluate&quot;,
+            params: {expression}
+        }
+
+        if (typeof callback === &quot;function&quot;)
+            InspectorProtocol.sendCommand(args, callback);
+        else
+            return InspectorProtocol.awaitCommand(args);
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-// Logs an assertion result to the test document.
-ProtocolTest.assert = function(condition, message)
</del><ins>+window.ProtocolTest = new ProtocolTestHarness();
+
+InspectorProtocol = {};
+InspectorProtocol._dispatchTable = [];
+InspectorProtocol._requestId = -1;
+InspectorProtocol.eventHandler = {};
+
+InspectorProtocol.dumpInspectorProtocolMessages = false;
+
+InspectorProtocol.sendCommand = function(methodOrObject, params, handler)
</ins><span class="cx"> {
</span><del>-    var status = condition ? &quot;PASS&quot; : &quot;FAIL&quot;;
-    var message = typeof message !== &quot;string&quot; ? JSON.stringify(message) : message;
-    var formattedMessage = status + &quot;: &quot; + message;
-    this.log(formattedMessage);
</del><ins>+    // Allow new-style arguments object, as in awaitCommand.
+    var method = methodOrObject;
+    if (typeof methodOrObject === &quot;object&quot;)
+        var {method, params, handler} = methodOrObject;
+
+    this._dispatchTable[++this._requestId] = handler;
+    var messageObject = {method, params, &quot;id&quot;: this._requestId};
+    this.sendMessage(messageObject);
+
+    return this._requestId;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-// Logs message a directly to stdout of the test process via alert function.
-// This message should survive process crash or kill by timeout.
-ProtocolTest.debugLog = function(message)
</del><ins>+InspectorProtocol.awaitCommand = function(args)
</ins><span class="cx"> {
</span><del>-    InspectorProtocol.sendCommand(&quot;Runtime.evaluate&quot;, { &quot;expression&quot;: &quot;debugLog(&quot; + JSON.stringify(message) + &quot;)&quot; } );
</del><ins>+    var {method, params} = args;
+    return new Promise(function(resolve, reject) {
+        this._dispatchTable[++this._requestId] = {resolve, reject};
+        var messageObject = {method, params, &quot;id&quot;: this._requestId};
+        this.sendMessage(messageObject);
+    }.bind(this));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-ProtocolTest.completeTest = function()
</del><ins>+InspectorProtocol.awaitEvent = function(args)
</ins><span class="cx"> {
</span><del>-    InspectorProtocol.sendCommand(&quot;Runtime.evaluate&quot;, { &quot;expression&quot;: &quot;closeTest();&quot;} );
</del><ins>+    var {event} = args;
+    if (typeof event !== &quot;string&quot;)
+        throw new Error(&quot;Event must be a string.&quot;);
+
+    return new Promise(function(resolve, reject) {
+        InspectorProtocol.eventHandler[event] = function(message) {
+            InspectorProtocol.eventHandler[event] = undefined;
+            resolve(message);
+        }
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-ProtocolTest.importScript = function(scriptName)
</del><ins>+InspectorProtocol.addEventListener = function(eventTypeOrObject, listener)
</ins><span class="cx"> {
</span><del>-    var xhr = new XMLHttpRequest();
-    var isAsyncRequest = false;
-    xhr.open(&quot;GET&quot;, scriptName, isAsyncRequest);
-    xhr.send(null);
-    if (xhr.status !== 0 &amp;&amp; xhr.status !== 200)
-        throw new Error(&quot;Invalid script URL: &quot; + scriptName);
-    var script = &quot;try { &quot; + xhr.responseText + &quot;} catch (e) { alert(&quot; + JSON.stringify(&quot;Error in: &quot; + scriptName) + &quot;); throw e; }&quot;;
-    window.eval(script);
</del><ins>+    var event = eventTypeOrObject;
+    if (typeof eventTypeOrObject === &quot;object&quot;)
+        var {event, listener} = eventTypeOrObject;
+
+    if (typeof event !== &quot;string&quot;)
+        throw new Error(&quot;Event name must be a string.&quot;);
+
+    if (typeof listener !== &quot;function&quot;)
+        throw new Error(&quot;Event listener must be callable.&quot;);
+
+    // Convert to an array of listeners.
+    var listeners = InspectorProtocol.eventHandler[event];
+    if (!listeners)
+        listeners = InspectorProtocol.eventHandler[event] = [];
+    else if (typeof listeners === &quot;function&quot;)
+        listeners = InspectorProtocol.eventHandler[event] = [listeners];
+
+    // Prevent registering multiple times.
+    if (listeners.includes(listener))
+        throw new Error(&quot;Cannot register the same listener more than once.&quot;);
+
+    listeners.push(listener);
</ins><span class="cx"> }
</span><ins>+
+InspectorProtocol.sendMessage = function(messageObject)
+{
+    // This matches the debug dumping in InspectorBackend, which is bypassed
+    // by InspectorProtocol. Return messages should be dumped by InspectorBackend.
+    if (InspectorProtocol.dumpInspectorProtocolMessages)
+        console.log(&quot;frontend: &quot; + JSON.stringify(messageObject));
+
+    InspectorFrontendHost.sendMessageToBackend(JSON.stringify(messageObject));
+}
+
+InspectorProtocol.checkForError = function(responseObject)
+{
+    if (responseObject.error) {
+        ProtocolTest.log(&quot;PROTOCOL ERROR: &quot; + JSON.stringify(responseObject.error));
+        ProtocolTest.completeTest();
+        throw &quot;PROTOCOL ERROR&quot;;
+    }
+}
+
+InspectorFrontendAPI.dispatchMessageAsync = function(messageObject)
+{
+    // This matches the debug dumping in InspectorBackend, which is bypassed
+    // by InspectorProtocol. Return messages should be dumped by InspectorBackend.
+    if (InspectorProtocol.dumpInspectorProtocolMessages)
+        console.log(&quot;backend: &quot; + JSON.stringify(messageObject));
+
+    // If the message has an id, then it is a reply to a command.
+    var messageId = messageObject[&quot;id&quot;];
+    if (typeof messageId === &quot;number&quot;) {
+        var handler = InspectorProtocol._dispatchTable[messageId];
+        if (!handler)
+            return;
+
+        if (typeof handler === &quot;function&quot;)
+            handler(messageObject);
+        else if (typeof handler === &quot;object&quot;) {
+            var {resolve, reject} = handler;
+            if (&quot;error&quot; in messageObject)
+                reject(messageObject.error.message);
+            else
+                resolve(messageObject.result);
+        }
+    // Otherwise, it is an event.
+    } else {
+        var eventName = messageObject[&quot;method&quot;];
+        var handler = InspectorProtocol.eventHandler[eventName];
+        if (!handler)
+            return;
+
+        if (typeof handler === &quot;function&quot;)
+            handler(messageObject);
+        else if (handler instanceof Array) {
+            handler.map(function(listener) {
+                listener.call(null, messageObject);
+            });
+        } else if (typeof handler === &quot;object&quot;) {
+            var {resolve, reject} = handler;
+            if (&quot;error&quot; in messageObject)
+                reject(messageObject.error.message);
+            else
+                resolve(messageObject.result);
+        }
+    }
+}
+
+window.addEventListener(&quot;message&quot;, function(event) {
+    try {
+        eval(event.data);
+    } catch (e) {
+        alert(e.stack);
+        ProtocolTest.completeTest();
+        throw e;
+    }
+});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestshttptestsinspectorresourcesconsoletestjs"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/inspector/resources/console-test.js (188451 => 188452)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/inspector/resources/console-test.js        2015-08-14 10:36:28 UTC (rev 188451)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/inspector/resources/console-test.js        2015-08-14 10:38:42 UTC (rev 188452)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> 
</span><span class="cx"> ProtocolTest.Console.addTestCase = function(suite, args)
</span><span class="cx"> {
</span><del>-    if (!(suite instanceof ProtocolTest.AsyncTestSuite))
</del><ins>+    if (!(suite instanceof InjectedTestHarness.AsyncTestSuite))
</ins><span class="cx">         throw new Error(&quot;Console test cases must be added to an async test suite.&quot;);
</span><span class="cx"> 
</span><span class="cx">     var {name, description, expression, expected} = args;
</span><span class="lines">@@ -46,17 +46,17 @@
</span><span class="cx">             .then(function(messageObject) {
</span><span class="cx">                 var consoleMessage = messageObject.params.message;
</span><span class="cx">                 var {source, level, text, parameters} = consoleMessage;
</span><del>-                ProtocolTest.assert(source === expected.source, &quot;ConsoleMessage type should be '&quot; + expected.source + &quot;'.&quot;);
-                ProtocolTest.assert(level === expected.level, &quot;ConsoleMessage level should be '&quot; + expected.level + &quot;'.&quot;);
</del><ins>+                ProtocolTest.expectThat(source === expected.source, &quot;ConsoleMessage type should be '&quot; + expected.source + &quot;'.&quot;);
+                ProtocolTest.expectThat(level === expected.level, &quot;ConsoleMessage level should be '&quot; + expected.level + &quot;'.&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 if (expected.text)
</span><del>-                    ProtocolTest.assert(text === expected.text, &quot;ConsoleMessage text should be '&quot; + expected.text + &quot;'.&quot;);
</del><ins>+                    ProtocolTest.expectThat(text === expected.text, &quot;ConsoleMessage text should be '&quot; + expected.text + &quot;'.&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 if (expected.parameters) {
</span><del>-                    ProtocolTest.assert(parameters.length === expected.parameters.length, &quot;ConsoleMessage parameters.length === &quot; + expected.parameters.length);
</del><ins>+                    ProtocolTest.expectThat(parameters.length === expected.parameters.length, &quot;ConsoleMessage parameters.length === &quot; + expected.parameters.length);
</ins><span class="cx">                     for (var i = 0; i &lt; parameters.length; ++i) {
</span><span class="cx">                         var expectedType = expected.parameters[i];
</span><del>-                        ProtocolTest.assert(parameters[i].type === expectedType, &quot;ConsoleMessage parameter &quot; + i + &quot; should have type '&quot; + expectedType + &quot;'.&quot;);
</del><ins>+                        ProtocolTest.expectThat(parameters[i].type === expectedType, &quot;ConsoleMessage parameter &quot; + i + &quot; should have type '&quot; + expectedType + &quot;'.&quot;);
</ins><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestshttptestsinspectorresourcesprotocoltestjs"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/inspector/resources/protocol-test.js (188451 => 188452)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/inspector/resources/protocol-test.js        2015-08-14 10:36:28 UTC (rev 188451)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/inspector/resources/protocol-test.js        2015-08-14 10:38:42 UTC (rev 188452)
</span><span class="lines">@@ -59,6 +59,7 @@
</span><span class="cx"> function closeTest()
</span><span class="cx"> {
</span><span class="cx">     window.internals.closeDummyInspectorFrontend();
</span><ins>+
</ins><span class="cx">     // This code might be executed while the debugger is still running through a stack based EventLoop.
</span><span class="cx">     // Use a setTimeout to defer to a clean stack before letting the testRunner load the next test.
</span><span class="cx">     setTimeout(function() {
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsinspectorconsoleconsolemessagehtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/console/console-message.html (188451 => 188452)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/console/console-message.html        2015-08-14 10:36:28 UTC (rev 188451)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/console/console-message.html        2015-08-14 10:38:42 UTC (rev 188452)
</span><span class="lines">@@ -16,7 +16,7 @@
</span><span class="cx"> {
</span><span class="cx">     ProtocolTest.importScript(&quot;console-test.js&quot;);
</span><span class="cx"> 
</span><del>-    var suite = new ProtocolTest.AsyncTestSuite(&quot;Console.MessagesFromCommandLineAPI&quot;);
</del><ins>+    var suite = ProtocolTest.createAsyncSuite(&quot;Console.MessagesFromCommandLineAPI&quot;);
</ins><span class="cx"> 
</span><span class="cx">     ProtocolTest.Console.addTestCase(suite, {
</span><span class="cx">         name: &quot;ConsoleLogString&quot;,
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsinspectorconsolexframeoptionsmessagehtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/console/x-frame-options-message.html (188451 => 188452)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/console/x-frame-options-message.html        2015-08-14 10:36:28 UTC (rev 188451)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/console/x-frame-options-message.html        2015-08-14 10:38:42 UTC (rev 188452)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx"> {
</span><span class="cx">     ProtocolTest.importScript(&quot;console-test.js&quot;);
</span><span class="cx"> 
</span><del>-    let suite = new ProtocolTest.AsyncTestSuite(&quot;Console.XFrameOptionsMessages&quot;);
</del><ins>+    let suite = ProtocolTest.createAsyncSuite(&quot;Console.XFrameOptionsMessages&quot;);
</ins><span class="cx"> 
</span><span class="cx">     ProtocolTest.Console.addTestCase(suite, {
</span><span class="cx">         name: &quot;XFrameOptionsDeny&quot;,
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsinspectordebuggerdidSampleProbemultipleprobeshtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/debugger/didSampleProbe-multiple-probes.html (188451 => 188452)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/debugger/didSampleProbe-multiple-probes.html        2015-08-14 10:36:28 UTC (rev 188451)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/debugger/didSampleProbe-multiple-probes.html        2015-08-14 10:38:42 UTC (rev 188452)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx">         if (receivedAllExpectedSamples()) {
</span><span class="cx">             tests.forEach(function(test) {
</span><span class="cx">                 var result = test.predicate();
</span><del>-                ProtocolTest.assert(result, test.message);
</del><ins>+                ProtocolTest.expectThat(result, test.message);
</ins><span class="cx">                 if (!result)
</span><span class="cx">                     test.error();
</span><span class="cx">             });
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsinspectordomdomremoveeventshtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/dom/dom-remove-events.html (188451 => 188452)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/dom/dom-remove-events.html        2015-08-14 10:36:28 UTC (rev 188451)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/dom/dom-remove-events.html        2015-08-14 10:38:42 UTC (rev 188452)
</span><span class="lines">@@ -47,15 +47,15 @@
</span><span class="cx">     function onChildNodeRemoved(response)
</span><span class="cx">     {
</span><span class="cx">         var nodeId = response.params.nodeId;
</span><del>-        ProtocolTest.assert(getNodeIdentifier(nodeId) === &quot;target_element&quot;, &quot;onChildNodeRemoved called for #target_element&quot;);
</del><ins>+        ProtocolTest.expectThat(getNodeIdentifier(nodeId) === &quot;target_element&quot;, &quot;onChildNodeRemoved called for #target_element&quot;);
</ins><span class="cx">         delete nodesById[nodeId];
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function onChildNodeInserted(response)
</span><span class="cx">     {
</span><span class="cx">         collectNode(response.params.node);
</span><del>-        ProtocolTest.assert(getNodeIdentifier(response.params.parentNodeId) === &quot;final_container&quot;, &quot;onChildNodeInserted called for parent node #final_container&quot;);
-        ProtocolTest.assert(getNodeIdentifier(response.params.node.nodeId) === &quot;target_element&quot;, &quot;onChildNodeInserted called for child node #target_element&quot;);
</del><ins>+        ProtocolTest.expectThat(getNodeIdentifier(response.params.parentNodeId) === &quot;final_container&quot;, &quot;onChildNodeInserted called for parent node #final_container&quot;);
+        ProtocolTest.expectThat(getNodeIdentifier(response.params.node.nodeId) === &quot;target_element&quot;, &quot;onChildNodeInserted called for child node #target_element&quot;);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     InspectorProtocol.sendCommand(&quot;DOM.getDocument&quot;, {}, onGotDocument);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsinspectordomdebuggernoderemovedhtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/dom-debugger/node-removed.html (188451 => 188452)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/dom-debugger/node-removed.html        2015-08-14 10:36:28 UTC (rev 188451)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/dom-debugger/node-removed.html        2015-08-14 10:38:42 UTC (rev 188452)
</span><span class="lines">@@ -70,15 +70,15 @@
</span><span class="cx">     function onChildNodeRemoved(response)
</span><span class="cx">     {
</span><span class="cx">         var nodeId = response.params.nodeId;
</span><del>-        ProtocolTest.assert(getNodeIdentifier(nodeId) === &quot;div#target_element&quot;, &quot;onChildNodeRemoved called for #target_element&quot;);
</del><ins>+        ProtocolTest.expectThat(getNodeIdentifier(nodeId) === &quot;div#target_element&quot;, &quot;onChildNodeRemoved called for #target_element&quot;);
</ins><span class="cx">         delete nodesById[nodeId];
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function onChildNodeInserted(response)
</span><span class="cx">     {
</span><span class="cx">         collectNode(response.params.node);
</span><del>-        ProtocolTest.assert(getNodeIdentifier(response.params.parentNodeId) === &quot;div#final_container&quot;, &quot;onChildNodeInserted called for parent node #final_container&quot;);
-        ProtocolTest.assert(getNodeIdentifier(response.params.node.nodeId) === &quot;div#target_element&quot;, &quot;onChildNodeInserted called for child node #target_element&quot;);
</del><ins>+        ProtocolTest.expectThat(getNodeIdentifier(response.params.parentNodeId) === &quot;div#final_container&quot;, &quot;onChildNodeInserted called for parent node #final_container&quot;);
+        ProtocolTest.expectThat(getNodeIdentifier(response.params.node.nodeId) === &quot;div#target_element&quot;, &quot;onChildNodeInserted called for child node #target_element&quot;);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function onDebuggerPaused(response)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsinspectorruntimegetPropertieshtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/runtime/getProperties.html (188451 => 188452)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/runtime/getProperties.html        2015-08-14 10:36:28 UTC (rev 188451)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/runtime/getProperties.html        2015-08-14 10:38:42 UTC (rev 188452)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx"> &lt;script&gt;
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><del>-    var suite = new ProtocolTest.AsyncTestSuite(&quot;Runtime.getProperties&quot;);
</del><ins>+    var suite = ProtocolTest.createAsyncSuite(&quot;Runtime.getProperties&quot;);
</ins><span class="cx"> 
</span><span class="cx">     addGetPropertiesTestCase({
</span><span class="cx">         name: &quot;CheckPropertiesOfWrapperObject&quot;,
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsinspectorunittestsasynctestsuiteexpectedtxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/unit-tests/async-test-suite-expected.txt (188451 => 188452)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/unit-tests/async-test-suite-expected.txt        2015-08-14 10:36:28 UTC (rev 188451)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/unit-tests/async-test-suite-expected.txt        2015-08-14 10:38:42 UTC (rev 188452)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> PASS: instantiating AsyncTestSuite requires name argument.
</span><span class="cx"> PASS: instantiating AsyncTestSuite requires string name argument.
</span><ins>+PASS: instantiating AsyncTestSuite requires test harness argument.
</ins><span class="cx"> PASS: should not be able to add empty test case.
</span><span class="cx"> PASS: should not be able to add non-object test case.
</span><span class="cx"> PASS: test case should require string name.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsinspectorunittestsasynctestsuitehtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/unit-tests/async-test-suite.html (188451 => 188452)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/unit-tests/async-test-suite.html        2015-08-14 10:36:28 UTC (rev 188451)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/unit-tests/async-test-suite.html        2015-08-14 10:38:42 UTC (rev 188452)
</span><span class="lines">@@ -6,21 +6,28 @@
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><span class="cx">     try {
</span><del>-        new ProtocolTest.AsyncTestSuite();
</del><ins>+        let result = new InjectedTestHarness.AsyncTestSuite(this);
</ins><span class="cx">         ProtocolTest.log(&quot;FAIL: instantiating AsyncTestSuite requires name argument.&quot;);
</span><span class="cx">     } catch (e) {
</span><span class="cx">         ProtocolTest.log(&quot;PASS: instantiating AsyncTestSuite requires name argument.&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     try {
</span><del>-        new ProtocolTest.AsyncTestSuite({});
</del><ins>+        let result = new InjectedTestHarness.AsyncTestSuite(this, {});
</ins><span class="cx">         ProtocolTest.log(&quot;FAIL: instantiating AsyncTestSuite requires string name argument.&quot;);
</span><span class="cx">     } catch (e) {
</span><span class="cx">         ProtocolTest.log(&quot;PASS: instantiating AsyncTestSuite requires string name argument.&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    var badArgsSuite = new ProtocolTest.AsyncTestSuite(&quot;dummy&quot;);
</del><span class="cx">     try {
</span><ins>+        let result = new InjectedTestHarness.AsyncTestSuite(&quot;something&quot;, {});
+        ProtocolTest.log(&quot;FAIL: instantiating AsyncTestSuite requires test harness argument.&quot;);
+    } catch (e) {
+        ProtocolTest.log(&quot;PASS: instantiating AsyncTestSuite requires test harness argument.&quot;);
+    }
+
+    var badArgsSuite = ProtocolTest.createAsyncSuite(&quot;dummy&quot;);
+    try {
</ins><span class="cx">         badArgsSuite.addTestCase();
</span><span class="cx">         ProtocolTest.log(&quot;FAIL: should not be able to add empty test case.&quot;);
</span><span class="cx">     } catch (e) {
</span><span class="lines">@@ -51,7 +58,7 @@
</span><span class="cx">         ProtocolTest.log(&quot;PASS: test case should require test function.&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    var runEmptySuite = new ProtocolTest.AsyncTestSuite(&quot;AsyncTestSuite.RunEmptySuite&quot;);
</del><ins>+    var runEmptySuite = ProtocolTest.createAsyncSuite(&quot;AsyncTestSuite.RunEmptySuite&quot;);
</ins><span class="cx">     try {
</span><span class="cx">         runEmptySuite.runTestCases();
</span><span class="cx">         ProtocolTest.log(&quot;FAIL: should not be able to run empty test suite.&quot;);
</span><span class="lines">@@ -59,7 +66,7 @@
</span><span class="cx">         ProtocolTest.log(&quot;PASS: should not be able to run empty test suite.&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    var runTwiceSuite = new ProtocolTest.AsyncTestSuite(&quot;AsyncTestSuite.RunTwiceSuite&quot;);
</del><ins>+    var runTwiceSuite = ProtocolTest.createAsyncSuite(&quot;AsyncTestSuite.RunTwiceSuite&quot;);
</ins><span class="cx">     runTwiceSuite.addTestCase({
</span><span class="cx">         name: &quot;DummyTest0&quot;,
</span><span class="cx">         description: &quot;Check that a suite can't run more than once.&quot;,
</span><span class="lines">@@ -81,7 +88,7 @@
</span><span class="cx">     var rejectToken = {&quot;token&quot;: 666};
</span><span class="cx">     var thrownError = new Error(rejectToken);
</span><span class="cx"> 
</span><del>-    var sequentialExecutionSuite = new ProtocolTest.AsyncTestSuite(&quot;AsyncTestSuite.SequentialExecution&quot;);
</del><ins>+    var sequentialExecutionSuite = ProtocolTest.createAsyncSuite(&quot;AsyncTestSuite.SequentialExecution&quot;);
</ins><span class="cx">     sequentialExecutionSuite.addTestCase({
</span><span class="cx">         name: &quot;DummyTest1&quot;,
</span><span class="cx">         description: &quot;Check test case execution order.&quot;,
</span><span class="lines">@@ -111,7 +118,7 @@
</span><span class="cx">         }
</span><span class="cx">     });
</span><span class="cx"> 
</span><del>-    var abortOnFailureSuite = new ProtocolTest.AsyncTestSuite(&quot;AsyncTestSuite.AbortOnFailure&quot;);
</del><ins>+    var abortOnFailureSuite = ProtocolTest.createAsyncSuite(&quot;AsyncTestSuite.AbortOnFailure&quot;);
</ins><span class="cx">     abortOnFailureSuite.addTestCase({
</span><span class="cx">         name: &quot;PassingTest5&quot;,
</span><span class="cx">         description: &quot;This test is a dummy.&quot;,
</span><span class="lines">@@ -136,7 +143,7 @@
</span><span class="cx"> 
</span><span class="cx">     result = result.then(function() {
</span><span class="cx">         var promise = sequentialExecutionSuite.runTestCases();
</span><del>-        ProtocolTest.assert(result instanceof Promise, &quot;AsyncTestSuite.RunTestCases() should return a Promise.&quot;);
</del><ins>+        ProtocolTest.expectThat(result instanceof Promise, &quot;AsyncTestSuite.RunTestCases() should return a Promise.&quot;);
</ins><span class="cx">         return promise;
</span><span class="cx">     });
</span><span class="cx">     result = result.then(function resolved() {
</span><span class="lines">@@ -144,12 +151,12 @@
</span><span class="cx">         return Promise.resolve(); // Continue this test.
</span><span class="cx">     }, function rejected(e) {
</span><span class="cx">         ProtocolTest.log(&quot;PASS: Promise from sequentialExecutionSuite.runTestCases() should reject when a test case fails.&quot;);
</span><del>-        ProtocolTest.assert(e === thrownError, &quot;Promise from sequentialExecutionSuite.runTestCases() should reject without altering its result value.&quot;);
</del><ins>+        ProtocolTest.expectThat(e === thrownError, &quot;Promise from sequentialExecutionSuite.runTestCases() should reject without altering its result value.&quot;);
</ins><span class="cx"> 
</span><del>-        ProtocolTest.assert(sequentialExecutionSuite.runCount === 4, &quot;sequentialExecutionSuite should have executed four tests.&quot;);
-        ProtocolTest.assert(sequentialExecutionSuite.passCount === 3, &quot;sequentialExecutionSuite should have passed three tests.&quot;);
-        ProtocolTest.assert(sequentialExecutionSuite.failCount === 1, &quot;sequentialExecutionSuite should have failed 1 test.&quot;);
-        ProtocolTest.assert(sequentialExecutionSuite.skipCount === 0, &quot;sequentialExecutionSuite should have skipped zero tests.&quot;);
</del><ins>+        ProtocolTest.expectThat(sequentialExecutionSuite.runCount === 4, &quot;sequentialExecutionSuite should have executed four tests.&quot;);
+        ProtocolTest.expectThat(sequentialExecutionSuite.passCount === 3, &quot;sequentialExecutionSuite should have passed three tests.&quot;);
+        ProtocolTest.expectThat(sequentialExecutionSuite.failCount === 1, &quot;sequentialExecutionSuite should have failed 1 test.&quot;);
+        ProtocolTest.expectThat(sequentialExecutionSuite.skipCount === 0, &quot;sequentialExecutionSuite should have skipped zero tests.&quot;);
</ins><span class="cx">         return Promise.resolve(); // Continue this test.
</span><span class="cx">     });
</span><span class="cx"> 
</span><span class="lines">@@ -160,11 +167,11 @@
</span><span class="cx">         return Promise.resolve(); // Continue this test.
</span><span class="cx">     }, function rejected(e) {
</span><span class="cx">         ProtocolTest.log(&quot;PASS: Promise from abortOnFailureSuite.runTestCases() should reject when a test case fails.&quot;);
</span><del>-        ProtocolTest.assert(e === rejectToken, &quot;Promise from abortOnFailureSuite.runTestCases() should reject without altering its result value.&quot;);
-        ProtocolTest.assert(abortOnFailureSuite.runCount === 2, &quot;abortOnFailureSuite should have executed two tests.&quot;);
-        ProtocolTest.assert(abortOnFailureSuite.passCount === 1, &quot;abortOnFailureSuite should have passed one test.&quot;);
-        ProtocolTest.assert(abortOnFailureSuite.failCount === 1, &quot;abortOnFailureSuite should have failed one test.&quot;);
-        ProtocolTest.assert(abortOnFailureSuite.skipCount === 1, &quot;abortOnFailureSuite should have skipped one test.&quot;);
</del><ins>+        ProtocolTest.expectThat(e === rejectToken, &quot;Promise from abortOnFailureSuite.runTestCases() should reject without altering its result value.&quot;);
+        ProtocolTest.expectThat(abortOnFailureSuite.runCount === 2, &quot;abortOnFailureSuite should have executed two tests.&quot;);
+        ProtocolTest.expectThat(abortOnFailureSuite.passCount === 1, &quot;abortOnFailureSuite should have passed one test.&quot;);
+        ProtocolTest.expectThat(abortOnFailureSuite.failCount === 1, &quot;abortOnFailureSuite should have failed one test.&quot;);
+        ProtocolTest.expectThat(abortOnFailureSuite.skipCount === 1, &quot;abortOnFailureSuite should have skipped one test.&quot;);
</ins><span class="cx"> 
</span><span class="cx">         return Promise.resolve(); // Continue this test.
</span><span class="cx">     });
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsinspectorunittestssynctestsuiteexpectedtxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/unit-tests/sync-test-suite-expected.txt (188451 => 188452)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/unit-tests/sync-test-suite-expected.txt        2015-08-14 10:36:28 UTC (rev 188451)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/unit-tests/sync-test-suite-expected.txt        2015-08-14 10:38:42 UTC (rev 188452)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> PASS: instantiating SyncTestSuite requires name argument.
</span><span class="cx"> PASS: instantiating SyncTestSuite requires string name argument.
</span><ins>+PASS: instantiating SyncTestSuite requires test harness argument.
</ins><span class="cx"> PASS: should not be able to add empty test case.
</span><span class="cx"> PASS: should not be able to add non-object test case.
</span><span class="cx"> PASS: test case should require string name.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsinspectorunittestssynctestsuitehtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/unit-tests/sync-test-suite.html (188451 => 188452)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/unit-tests/sync-test-suite.html        2015-08-14 10:36:28 UTC (rev 188451)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/inspector/unit-tests/sync-test-suite.html        2015-08-14 10:38:42 UTC (rev 188452)
</span><span class="lines">@@ -6,21 +6,28 @@
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><span class="cx">     try {
</span><del>-        new ProtocolTest.SyncTestSuite();
</del><ins>+        let result = new ProtocolTest.SyncTestSuite(this);
</ins><span class="cx">         ProtocolTest.log(&quot;FAIL: instantiating SyncTestSuite requires name argument.&quot;);
</span><span class="cx">     } catch (e) {
</span><span class="cx">         ProtocolTest.log(&quot;PASS: instantiating SyncTestSuite requires name argument.&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     try {
</span><del>-        new ProtocolTest.SyncTestSuite({});
</del><ins>+        let result = new ProtocolTest.SyncTestSuite(this, {});
</ins><span class="cx">         ProtocolTest.log(&quot;FAIL: instantiating SyncTestSuite requires string name argument.&quot;);
</span><span class="cx">     } catch (e) {
</span><span class="cx">         ProtocolTest.log(&quot;PASS: instantiating SyncTestSuite requires string name argument.&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    var badArgsSuite = new ProtocolTest.SyncTestSuite(&quot;dummy&quot;);
</del><span class="cx">     try {
</span><ins>+        let result = new ProtocolTest.SyncTestSuite(&quot;something&quot;, {});
+        ProtocolTest.log(&quot;FAIL: instantiating SyncTestSuite requires test harness argument.&quot;);
+    } catch (e) {
+        ProtocolTest.log(&quot;PASS: instantiating SyncTestSuite requires test harness argument.&quot;);
+    }
+
+    var badArgsSuite = ProtocolTest.createSyncSuite(&quot;dummy&quot;);
+    try {
</ins><span class="cx">         badArgsSuite.addTestCase();
</span><span class="cx">         ProtocolTest.log(&quot;FAIL: should not be able to add empty test case.&quot;);
</span><span class="cx">     } catch (e) {
</span><span class="lines">@@ -51,7 +58,7 @@
</span><span class="cx">         ProtocolTest.log(&quot;PASS: test case should require test function.&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    var runEmptySuite = new ProtocolTest.SyncTestSuite(&quot;SyncTestSuite.RunEmptySuite&quot;);
</del><ins>+    var runEmptySuite = ProtocolTest.createSyncSuite(&quot;SyncTestSuite.RunEmptySuite&quot;);
</ins><span class="cx">     try {
</span><span class="cx">         runEmptySuite.runTestCases();
</span><span class="cx">         ProtocolTest.log(&quot;FAIL: should not be able to run empty test suite.&quot;);
</span><span class="lines">@@ -59,7 +66,7 @@
</span><span class="cx">         ProtocolTest.log(&quot;PASS: should not be able to run empty test suite.&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    var runTwiceSuite = new ProtocolTest.SyncTestSuite(&quot;SyncTestSuite.RunTwiceSuite&quot;);
</del><ins>+    var runTwiceSuite = ProtocolTest.createSyncSuite(&quot;SyncTestSuite.RunTwiceSuite&quot;);
</ins><span class="cx">     runTwiceSuite.addTestCase({
</span><span class="cx">         name: &quot;DummyTest0&quot;,
</span><span class="cx">         description: &quot;Check that a suite can't run more than once.&quot;,
</span><span class="lines">@@ -68,7 +75,7 @@
</span><span class="cx"> 
</span><span class="cx">     try {
</span><span class="cx">         var result = runTwiceSuite.runTestCases();
</span><del>-        ProtocolTest.assert(result === true, &quot;Return value of runTwiceSuite.runTestCases() should be true when all tests pass.&quot;);
</del><ins>+        ProtocolTest.expectThat(result === true, &quot;Return value of runTwiceSuite.runTestCases() should be true when all tests pass.&quot;);
</ins><span class="cx"> 
</span><span class="cx">         runTwiceSuite.runTestCases(); // Try to trigger an error.
</span><span class="cx">         ProtocolTest.log(&quot;FAIL: should not be able to run a test suite twice.&quot;);
</span><span class="lines">@@ -78,7 +85,7 @@
</span><span class="cx"> 
</span><span class="cx">     var thrownError = new Error({&quot;token&quot;: 666});
</span><span class="cx"> 
</span><del>-    var sequentialExecutionSuite = new ProtocolTest.SyncTestSuite(&quot;SyncTestSuite.SequentialExecution&quot;);
</del><ins>+    var sequentialExecutionSuite = ProtocolTest.createSyncSuite(&quot;SyncTestSuite.SequentialExecution&quot;);
</ins><span class="cx">     sequentialExecutionSuite.addTestCase({
</span><span class="cx">         name: &quot;DummyTest1&quot;,
</span><span class="cx">         description: &quot;Check test case execution order.&quot;,
</span><span class="lines">@@ -101,13 +108,13 @@
</span><span class="cx">     });
</span><span class="cx"> 
</span><span class="cx">     var result = sequentialExecutionSuite.runTestCases();
</span><del>-    ProtocolTest.assert(result === false, &quot;Return value of sequentialExecutionSuite.runTestCases() should be false when a test case fails.&quot;);
-    ProtocolTest.assert(sequentialExecutionSuite.runCount === 4, &quot;sequentialExecutionSuite should have executed four tests.&quot;);
-    ProtocolTest.assert(sequentialExecutionSuite.passCount === 3, &quot;sequentialExecutionSuite should have passed three tests.&quot;);
-    ProtocolTest.assert(sequentialExecutionSuite.failCount === 1, &quot;sequentialExecutionSuite should have failed 1 test.&quot;);
-    ProtocolTest.assert(sequentialExecutionSuite.skipCount === 0, &quot;sequentialExecutionSuite should have skipped zero tests.&quot;);
</del><ins>+    ProtocolTest.expectThat(result === false, &quot;Return value of sequentialExecutionSuite.runTestCases() should be false when a test case fails.&quot;);
+    ProtocolTest.expectThat(sequentialExecutionSuite.runCount === 4, &quot;sequentialExecutionSuite should have executed four tests.&quot;);
+    ProtocolTest.expectThat(sequentialExecutionSuite.passCount === 3, &quot;sequentialExecutionSuite should have passed three tests.&quot;);
+    ProtocolTest.expectThat(sequentialExecutionSuite.failCount === 1, &quot;sequentialExecutionSuite should have failed 1 test.&quot;);
+    ProtocolTest.expectThat(sequentialExecutionSuite.skipCount === 0, &quot;sequentialExecutionSuite should have skipped zero tests.&quot;);
</ins><span class="cx"> 
</span><del>-    var abortOnFailureSuite = new ProtocolTest.SyncTestSuite(&quot;SyncTestSuite.AbortOnFailure&quot;);
</del><ins>+    var abortOnFailureSuite = ProtocolTest.createSyncSuite(&quot;SyncTestSuite.AbortOnFailure&quot;);
</ins><span class="cx">     abortOnFailureSuite.addTestCase({
</span><span class="cx">         name: &quot;PassingTest5&quot;,
</span><span class="cx">         description: &quot;This test is a dummy.&quot;,
</span><span class="lines">@@ -125,11 +132,11 @@
</span><span class="cx">     });
</span><span class="cx"> 
</span><span class="cx">     abortOnFailureSuite.runTestCases();
</span><del>-    ProtocolTest.assert(result === false, &quot;Return value of abortOnFailureSuite.runTestCases() should be false when a test case fails.&quot;);
-    ProtocolTest.assert(abortOnFailureSuite.runCount === 2, &quot;abortOnFailureSuite should have executed two tests.&quot;);
-    ProtocolTest.assert(abortOnFailureSuite.passCount === 1, &quot;abortOnFailureSuite should have passed one test.&quot;);
-    ProtocolTest.assert(abortOnFailureSuite.failCount === 1, &quot;abortOnFailureSuite should have failed one test.&quot;);
-    ProtocolTest.assert(abortOnFailureSuite.skipCount === 1, &quot;abortOnFailureSuite should have skipped one test.&quot;);
</del><ins>+    ProtocolTest.expectThat(result === false, &quot;Return value of abortOnFailureSuite.runTestCases() should be false when a test case fails.&quot;);
+    ProtocolTest.expectThat(abortOnFailureSuite.runCount === 2, &quot;abortOnFailureSuite should have executed two tests.&quot;);
+    ProtocolTest.expectThat(abortOnFailureSuite.passCount === 1, &quot;abortOnFailureSuite should have passed one test.&quot;);
+    ProtocolTest.expectThat(abortOnFailureSuite.failCount === 1, &quot;abortOnFailureSuite should have failed one test.&quot;);
+    ProtocolTest.expectThat(abortOnFailureSuite.skipCount === 1, &quot;abortOnFailureSuite should have skipped one test.&quot;);
</ins><span class="cx"> 
</span><span class="cx">     ProtocolTest.completeTest();
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>