<!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>[205834] trunk</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>Source/WebInspectorUI:
Web Inspector: Improve clarity of inspector tests by adding TestHarness.expect* functions similar to XCTest
https://bugs.webkit.org/show_bug.cgi?id=161278
&lt;rdar://problem/28039741&gt;

Reviewed by Joseph Pecoraro.

Under the hood they all call TestHarness.expectThat.

* UserInterface/Test/TestHarness.js:
(TestHarness.prototype.expectFalse):
(TestHarness.prototype.expectNull):
(TestHarness.prototype.expectNotNull):
(TestHarness.prototype.expectEqual):
(TestHarness.prototype.expectNotEqual):
(TestHarness.prototype.expectShallowEqual):
(TestHarness.prototype.expectNotShallowEqual):
(TestHarness.prototype.expectEqualWithAccuracy):
(TestHarness.prototype.expectLessThan):
(TestHarness.prototype.expectLessThanOrEqual):
(TestHarness.prototype.expectGreaterThan):
(TestHarness.prototype.expectGreaterThanOrEqual):

LayoutTests:
Web Inspector: Add TestHarness assertions/expectations to provide additional semantics similar to XCTest
https://bugs.webkit.org/show_bug.cgi?id=161278
&lt;rdar://problem/28039741&gt;

Reviewed by Joseph Pecoraro.

Add test to verify that the TestHarness.expect* family of functions
trivially work. Since it isn't possible to verify the TestPage results
directly without introducing additional complexity, simply log baseline
&quot;PASS&quot; and &quot;FAIL&quot; results for each function.

* inspector/unit-tests/test-harness-expect-functions-expected.txt: Added.
* inspector/unit-tests/test-harness-expect-functions.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTestTestHarnessjs">trunk/Source/WebInspectorUI/UserInterface/Test/TestHarness.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectorunitteststestharnessexpectfunctionsexpectedtxt">trunk/LayoutTests/inspector/unit-tests/test-harness-expect-functions-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorunitteststestharnessexpectfunctionshtml">trunk/LayoutTests/inspector/unit-tests/test-harness-expect-functions.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (205833 => 205834)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-09-12 22:36:14 UTC (rev 205833)
+++ trunk/LayoutTests/ChangeLog        2016-09-12 22:36:57 UTC (rev 205834)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2016-09-12  Matt Baker  &lt;mattbaker@apple.com&gt;
+
+        Web Inspector: Add TestHarness assertions/expectations to provide additional semantics similar to XCTest
+        https://bugs.webkit.org/show_bug.cgi?id=161278
+        &lt;rdar://problem/28039741&gt;
+
+        Reviewed by Joseph Pecoraro.
+
+        Add test to verify that the TestHarness.expect* family of functions
+        trivially work. Since it isn't possible to verify the TestPage results
+        directly without introducing additional complexity, simply log baseline
+        &quot;PASS&quot; and &quot;FAIL&quot; results for each function.
+
+        * inspector/unit-tests/test-harness-expect-functions-expected.txt: Added.
+        * inspector/unit-tests/test-harness-expect-functions.html: Added.
+
</ins><span class="cx"> 2016-09-12  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         window.performance object resets script-applied properties
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorunitteststestharnessexpectfunctionsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/unit-tests/test-harness-expect-functions-expected.txt (0 => 205834)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/unit-tests/test-harness-expect-functions-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/unit-tests/test-harness-expect-functions-expected.txt        2016-09-12 22:36:57 UTC (rev 205834)
</span><span class="lines">@@ -0,0 +1,162 @@
</span><ins>+Testing TestHarness.expect* family of functions.
+
+
+== Running test suite: InspectorTestExpectFunctions
+-- Running test case: InspectorTest.expectThat
+Expected to PASS
+PASS: expectThat(true)
+PASS: expectThat(1)
+PASS: expectThat(&quot;abc&quot;)
+PASS: expectThat({})
+PASS: expectThat([])
+Expected to FAIL
+FAIL: expectThat(false)
+FAIL: expectThat(0)
+FAIL: expectThat(&quot;&quot;)
+FAIL: expectThat(null)
+FAIL: expectThat(undefined)
+FAIL: expectThat(NaN)
+
+-- Running test case: InspectorTest.expectFalse
+Expected to PASS
+PASS: expectFalse(false)
+PASS: expectFalse(0)
+PASS: expectFalse(&quot;&quot;)
+PASS: expectFalse(null)
+PASS: expectFalse(undefined)
+PASS: expectFalse(NaN)
+Expected to FAIL
+FAIL: expectFalse(true)
+FAIL: expectFalse(1)
+FAIL: expectFalse(&quot;abc&quot;)
+FAIL: expectFalse({})
+FAIL: expectFalse([])
+
+-- Running test case: InspectorTest.expectNull
+Expected to PASS
+PASS: expectNull(null)
+Expected to FAIL
+FAIL: expectNull(true)
+FAIL: expectNull(false)
+FAIL: expectNull(1)
+FAIL: expectNull(&quot;&quot;)
+FAIL: expectNull(undefined)
+FAIL: expectNull({})
+FAIL: expectNull([])
+
+-- Running test case: InspectorTest.expectNotNull
+Expected to PASS
+PASS: expectNotNull(true)
+PASS: expectNotNull(false)
+PASS: expectNotNull(1)
+PASS: expectNotNull(&quot;&quot;)
+PASS: expectNotNull(undefined)
+PASS: expectNotNull({})
+PASS: expectNotNull([])
+Expected to FAIL
+FAIL: expectNotNull(null)
+
+-- Running test case: InspectorTest.expectEqual
+Expected to PASS
+PASS: expectEqual(true, true)
+PASS: expectEqual({&quot;a&quot;:1,&quot;b&quot;:2}, {&quot;a&quot;:1,&quot;b&quot;:2})
+PASS: expectEqual(1.23, 1.23)
+PASS: expectEqual(&quot;abc&quot;, &quot;abc&quot;)
+PASS: expectEqual(null, null)
+PASS: expectEqual(undefined, undefined)
+Expected to FAIL
+FAIL: expectEqual(true, false)
+FAIL: expectEqual({&quot;a&quot;:1,&quot;b&quot;:2}, {&quot;c&quot;:3,&quot;d&quot;:4})
+FAIL: expectEqual(1.23, 4.56)
+FAIL: expectEqual(&quot;abc&quot;, &quot;def&quot;)
+FAIL: expectEqual(null, undefined)
+FAIL: expectEqual(NaN, NaN)
+FAIL: expectEqual({}, {})
+FAIL: expectEqual([], [])
+
+-- Running test case: InspectorTest.expectNotEqual
+Expected to PASS
+PASS: expectNotEqual(true, false)
+PASS: expectNotEqual({&quot;a&quot;:1,&quot;b&quot;:2}, {&quot;c&quot;:3,&quot;d&quot;:4})
+PASS: expectNotEqual(1.23, 4.56)
+PASS: expectNotEqual(&quot;abc&quot;, &quot;def&quot;)
+PASS: expectNotEqual(null, undefined)
+PASS: expectNotEqual(NaN, NaN)
+PASS: expectNotEqual({}, {})
+PASS: expectNotEqual([], [])
+Expected to FAIL
+FAIL: expectNotEqual(true, true)
+FAIL: expectNotEqual({&quot;a&quot;:1,&quot;b&quot;:2}, {&quot;a&quot;:1,&quot;b&quot;:2})
+FAIL: expectNotEqual(1.23, 1.23)
+FAIL: expectNotEqual(&quot;abc&quot;, &quot;abc&quot;)
+FAIL: expectNotEqual(null, null)
+FAIL: expectNotEqual(undefined, undefined)
+
+-- Running test case: InspectorTest.expectShallowEqual
+Expected to PASS
+PASS: expectShallowEqual({&quot;a&quot;:1,&quot;b&quot;:2}, {&quot;a&quot;:1,&quot;b&quot;:2})
+PASS: expectShallowEqual({}, {})
+PASS: expectShallowEqual([], [])
+Expected to FAIL
+FAIL: expectShallowEqual({&quot;a&quot;:1,&quot;b&quot;:2}, {&quot;a&quot;:3,&quot;b&quot;:4})
+FAIL: expectShallowEqual({}, [])
+
+-- Running test case: InspectorTest.expectNotShallowEqual
+Expected to PASS
+PASS: expectNotShallowEqual({&quot;a&quot;:1,&quot;b&quot;:2}, {&quot;a&quot;:3,&quot;b&quot;:4})
+PASS: expectNotShallowEqual({}, [])
+Expected to FAIL
+FAIL: expectNotShallowEqual({&quot;a&quot;:1,&quot;b&quot;:2}, {&quot;a&quot;:1,&quot;b&quot;:2})
+FAIL: expectNotShallowEqual({}, {})
+FAIL: expectNotShallowEqual([], [])
+
+-- Running test case: InspectorTest.expectEqualWithAccuracy
+Expected to PASS
+PASS: expectEqualWithAccuracy(0, 0, 0)
+PASS: expectEqualWithAccuracy(0, 0, 1)
+PASS: expectEqualWithAccuracy(0, 1, 1)
+PASS: expectEqualWithAccuracy(1, 0, 1)
+Expected to FAIL
+FAIL: expectEqualWithAccuracy(0, 2, 1)
+FAIL: expectEqualWithAccuracy(2, 0, 1)
+
+-- Running test case: InspectorTest.expectLessThan
+Expected to PASS
+PASS: expectLessThan(0, 1)
+PASS: expectLessThan(&quot;abc&quot;, &quot;def&quot;)
+Expected to FAIL
+FAIL: expectLessThan(0, 0)
+FAIL: expectLessThan(1, 0)
+FAIL: expectLessThan(&quot;abc&quot;, &quot;abc&quot;)
+FAIL: expectLessThan(&quot;def&quot;, &quot;abc&quot;)
+
+-- Running test case: InspectorTest.expectLessThanOrEqual
+Expected to PASS
+PASS: expectLessThanOrEqual(0, 1)
+PASS: expectLessThanOrEqual(0, 0)
+PASS: expectLessThanOrEqual(&quot;abc&quot;, &quot;def&quot;)
+PASS: expectLessThanOrEqual(&quot;abc&quot;, &quot;abc&quot;)
+Expected to FAIL
+FAIL: expectLessThanOrEqual(1, 0)
+FAIL: expectLessThanOrEqual(&quot;def&quot;, &quot;abc&quot;)
+
+-- Running test case: InspectorTest.expectGreaterThan
+Expected to PASS
+PASS: expectGreaterThan(1, 0)
+PASS: expectGreaterThan(&quot;def&quot;, &quot;abc&quot;)
+Expected to FAIL
+FAIL: expectGreaterThan(0, 0)
+FAIL: expectGreaterThan(0, 1)
+FAIL: expectGreaterThan(&quot;abc&quot;, &quot;abc&quot;)
+FAIL: expectGreaterThan(&quot;abc&quot;, &quot;def&quot;)
+
+-- Running test case: InspectorTest.expectGreaterThanOrEqual
+Expected to PASS
+PASS: expectGreaterThanOrEqual(1, 0)
+PASS: expectGreaterThanOrEqual(0, 0)
+PASS: expectGreaterThanOrEqual(&quot;def&quot;, &quot;abc&quot;)
+PASS: expectGreaterThanOrEqual(&quot;abc&quot;, &quot;abc&quot;)
+Expected to FAIL
+FAIL: expectGreaterThanOrEqual(0, 1)
+FAIL: expectGreaterThanOrEqual(&quot;abc&quot;, &quot;def&quot;)
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorunitteststestharnessexpectfunctionshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/unit-tests/test-harness-expect-functions.html (0 => 205834)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/unit-tests/test-harness-expect-functions.html                                (rev 0)
+++ trunk/LayoutTests/inspector/unit-tests/test-harness-expect-functions.html        2016-09-12 22:36:57 UTC (rev 205834)
</span><span class="lines">@@ -0,0 +1,190 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../http/tests/inspector/resources/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test()
+{
+    console.assert(false, &quot;FAIL ASSERTION!!!!!!!&quot;);
+
+    let suite = InspectorTest.createSyncSuite(&quot;InspectorTestExpectFunctions&quot;);
+
+    function toArray(a) {
+        return a instanceof Array &amp;&amp; a.length ? a : [a];
+    }
+
+    function stringifyArguments(args) {
+        return args.map((a) =&gt; {
+            if (typeof a === &quot;number&quot;)
+                return a;
+            // Append empty string so `undefined` is displayed correctly.
+            return JSON.stringify(a) + &quot;&quot;;
+        }).join(&quot;, &quot;);
+    }
+
+    function addTestCase({functionName, passingInputs, failingInputs}) {
+        let functionUnderTest = InspectorTest[functionName];
+        InspectorTest.assert(typeof functionUnderTest === &quot;function&quot;, &quot;Unknown InspectorTest function: &quot; + functionName);
+
+        suite.addTestCase({
+            name: `InspectorTest.${functionName}`,
+            test() {
+                function exerciseFunction(inputs, shouldPass) {
+                    if (!inputs || !inputs.length) {
+                        InspectorTest.fail(&quot;exerciseFunction called with no inputs.&quot;);
+                        return;
+                    }
+
+                    InspectorTest.log(&quot;Expected to &quot; + (shouldPass ? &quot;PASS&quot; : &quot;FAIL&quot;));
+                    for (let input of inputs.map(toArray)) {
+                        let argumentsString = stringifyArguments(input);
+                        functionUnderTest.call(InspectorTest, ...input, `${functionName}(${argumentsString})`);
+                    }
+                }
+
+                exerciseFunction(passingInputs, true);
+                exerciseFunction(failingInputs, false);
+                return true;
+            }
+        });
+    }
+
+    function addInverseTestCase(functionName, testCase) {
+        addTestCase({functionName, passingInputs: testCase.failingInputs, failingInputs: testCase.passingInputs})
+    }
+
+    let expectThatTestCase = {
+        functionName: &quot;expectThat&quot;,
+        passingInputs: [true, 1, &quot;abc&quot;, {}, []],
+        failingInputs: [false, 0, &quot;&quot;, null, undefined, NaN],
+    };
+    addTestCase(expectThatTestCase);
+    addInverseTestCase(&quot;expectFalse&quot;, expectThatTestCase);
+
+    let expectNullTestCase = {
+        functionName: &quot;expectNull&quot;,
+        passingInputs: [null],
+        failingInputs: [true, false, 1, &quot;&quot;, undefined, {}, []]
+    };
+    addTestCase(expectNullTestCase);
+    addInverseTestCase(&quot;expectNotNull&quot;, expectNullTestCase);
+
+    let object1 = {a: 1, b: 2};
+    let object2 = {c: 3, d: 4};
+    let expectEqualTestCase = {
+        functionName: &quot;expectEqual&quot;,
+        passingInputs: [
+            [true, true],
+            [object1, object1],
+            [1.23, 1.23],
+            [&quot;abc&quot;, &quot;abc&quot;],
+            [null, null],
+            [undefined, undefined],
+        ],
+        failingInputs: [
+            [true, false],
+            [object1, object2],
+            [1.23, 4.56],
+            [&quot;abc&quot;, &quot;def&quot;],
+            [null, undefined],
+            [NaN, NaN],
+            [{}, {}],
+            [[], []],
+        ]
+    };
+    addTestCase(expectEqualTestCase);
+    addInverseTestCase(&quot;expectNotEqual&quot;, expectEqualTestCase);
+
+    let expectShallowEqualTestCase = {
+        functionName: &quot;expectShallowEqual&quot;,
+        passingInputs: [
+            [{a: 1, b: 2}, {a: 1, b: 2}],
+            [{}, {}],
+            [[], []],
+        ],
+        failingInputs: [
+            [{a: 1, b: 2}, {a: 3, b: 4}],
+            [{}, []],
+        ]
+    };
+    addTestCase(expectShallowEqualTestCase);
+    addInverseTestCase(&quot;expectNotShallowEqual&quot;, expectShallowEqualTestCase);
+
+    addTestCase({
+        functionName: &quot;expectEqualWithAccuracy&quot;,
+        passingInputs: [
+            [0, 0, 0],
+            [0, 0, 1],
+            [0, 1, 1],
+            [1, 0, 1],
+        ],
+        failingInputs: [
+            [0, 2, 1],
+            [2, 0, 1],
+        ]
+    });
+
+    addTestCase({
+        functionName: &quot;expectLessThan&quot;,
+        passingInputs: [
+            [0, 1],
+            [&quot;abc&quot;, &quot;def&quot;],
+        ],
+        failingInputs: [
+            [0, 0],
+            [1, 0],
+            [&quot;abc&quot;, &quot;abc&quot;],
+            [&quot;def&quot;, &quot;abc&quot;],
+        ]
+    });
+
+    addTestCase({
+        functionName: &quot;expectLessThanOrEqual&quot;,
+        passingInputs: [
+            [0, 1],
+            [0, 0],
+            [&quot;abc&quot;, &quot;def&quot;],
+            [&quot;abc&quot;, &quot;abc&quot;],
+        ],
+        failingInputs: [
+            [1, 0],
+            [&quot;def&quot;, &quot;abc&quot;],
+        ]
+    });
+
+    addTestCase({
+        functionName: &quot;expectGreaterThan&quot;,
+        passingInputs: [
+            [1, 0],
+            [&quot;def&quot;, &quot;abc&quot;],
+        ],
+        failingInputs: [
+            [0, 0],
+            [0, 1],
+            [&quot;abc&quot;, &quot;abc&quot;],
+            [&quot;abc&quot;, &quot;def&quot;],
+        ]
+    });
+
+    addTestCase({
+        functionName: &quot;expectGreaterThanOrEqual&quot;,
+        passingInputs: [
+            [1, 0],
+            [0, 0],
+            [&quot;def&quot;, &quot;abc&quot;],
+            [&quot;abc&quot;, &quot;abc&quot;],
+        ],
+        failingInputs: [
+            [0, 1],
+            [&quot;abc&quot;, &quot;def&quot;],
+        ]
+    });
+
+    suite.runTestCasesAndFinish();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Testing TestHarness.expect* family of functions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (205833 => 205834)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2016-09-12 22:36:14 UTC (rev 205833)
+++ trunk/Source/WebInspectorUI/ChangeLog        2016-09-12 22:36:57 UTC (rev 205834)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2016-09-12  Matt Baker  &lt;mattbaker@apple.com&gt;
+
+        Web Inspector: Improve clarity of inspector tests by adding TestHarness.expect* functions similar to XCTest
+        https://bugs.webkit.org/show_bug.cgi?id=161278
+        &lt;rdar://problem/28039741&gt;
+
+        Reviewed by Joseph Pecoraro.
+
+        Under the hood they all call TestHarness.expectThat.
+
+        * UserInterface/Test/TestHarness.js:
+        (TestHarness.prototype.expectFalse):
+        (TestHarness.prototype.expectNull):
+        (TestHarness.prototype.expectNotNull):
+        (TestHarness.prototype.expectEqual):
+        (TestHarness.prototype.expectNotEqual):
+        (TestHarness.prototype.expectShallowEqual):
+        (TestHarness.prototype.expectNotShallowEqual):
+        (TestHarness.prototype.expectEqualWithAccuracy):
+        (TestHarness.prototype.expectLessThan):
+        (TestHarness.prototype.expectLessThanOrEqual):
+        (TestHarness.prototype.expectGreaterThan):
+        (TestHarness.prototype.expectGreaterThanOrEqual):
+
</ins><span class="cx"> 2016-09-12  Nikita Vasilyev  &lt;nvasilyev@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r205223): Web Inspector: Debugger popover title and code aren't horizontally aligned
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTestTestHarnessjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Test/TestHarness.js (205833 => 205834)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Test/TestHarness.js        2016-09-12 22:36:14 UTC (rev 205833)
+++ trunk/Source/WebInspectorUI/UserInterface/Test/TestHarness.js        2016-09-12 22:36:57 UTC (rev 205834)
</span><span class="lines">@@ -99,6 +99,68 @@
</span><span class="cx">             this.fail(message);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    expectFalse(expression, message)
+    {
+        this.expectThat(!expression, message);
+    }
+
+    expectNull(expression, message)
+    {
+        this.expectThat(expression === null, message);
+    }
+
+    expectNotNull(expression, message)
+    {
+        this.expectThat(expression !== null, message);
+    }
+
+    expectEqual(expression1, expression2, message)
+    {
+        this.expectThat(expression1 === expression2, message);
+    }
+
+    expectNotEqual(expression1, expression2, message)
+    {
+        this.expectThat(expression1 !== expression2, message);
+    }
+
+    expectShallowEqual(expression1, expression2, message)
+    {
+        this.expectThat(Object.shallowEqual(expression1, expression2), message);
+    }
+
+    expectNotShallowEqual(expression1, expression2, message)
+    {
+        this.expectThat(!Object.shallowEqual(expression1, expression2), message);
+    }
+
+    expectEqualWithAccuracy(expression1, expression2, accuracy, message)
+    {
+        console.assert(typeof expression1 === &quot;number&quot;);
+        console.assert(typeof expression2 === &quot;number&quot;);
+        this.expectThat(Math.abs(expression1 - expression2) &lt;= accuracy, message);
+    }
+
+    expectLessThan(expression1, expression2, message)
+    {
+        this.expectThat(expression1 &lt; expression2, message);
+    }
+
+    expectLessThanOrEqual(expression1, expression2, message)
+    {
+        this.expectThat(expression1 &lt;= expression2, message);
+    }
+
+    expectGreaterThan(expression1, expression2, message)
+    {
+        this.expectThat(expression1 &gt; expression2, message);
+    }
+
+    expectGreaterThanOrEqual(expression1, expression2, message)
+    {
+        this.expectThat(expression1 &gt;= expression2, message);
+    }
+
</ins><span class="cx">     pass(message)
</span><span class="cx">     {
</span><span class="cx">         let stringifiedMessage = TestHarness.messageAsString(message);
</span></span></pre>
</div>
</div>

</body>
</html>