<!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>[166901] trunk/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/166901">166901</a></dd>
<dt>Author</dt> <dd>burg@cs.washington.edu</dd>
<dt>Date</dt> <dd>2014-04-07 17:56:37 -0700 (Mon, 07 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: test helper files should be under LayoutTests/http/tests/inspector/
https://bugs.webkit.org/show_bug.cgi?id=131324

Reviewed by Joseph Pecoraro.

Rearrange helper files used by full inspector tests. In their previous placement,
they were outside the http server root and couldn't be loaded from http tests.

* http/tests/inspector/debugger/debugger-test.js: Renamed from LayoutTests/inspector/debugger/debugger-test.js.
* http/tests/inspector/dom/shapes-test.js: Renamed from LayoutTests/inspector/dom/shapes-test.js.
* http/tests/inspector/inspector-test.js: Renamed from LayoutTests/inspector/inspector-test.js.
* http/tests/inspector/replay/replay-test.js: Renamed from LayoutTests/inspector/replay/replay-test.js.
* inspector/debugger/probe-manager-add-remove-actions.html:
* inspector/dom/content-flow-content-nodes.html:
* inspector/dom/content-flow-content-removal.html:
* inspector/dom/content-flow-list.html:
* inspector/dom/content-node-region-info.html:
* inspector/dom/highlight-shape-outside-margin.html:
* inspector/dom/highlight-shape-outside.html:
* inspector/page/main-frame-resource.html:
* inspector/replay/javascript-date-now.html:
* inspector/replay/javascript-random-seed.html:
* inspector/test-harness-trivially-works.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerprobemanageraddremoveactionshtml">trunk/LayoutTests/inspector/debugger/probe-manager-add-remove-actions.html</a></li>
<li><a href="#trunkLayoutTestsinspectordomcontentflowcontentnodeshtml">trunk/LayoutTests/inspector/dom/content-flow-content-nodes.html</a></li>
<li><a href="#trunkLayoutTestsinspectordomcontentflowcontentremovalhtml">trunk/LayoutTests/inspector/dom/content-flow-content-removal.html</a></li>
<li><a href="#trunkLayoutTestsinspectordomcontentflowlisthtml">trunk/LayoutTests/inspector/dom/content-flow-list.html</a></li>
<li><a href="#trunkLayoutTestsinspectordomcontentnoderegioninfohtml">trunk/LayoutTests/inspector/dom/content-node-region-info.html</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightshapeoutsidemarginhtml">trunk/LayoutTests/inspector/dom/highlight-shape-outside-margin.html</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightshapeoutsidehtml">trunk/LayoutTests/inspector/dom/highlight-shape-outside.html</a></li>
<li><a href="#trunkLayoutTestsinspectorpagemainframeresourcehtml">trunk/LayoutTests/inspector/page/main-frame-resource.html</a></li>
<li><a href="#trunkLayoutTestsinspectorreplayjavascriptdatenowhtml">trunk/LayoutTests/inspector/replay/javascript-date-now.html</a></li>
<li><a href="#trunkLayoutTestsinspectorreplayjavascriptrandomseedhtml">trunk/LayoutTests/inspector/replay/javascript-random-seed.html</a></li>
<li><a href="#trunkLayoutTestsinspectortestharnesstriviallyworkshtml">trunk/LayoutTests/inspector/test-harness-trivially-works.html</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/http/tests/inspector/debugger/</li>
<li><a href="#trunkLayoutTestshttptestsinspectordebuggerdebuggertestjs">trunk/LayoutTests/http/tests/inspector/debugger/debugger-test.js</a></li>
<li>trunk/LayoutTests/http/tests/inspector/dom/</li>
<li><a href="#trunkLayoutTestshttptestsinspectordomshapestestjs">trunk/LayoutTests/http/tests/inspector/dom/shapes-test.js</a></li>
<li><a href="#trunkLayoutTestshttptestsinspectorinspectortestjs">trunk/LayoutTests/http/tests/inspector/inspector-test.js</a></li>
<li>trunk/LayoutTests/http/tests/inspector/replay/</li>
<li><a href="#trunkLayoutTestshttptestsinspectorreplayreplaytestjs">trunk/LayoutTests/http/tests/inspector/replay/replay-test.js</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectordebuggerdebuggertestjs">trunk/LayoutTests/inspector/debugger/debugger-test.js</a></li>
<li><a href="#trunkLayoutTestsinspectordomshapestestjs">trunk/LayoutTests/inspector/dom/shapes-test.js</a></li>
<li><a href="#trunkLayoutTestsinspectorinspectortestjs">trunk/LayoutTests/inspector/inspector-test.js</a></li>
<li><a href="#trunkLayoutTestsinspectorreplayreplaytestjs">trunk/LayoutTests/inspector/replay/replay-test.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (166900 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-04-08 00:39:55 UTC (rev 166900)
+++ trunk/LayoutTests/ChangeLog        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2014-04-07  Brian J. Burg  &lt;burg@cs.washington.edu&gt;
+
+        Web Inspector: test helper files should be under LayoutTests/http/tests/inspector/
+        https://bugs.webkit.org/show_bug.cgi?id=131324
+
+        Reviewed by Joseph Pecoraro.
+
+        Rearrange helper files used by full inspector tests. In their previous placement,
+        they were outside the http server root and couldn't be loaded from http tests.
+
+        * http/tests/inspector/debugger/debugger-test.js: Renamed from LayoutTests/inspector/debugger/debugger-test.js.
+        * http/tests/inspector/dom/shapes-test.js: Renamed from LayoutTests/inspector/dom/shapes-test.js.
+        * http/tests/inspector/inspector-test.js: Renamed from LayoutTests/inspector/inspector-test.js.
+        * http/tests/inspector/replay/replay-test.js: Renamed from LayoutTests/inspector/replay/replay-test.js.
+        * inspector/debugger/probe-manager-add-remove-actions.html:
+        * inspector/dom/content-flow-content-nodes.html:
+        * inspector/dom/content-flow-content-removal.html:
+        * inspector/dom/content-flow-list.html:
+        * inspector/dom/content-node-region-info.html:
+        * inspector/dom/highlight-shape-outside-margin.html:
+        * inspector/dom/highlight-shape-outside.html:
+        * inspector/page/main-frame-resource.html:
+        * inspector/replay/javascript-date-now.html:
+        * inspector/replay/javascript-random-seed.html:
+        * inspector/test-harness-trivially-works.html:
+
</ins><span class="cx"> 2014-04-07  Zoltan Horvath  &lt;zoltan@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Shapes] inset complex calc() args vanish in serialized computed style
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsinspectordebuggerdebuggertestjsfromrev166900trunkLayoutTestsinspectordebuggerdebuggertestjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/http/tests/inspector/debugger/debugger-test.js (from rev 166900, trunk/LayoutTests/inspector/debugger/debugger-test.js) (0 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/inspector/debugger/debugger-test.js                                (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/debugger/debugger-test.js        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -0,0 +1,115 @@
</span><ins>+InspectorTestProxy.registerInitializer(function() {
+
+InspectorTest.startTracingBreakpoints = function()
+{
+    if (!WebInspector.debuggerManager)
+        return;
+
+    WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointAdded, function(event) {
+        InspectorTest.log(&quot;Breakpoint was added.&quot;);
+    });
+
+    WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointRemoved, function(event) {
+        InspectorTest.log(&quot;Breakpoint was removed.&quot;);
+    });
+
+    WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisabledStateDidChange, function(event) {
+        var breakpoint = event.target;
+        console.assert(breakpoint instanceof WebInspector.Breakpoint, &quot;Unexpected object type!&quot;);
+
+        InspectorTest.log(&quot;Breakpoint disabled state changed: &quot; + breakpoint.disabled);
+    });
+
+    WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ResolvedStateDidChange, function(event) {
+        var breakpoint = event.target;
+        console.assert(breakpoint instanceof WebInspector.Breakpoint, &quot;Unexpected object type!&quot;);
+
+        InspectorTest.log(&quot;Breakpoint resolved state changed: &quot; + breakpoint.resolved);
+    });
+
+    WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.AutoContinueDidChange, function(event) {
+        var breakpoint = event.target;
+        console.assert(breakpoint instanceof WebInspector.Breakpoint, &quot;Unexpected object type!&quot;);
+
+        InspectorTest.log(&quot;Breakpoint autocontinue state changed: &quot; + breakpoint.autoContinue);
+    });
+
+    WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ConditionDidChange, function(event) {
+        var breakpoint = event.target;
+        console.assert(breakpoint instanceof WebInspector.Breakpoint, &quot;Unexpected object type!&quot;);
+
+        InspectorTest.log(&quot;Breakpoint condition changed: &quot; + breakpoint.condition);
+    });
+
+    WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ActionsDidChange, function(event) {
+        var breakpoint = event.target;
+        console.assert(breakpoint instanceof WebInspector.Breakpoint, &quot;Unexpected object type!&quot;);
+
+        InspectorTest.log(&quot;Breakpoint actions changed. New count: &quot; + breakpoint.actions.length);
+    });
+}
+
+InspectorTest.startTracingProbes = function()
+{
+    if (!WebInspector.probeManager)
+        return;
+
+    WebInspector.probeManager.addEventListener(WebInspector.ProbeManager.Event.ProbeSetAdded, function(event) {
+        var probeSet = event.data.probeSet;
+        console.assert(probeSet instanceof WebInspector.ProbeSet, &quot;Unexpected object type!&quot;);
+
+        InspectorTest.log(&quot;Probe set was added. New count: &quot; + WebInspector.probeManager.probeSets.length);
+    });
+
+    WebInspector.probeManager.addEventListener(WebInspector.ProbeManager.Event.ProbeSetRemoved, function(event) {
+        var probeSet = event.data.probeSet;
+        console.assert(probeSet instanceof WebInspector.ProbeSet, &quot;Unexpected object type!&quot;);
+
+        InspectorTest.log(&quot;Probe set was removed. New count: &quot; + WebInspector.probeManager.probeSets.length);
+    });
+
+    WebInspector.Probe.addEventListener(WebInspector.Probe.Event.ExpressionChanged, function(event) {
+        var probe = event.target;
+        console.assert(probe instanceof WebInspector.Probe, &quot;Unexpected object type!&quot;);
+
+        InspectorTest.log(&quot;Probe with identifier &quot; + probe.id + &quot; changed expression: &quot; + probe.expression);
+    });
+
+    WebInspector.Probe.addEventListener(WebInspector.Probe.Event.SampleAdded, function(event) {
+        var probe = event.target;
+        var sample = event.data;
+        console.assert(probe instanceof WebInspector.Probe, &quot;Unexpected object type!&quot;);
+        console.assert(sample instanceof WebInspector.ProbeSample, &quot;Unexpected object type!&quot;);
+
+        InspectorTest.log(&quot;Probe with identifier &quot; + probe.id + &quot; added sample: &quot; + sample);
+    });
+
+    WebInspector.Probe.addEventListener(WebInspector.Probe.Event.SamplesCleared, function(event) {
+        var probe = event.target;
+        console.assert(probe instanceof WebInspector.Probe, &quot;Unexpected object type!&quot;);
+
+        InspectorTest.log(&quot;Probe with identifier &quot; + probe.id + &quot; cleared all samples.&quot;);
+    });
+
+    WebInspector.ProbeSet.addEventListener(WebInspector.ProbeSet.Event.ProbeAdded, function(event) {
+        var probe = event.data;
+        var probeSet = event.target;
+        console.assert(probe instanceof WebInspector.Probe, &quot;Unexpected object type!&quot;);
+        console.assert(probeSet instanceof WebInspector.ProbeSet, &quot;Unexpected object type!&quot;);
+
+        InspectorTest.log(&quot;Probe with identifier &quot; + probe.id + &quot; was added to probe set.&quot;);
+        InspectorTest.log(&quot;Probe set's probe count: &quot; + probeSet.probes.length);
+    });
+
+    WebInspector.ProbeSet.addEventListener(WebInspector.ProbeSet.Event.ProbeRemoved, function(event) {
+        var probe = event.data;
+        var probeSet = event.target;
+        console.assert(probe instanceof WebInspector.Probe, &quot;Unexpected object type!&quot;);
+        console.assert(probeSet instanceof WebInspector.ProbeSet, &quot;Unexpected object type!&quot;);
+
+        InspectorTest.log(&quot;Probe with identifier &quot; + probe.id + &quot; was removed from probe set.&quot;);
+        InspectorTest.log(&quot;Probe set's probe count: &quot; + probeSet.probes.length);
+    });
+}
+
+});
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsinspectordomshapestestjsfromrev166900trunkLayoutTestsinspectordomshapestestjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/http/tests/inspector/dom/shapes-test.js (from rev 166900, trunk/LayoutTests/inspector/dom/shapes-test.js) (0 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/inspector/dom/shapes-test.js                                (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/dom/shapes-test.js        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+InspectorTestProxy.registerInitializer(function() {
+
+InspectorTest.Shapes = {
+    getShapeOutsideInfoForSelector: function(selector, callback)
+    {
+        WebInspector.domTreeManager.requestDocument(requestDocumentCallback);
+
+        function requestDocumentCallback(node) {
+            InspectorTest.assert(node instanceof WebInspector.DOMNode, &quot;Unexpected argument to requestDocument callback.&quot;)
+            DOMAgent.querySelector.invoke({nodeId: node.id, selector: selector}, querySelectorCallback);
+        }
+
+        function querySelectorCallback(error, nodeId) {
+            InspectorTest.assert(!error, &quot;Error in callback for DOMAgent.querySelector&quot;);
+            InspectorTest.assert(nodeId, &quot;Invalid argument to callback for DOMAgent.querySelector&quot;);
+
+            var highlightConfig = {
+                showInfo: true,
+                contentColor: {r: 255, g: 255, b: 255},
+                paddingColor: {r: 255, g: 255, b: 255},
+                borderColor: {r: 255, g: 255, b: 255},
+                marginColor: {r: 255, g: 255, b: 255},
+            };
+            DOMAgent.highlightNode.invoke({nodeId: nodeId, highlightConfig: highlightConfig}, highlightNodeCallback);
+        }
+
+        function highlightNodeCallback(error) {
+            InspectorTest.assert(!error, &quot;Error in callback for DOMAgent.highlightNode&quot;);
+
+            InspectorTest.evaluateInPage(&quot;window.internals.inspectorHighlightObject()&quot;, receivedHighlightObject);
+        }
+
+        function receivedHighlightObject(error, payload, wasThrown) {
+            console.assert(!error, &quot;When evaluating code, received unexpected error:&quot; + error);
+            console.assert(!error, &quot;When evaluating code, an exception was thrown:&quot; + wasThrown);
+
+            var data = JSON.parse(payload.value);
+            callback(data.elementInfo.shapeOutsideInfo);
+        }
+    },
+
+    assertPathsAreRoughlyEqual: function(actual, expected, message)
+    {
+        function coordinatesAreRoughlyEqual(a, b) {
+            // Some platforms may only store integer path points, so the potential
+            // differences between correct paths can be roughly half a unit.
+            return typeof a === &quot;number&quot; &amp;&amp; typeof b === &quot;number&quot; &amp;&amp; Math.abs(a - b) &lt; 0.5;
+        }
+
+        function pathsAreRoughlyEqual(actualPath, expectedPath) {
+            var expectedSubpathStart = 0, ei, ai;
+            for (var ei = 0, ai = 0; ai &lt; actualPath.length &amp;&amp; ei &lt; expectedPath.length; ai++, ei++) {
+                if (expectedPath[ei] === 'M')
+                    expectedSubpathStart = ei;
+
+                if (actualPath[ai] === expectedPath[ei]
+                    || coordinatesAreRoughlyEqual(actualPath[ai], expectedPath[ei]))
+                    continue;
+
+                // Extrapolate the missing line to command if it is missing from actual.
+                // The choice to close the path with an explicit line to command is
+                // platform dependent.
+                if (actualPath[ai] === 'Z'
+                    &amp;&amp; expectedPath[ei] === 'L'
+                    &amp;&amp; coordinatesAreRoughlyEqual(expectedPath[expectedSubpathStart + 1], expectedPath[ei + 1])
+                    &amp;&amp; coordinatesAreRoughlyEqual(expectedPath[expectedSubpathStart + 2], expectedPath[ei + 2])) {
+                    ei += 2;
+                    ai--;
+                    continue;
+                }
+                return false;
+            }
+            return true;
+        }
+
+        function makeStringForPath(path) {
+            return path.map(function(item) {
+                if (typeof item === 'number')
+                    return +item.toFixed(2);
+                return item;
+            }).join(' ');
+        }
+
+        var expectedPathString = makeStringForPath(expected);
+        var actualPathString = makeStringForPath(actual);
+        var assertionMessage = message + &quot; \nEXPECTED: &quot; + expectedPathString + &quot;\n  ACTUAL: &quot; + actualPathString;
+        InspectorTest.assert(pathsAreRoughlyEqual(actual, expected), assertionMessage);
+    }
+}
+
+});
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsinspectorinspectortestjsfromrev166900trunkLayoutTestsinspectorinspectortestjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/http/tests/inspector/inspector-test.js (from rev 166900, trunk/LayoutTests/inspector/inspector-test.js) (0 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/inspector/inspector-test.js                                (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/inspector-test.js        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -0,0 +1,154 @@
</span><ins>+/*
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS
+ * IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// This namespace is injected into every test page. Its functions are invoked by
+// InspectorTest methods on the inspector page via RuntimeAgent.evaluate() calls.
+InspectorTestProxy = {};
+InspectorTestProxy._initializers = [];
+
+// Helper scripts like `debugger-test.js` must register their initialization
+// function with this method so it will be marshalled to the inspector page.
+InspectorTestProxy.registerInitializer = function(initializer)
+{
+    if (typeof initializer === &quot;function&quot;)
+        this._initializers.push(initializer.toString());
+}
+
+// This function is called by the test document's body onload handler.
+
+// It initializes the inspector and loads any `*-test.js` helper scripts
+// into the inspector page context.
+function runTest()
+{
+    // Don't try to use testRunner if running through the browser.
+    if (!window.testRunner)
+        return;
+
+    // Set up the test page before the load event fires.
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+
+    window.internals.setInspectorIsUnderTest(true);
+    testRunner.showWebInspector();
+
+    function runInitializationMethodsInFrontend(initializersArray)
+    {
+        InspectorTest.testPageDidLoad();
+
+        // If the test page reloaded but we started running the test in a previous
+        // navigation, then don't initialize the inspector frontend again.
+        if (InspectorTest.didInjectTestCode)
+            return;
+
+        for (var initializer of initializersArray) {
+            try {
+                initializer();
+            } catch (e) {
+                console.error(&quot;Exception in test initialization: &quot; + e, e.stack || &quot;(no stack trace)&quot;);
+                InspectorTest.completeTest();
+            }
+        }
+    }
+
+    function runTestMethodInFrontend(testFunction)
+    {
+        if (InspectorTest.didInjectTestCode)
+            return;
+
+        InspectorTest.didInjectTestCode = true;
+
+        try {
+            testFunction();
+        } catch (e) {
+            console.error(&quot;Exception during test execution: &quot; + e, e.stack || &quot;(no stack trace)&quot;);
+            InspectorTest.completeTest();
+        }
+    }
+
+    var codeStringToEvaluate = &quot;(&quot; + runInitializationMethodsInFrontend.toString() + &quot;)([&quot; + InspectorTestProxy._initializers + &quot;]);&quot;;
+    testRunner.evaluateInWebInspector(codeStringToEvaluate);
+
+    // `test` refers to a function defined in global scope in the test HTML page.
+    codeStringToEvaluate = &quot;(&quot; + runTestMethodInFrontend.toString() + &quot;)(&quot; + test.toString() + &quot;);&quot;;
+    testRunner.evaluateInWebInspector(codeStringToEvaluate);
+}
+
+InspectorTestProxy.completeTest = function()
+{
+    // Don't try to use testRunner if running through the browser.
+    if (!window.testRunner)
+        return;
+
+    // Close inspector asynchrously in case we want to test tear-down behavior.
+    setTimeout(function() {
+        testRunner.closeWebInspector();
+        setTimeout(function() {
+            testRunner.notifyDone();
+        }, 0);
+    }, 0);
+}
+
+// Logs message to unbuffered process stdout, avoiding timeouts.
+// only be used to debug tests and not to produce normal test output.
+InspectorTestProxy.debugLog = function(message)
+{
+    window.alert(message);
+}
+
+// Add and clear test output from the results window.
+InspectorTestProxy.addResult = function(text)
+{
+    // For early errors triggered when loading the test page, write to stderr.
+    if (!document.body) {
+        this.debugLog(text);
+        this.completeTest();
+    }
+
+    if (!this._resultElement) {
+        this._resultElement = document.createElement(&quot;pre&quot;);
+        this._resultElement.id = &quot;output&quot;;
+        document.body.appendChild(this._resultElement);
+    }
+    this._resultElement.appendChild(document.createTextNode(text));
+    this._resultElement.appendChild(document.createElement(&quot;br&quot;));
+}
+
+InspectorTestProxy.clearResults = function()
+{
+    if (this._resultElement) {
+        this._resultElement.parentNode.removeChild(this._resultElement);
+        delete this._resultElement;
+    }
+}
+
+InspectorTestProxy.reportUncaughtException = function(message, url, lineNumber)
+{
+    var result = &quot;Uncaught exception in test page: &quot; + message + &quot; [&quot; + url + &quot;:&quot; + lineNumber + &quot;]&quot;;
+    InspectorTestProxy.addResult(result);
+    InspectorTestProxy.completeTest();
+}
+
+// Catch syntax errors, type errors, and other exceptions. Run this before loading other files.
+window.onerror = InspectorTestProxy.reportUncaughtException;
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsinspectorreplayreplaytestjsfromrev166900trunkLayoutTestsinspectorreplayreplaytestjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/http/tests/inspector/replay/replay-test.js (from rev 166900, trunk/LayoutTests/inspector/replay/replay-test.js) (0 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/inspector/replay/replay-test.js                                (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/replay/replay-test.js        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+InspectorTestProxy.registerInitializer(function() {
+
+InspectorTest.Replay = {};
+
+InspectorTest.Replay.runSingleSegmentRefTest = function(stateComparator)
+{
+    var stateDuringCapturing = null;
+    var stateDuringReplaying = null;
+
+    var ignoreCacheOnReload = true;
+    InspectorTest.reloadPage(ignoreCacheOnReload)
+    .then(function() {
+        return new Promise(function waitForMainResourceBeforeStarting(resolve, reject) {
+            InspectorTest.eventDispatcher.addEventListener(InspectorTest.EventDispatcher.Event.TestPageDidLoad, resolve);
+            InspectorTest.log(&quot;Waiting for test page to finish its initial load...&quot;);
+        });
+    })
+    .then(function() {
+        InspectorTest.log(&quot;Test page initial load done.&quot;);
+        return new Promise(function startCapturing(resolve, reject) {
+            InspectorTest.log(&quot;Waiting for capturing to start...&quot;);
+            WebInspector.replayManager.startCapturing();
+            WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.CaptureStarted, resolve);
+        });
+    })
+    .then(function() {
+        InspectorTest.log(&quot;Capturing has started.&quot;);
+        return new Promise(function waitToCaptureInitialNavigation(resolve, reject) {
+            InspectorTest.log(&quot;Waiting to capture initial navigation...&quot;);
+            InspectorTest.eventDispatcher.addEventListener(InspectorTest.EventDispatcher.Event.TestPageDidLoad, resolve);
+        });
+    })
+    .then(function() {
+        InspectorTest.log(&quot;Initial navigation captured. Dumping state....&quot;);
+        return RuntimeAgent.evaluate.promise(&quot;dumpNondeterministicState()&quot;);
+    })
+    .then(function(payload) {
+        stateDuringCapturing = payload.value;
+        return new Promise(function stopCapturing(resolve, reject) {
+            WebInspector.replayManager.stopCapturing();
+            WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.CaptureStopped, resolve);
+        });
+    })
+    .then(function() {
+        InspectorTest.log(&quot;Capture stopped, now starting replay to completion...&quot;)
+        return new Promise(function startPlayback(resolve, reject) {
+            WebInspector.replayManager.replayToCompletion();
+            WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.PlaybackStarted, resolve);
+        });
+    })
+    .then(function() {
+        InspectorTest.log(&quot;Playback has started.&quot;);
+        return new Promise(function waitForMainResourceWhenReplaying(resolve, reject) {
+            InspectorTest.log(&quot;Waiting to replay initial navigation...&quot;);
+            InspectorTest.eventDispatcher.addEventListener(InspectorTest.EventDispatcher.Event.TestPageDidLoad, resolve);
+        });
+    })
+    .then(function() {
+        InspectorTest.log(&quot;Initial navigation replayed. Dumping state...&quot;);
+        return RuntimeAgent.evaluate.promise(&quot;dumpNondeterministicState()&quot;);
+    })
+    .then(function(payload) {
+        stateDuringReplaying = payload.value;
+        return new Promise(function waitForReplayingToFinish(resolve, reject) {
+            WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.PlaybackFinished, resolve);
+        });
+    })
+    .then(function() {
+        var statesEqual = stateDuringCapturing === stateDuringReplaying;
+        InspectorTest.expectThat(statesEqual, &quot;Nondeterministic state should not differ during capture and replay.&quot;);
+        if (!statesEqual) {
+            InspectorTest.log(&quot;State during capturing: &quot; + stateDuringCapturing);
+            InspectorTest.log(&quot;State during replaying: &quot; + stateDuringReplaying);
+        }
+        InspectorTest.completeTest();
+    });
+};
+
+});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerdebuggertestjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/inspector/debugger/debugger-test.js (166900 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/debugger-test.js        2014-04-08 00:39:55 UTC (rev 166900)
+++ trunk/LayoutTests/inspector/debugger/debugger-test.js        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -1,115 +0,0 @@
</span><del>-InspectorTestProxy.registerInitializer(function() {
-
-InspectorTest.startTracingBreakpoints = function()
-{
-    if (!WebInspector.debuggerManager)
-        return;
-
-    WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointAdded, function(event) {
-        InspectorTest.log(&quot;Breakpoint was added.&quot;);
-    });
-
-    WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointRemoved, function(event) {
-        InspectorTest.log(&quot;Breakpoint was removed.&quot;);
-    });
-
-    WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisabledStateDidChange, function(event) {
-        var breakpoint = event.target;
-        console.assert(breakpoint instanceof WebInspector.Breakpoint, &quot;Unexpected object type!&quot;);
-
-        InspectorTest.log(&quot;Breakpoint disabled state changed: &quot; + breakpoint.disabled);
-    });
-
-    WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ResolvedStateDidChange, function(event) {
-        var breakpoint = event.target;
-        console.assert(breakpoint instanceof WebInspector.Breakpoint, &quot;Unexpected object type!&quot;);
-
-        InspectorTest.log(&quot;Breakpoint resolved state changed: &quot; + breakpoint.resolved);
-    });
-
-    WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.AutoContinueDidChange, function(event) {
-        var breakpoint = event.target;
-        console.assert(breakpoint instanceof WebInspector.Breakpoint, &quot;Unexpected object type!&quot;);
-
-        InspectorTest.log(&quot;Breakpoint autocontinue state changed: &quot; + breakpoint.autoContinue);
-    });
-
-    WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ConditionDidChange, function(event) {
-        var breakpoint = event.target;
-        console.assert(breakpoint instanceof WebInspector.Breakpoint, &quot;Unexpected object type!&quot;);
-
-        InspectorTest.log(&quot;Breakpoint condition changed: &quot; + breakpoint.condition);
-    });
-
-    WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ActionsDidChange, function(event) {
-        var breakpoint = event.target;
-        console.assert(breakpoint instanceof WebInspector.Breakpoint, &quot;Unexpected object type!&quot;);
-
-        InspectorTest.log(&quot;Breakpoint actions changed. New count: &quot; + breakpoint.actions.length);
-    });
-}
-
-InspectorTest.startTracingProbes = function()
-{
-    if (!WebInspector.probeManager)
-        return;
-
-    WebInspector.probeManager.addEventListener(WebInspector.ProbeManager.Event.ProbeSetAdded, function(event) {
-        var probeSet = event.data.probeSet;
-        console.assert(probeSet instanceof WebInspector.ProbeSet, &quot;Unexpected object type!&quot;);
-
-        InspectorTest.log(&quot;Probe set was added. New count: &quot; + WebInspector.probeManager.probeSets.length);
-    });
-
-    WebInspector.probeManager.addEventListener(WebInspector.ProbeManager.Event.ProbeSetRemoved, function(event) {
-        var probeSet = event.data.probeSet;
-        console.assert(probeSet instanceof WebInspector.ProbeSet, &quot;Unexpected object type!&quot;);
-
-        InspectorTest.log(&quot;Probe set was removed. New count: &quot; + WebInspector.probeManager.probeSets.length);
-    });
-
-    WebInspector.Probe.addEventListener(WebInspector.Probe.Event.ExpressionChanged, function(event) {
-        var probe = event.target;
-        console.assert(probe instanceof WebInspector.Probe, &quot;Unexpected object type!&quot;);
-
-        InspectorTest.log(&quot;Probe with identifier &quot; + probe.id + &quot; changed expression: &quot; + probe.expression);
-    });
-
-    WebInspector.Probe.addEventListener(WebInspector.Probe.Event.SampleAdded, function(event) {
-        var probe = event.target;
-        var sample = event.data;
-        console.assert(probe instanceof WebInspector.Probe, &quot;Unexpected object type!&quot;);
-        console.assert(sample instanceof WebInspector.ProbeSample, &quot;Unexpected object type!&quot;);
-
-        InspectorTest.log(&quot;Probe with identifier &quot; + probe.id + &quot; added sample: &quot; + sample);
-    });
-
-    WebInspector.Probe.addEventListener(WebInspector.Probe.Event.SamplesCleared, function(event) {
-        var probe = event.target;
-        console.assert(probe instanceof WebInspector.Probe, &quot;Unexpected object type!&quot;);
-
-        InspectorTest.log(&quot;Probe with identifier &quot; + probe.id + &quot; cleared all samples.&quot;);
-    });
-
-    WebInspector.ProbeSet.addEventListener(WebInspector.ProbeSet.Event.ProbeAdded, function(event) {
-        var probe = event.data;
-        var probeSet = event.target;
-        console.assert(probe instanceof WebInspector.Probe, &quot;Unexpected object type!&quot;);
-        console.assert(probeSet instanceof WebInspector.ProbeSet, &quot;Unexpected object type!&quot;);
-
-        InspectorTest.log(&quot;Probe with identifier &quot; + probe.id + &quot; was added to probe set.&quot;);
-        InspectorTest.log(&quot;Probe set's probe count: &quot; + probeSet.probes.length);
-    });
-
-    WebInspector.ProbeSet.addEventListener(WebInspector.ProbeSet.Event.ProbeRemoved, function(event) {
-        var probe = event.data;
-        var probeSet = event.target;
-        console.assert(probe instanceof WebInspector.Probe, &quot;Unexpected object type!&quot;);
-        console.assert(probeSet instanceof WebInspector.ProbeSet, &quot;Unexpected object type!&quot;);
-
-        InspectorTest.log(&quot;Probe with identifier &quot; + probe.id + &quot; was removed from probe set.&quot;);
-        InspectorTest.log(&quot;Probe set's probe count: &quot; + probeSet.probes.length);
-    });
-}
-
-});
</del></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerprobemanageraddremoveactionshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/debugger/probe-manager-add-remove-actions.html (166900 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/probe-manager-add-remove-actions.html        2014-04-08 00:39:55 UTC (rev 166900)
+++ trunk/LayoutTests/inspector/debugger/probe-manager-add-remove-actions.html        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -1,8 +1,8 @@
</span><span class="cx"> &lt;!doctype html&gt;
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><del>-&lt;script type=&quot;text/javascript&quot; src=&quot;../inspector-test.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;./debugger-test.js&quot;&gt;&lt;/script&gt;
</del><ins>+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/debugger/debugger-test.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script type=&quot;text/javascript&quot; src=&quot;./resources/breakpoint.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script&gt;
</span><span class="cx"> function test()
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomcontentflowcontentnodeshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/dom/content-flow-content-nodes.html (166900 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/content-flow-content-nodes.html        2014-04-08 00:39:55 UTC (rev 166900)
+++ trunk/LayoutTests/inspector/dom/content-flow-content-nodes.html        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -11,7 +11,7 @@
</span><span class="cx">     -webkit-flow-into: none;
</span><span class="cx"> }
</span><span class="cx"> &lt;/style&gt;
</span><del>-&lt;script type=&quot;text/javascript&quot; src=&quot;../inspector-test.js&quot;&gt;&lt;/script&gt;
</del><ins>+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script&gt;
</span><span class="cx"> function changeFlowContent()
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomcontentflowcontentremovalhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/dom/content-flow-content-removal.html (166900 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/content-flow-content-removal.html        2014-04-08 00:39:55 UTC (rev 166900)
+++ trunk/LayoutTests/inspector/dom/content-flow-content-removal.html        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx">     -webkit-flow-into: flow;
</span><span class="cx"> }
</span><span class="cx"> &lt;/style&gt;
</span><del>-&lt;script type=&quot;text/javascript&quot; src=&quot;../inspector-test.js&quot;&gt;&lt;/script&gt;
</del><ins>+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script&gt;
</span><span class="cx"> function changeFlowContent()
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomcontentflowlisthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/dom/content-flow-list.html (166900 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/content-flow-list.html        2014-04-08 00:39:55 UTC (rev 166900)
+++ trunk/LayoutTests/inspector/dom/content-flow-list.html        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx">     -webkit-flow-into: flow1;
</span><span class="cx"> }
</span><span class="cx"> &lt;/style&gt;
</span><del>-&lt;script type=&quot;text/javascript&quot; src=&quot;../inspector-test.js&quot;&gt;&lt;/script&gt;
</del><ins>+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script&gt;
</span><span class="cx"> function removeFlow()
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomcontentnoderegioninfohtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/dom/content-node-region-info.html (166900 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/content-node-region-info.html        2014-04-08 00:39:55 UTC (rev 166900)
+++ trunk/LayoutTests/inspector/dom/content-node-region-info.html        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx">     height: 100px;
</span><span class="cx"> }
</span><span class="cx"> &lt;/style&gt;
</span><del>-&lt;script type=&quot;text/javascript&quot; src=&quot;../inspector-test.js&quot;&gt;&lt;/script&gt;
</del><ins>+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script&gt;
</span><span class="cx"> function test()
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightshapeoutsidemarginhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/dom/highlight-shape-outside-margin.html (166900 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlight-shape-outside-margin.html        2014-04-08 00:39:55 UTC (rev 166900)
+++ trunk/LayoutTests/inspector/dom/highlight-shape-outside-margin.html        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -24,8 +24,8 @@
</span><span class="cx">     -webkit-shape-margin: 1px;
</span><span class="cx"> }
</span><span class="cx"> &lt;/style&gt;
</span><del>-&lt;script type=&quot;text/javascript&quot; src=&quot;../inspector-test.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;./shapes-test.js&quot;&gt;&lt;/script&gt;
</del><ins>+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/dom/shapes-test.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script&gt;
</span><span class="cx"> function test() {
</span><span class="cx">     var testcases = [
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightshapeoutsidehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/dom/highlight-shape-outside.html (166900 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlight-shape-outside.html        2014-04-08 00:39:55 UTC (rev 166900)
+++ trunk/LayoutTests/inspector/dom/highlight-shape-outside.html        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -52,8 +52,8 @@
</span><span class="cx">    -webkit-shape-outside: url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAABHPGVmAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRFAAD/////e9yZLAAAAAJ0Uk5T/wDltzBKAAAASUlEQVR42uzYsQ0AMAgEsWf/pTMDBURIvgXcX2qhQCAQCAQCgUA+I2kHgUAgEAgEAoFAIBAIBAKBQOYRoxMCgUAgEAjkHPIEGAA2ih1NVnaDGgAAAABJRU5ErkJggg==&quot;);
</span><span class="cx"> }
</span><span class="cx"> &lt;/style&gt;
</span><del>-&lt;script type=&quot;text/javascript&quot; src=&quot;../inspector-test.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;./shapes-test.js&quot;&gt;&lt;/script&gt;
</del><ins>+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/dom/shapes-test.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script&gt;
</span><span class="cx"> function test() {
</span><span class="cx">     var testcases = [
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomshapestestjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/inspector/dom/shapes-test.js (166900 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/shapes-test.js        2014-04-08 00:39:55 UTC (rev 166900)
+++ trunk/LayoutTests/inspector/dom/shapes-test.js        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -1,91 +0,0 @@
</span><del>-InspectorTestProxy.registerInitializer(function() {
-
-InspectorTest.Shapes = {
-    getShapeOutsideInfoForSelector: function(selector, callback)
-    {
-        WebInspector.domTreeManager.requestDocument(requestDocumentCallback);
-
-        function requestDocumentCallback(node) {
-            InspectorTest.assert(node instanceof WebInspector.DOMNode, &quot;Unexpected argument to requestDocument callback.&quot;)
-            DOMAgent.querySelector.invoke({nodeId: node.id, selector: selector}, querySelectorCallback);
-        }
-
-        function querySelectorCallback(error, nodeId) {
-            InspectorTest.assert(!error, &quot;Error in callback for DOMAgent.querySelector&quot;);
-            InspectorTest.assert(nodeId, &quot;Invalid argument to callback for DOMAgent.querySelector&quot;);
-
-            var highlightConfig = {
-                showInfo: true,
-                contentColor: {r: 255, g: 255, b: 255},
-                paddingColor: {r: 255, g: 255, b: 255},
-                borderColor: {r: 255, g: 255, b: 255},
-                marginColor: {r: 255, g: 255, b: 255},
-            };
-            DOMAgent.highlightNode.invoke({nodeId: nodeId, highlightConfig: highlightConfig}, highlightNodeCallback);
-        }
-
-        function highlightNodeCallback(error) {
-            InspectorTest.assert(!error, &quot;Error in callback for DOMAgent.highlightNode&quot;);
-
-            InspectorTest.evaluateInPage(&quot;window.internals.inspectorHighlightObject()&quot;, receivedHighlightObject);
-        }
-
-        function receivedHighlightObject(error, payload, wasThrown) {
-            console.assert(!error, &quot;When evaluating code, received unexpected error:&quot; + error);
-            console.assert(!error, &quot;When evaluating code, an exception was thrown:&quot; + wasThrown);
-
-            var data = JSON.parse(payload.value);
-            callback(data.elementInfo.shapeOutsideInfo);
-        }
-    },
-
-    assertPathsAreRoughlyEqual: function(actual, expected, message)
-    {
-        function coordinatesAreRoughlyEqual(a, b) {
-            // Some platforms may only store integer path points, so the potential
-            // differences between correct paths can be roughly half a unit.
-            return typeof a === &quot;number&quot; &amp;&amp; typeof b === &quot;number&quot; &amp;&amp; Math.abs(a - b) &lt; 0.5;
-        }
-
-        function pathsAreRoughlyEqual(actualPath, expectedPath) {
-            var expectedSubpathStart = 0, ei, ai;
-            for (var ei = 0, ai = 0; ai &lt; actualPath.length &amp;&amp; ei &lt; expectedPath.length; ai++, ei++) {
-                if (expectedPath[ei] === 'M')
-                    expectedSubpathStart = ei;
-
-                if (actualPath[ai] === expectedPath[ei]
-                    || coordinatesAreRoughlyEqual(actualPath[ai], expectedPath[ei]))
-                    continue;
-
-                // Extrapolate the missing line to command if it is missing from actual.
-                // The choice to close the path with an explicit line to command is
-                // platform dependent.
-                if (actualPath[ai] === 'Z'
-                    &amp;&amp; expectedPath[ei] === 'L'
-                    &amp;&amp; coordinatesAreRoughlyEqual(expectedPath[expectedSubpathStart + 1], expectedPath[ei + 1])
-                    &amp;&amp; coordinatesAreRoughlyEqual(expectedPath[expectedSubpathStart + 2], expectedPath[ei + 2])) {
-                    ei += 2;
-                    ai--;
-                    continue;
-                }
-                return false;
-            }
-            return true;
-        }
-
-        function makeStringForPath(path) {
-            return path.map(function(item) {
-                if (typeof item === 'number')
-                    return +item.toFixed(2);
-                return item;
-            }).join(' ');
-        }
-
-        var expectedPathString = makeStringForPath(expected);
-        var actualPathString = makeStringForPath(actual);
-        var assertionMessage = message + &quot; \nEXPECTED: &quot; + expectedPathString + &quot;\n  ACTUAL: &quot; + actualPathString;
-        InspectorTest.assert(pathsAreRoughlyEqual(actual, expected), assertionMessage);
-    }
-}
-
-});
</del></span></pre></div>
<a id="trunkLayoutTestsinspectorinspectortestjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/inspector/inspector-test.js (166900 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/inspector-test.js        2014-04-08 00:39:55 UTC (rev 166900)
+++ trunk/LayoutTests/inspector/inspector-test.js        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -1,154 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS
- * IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-// This namespace is injected into every test page. Its functions are invoked by
-// InspectorTest methods on the inspector page via RuntimeAgent.evaluate() calls.
-InspectorTestProxy = {};
-InspectorTestProxy._initializers = [];
-
-// Helper scripts like `debugger-test.js` must register their initialization
-// function with this method so it will be marshalled to the inspector page.
-InspectorTestProxy.registerInitializer = function(initializer)
-{
-    if (typeof initializer === &quot;function&quot;)
-        this._initializers.push(initializer.toString());
-}
-
-// This function is called by the test document's body onload handler.
-
-// It initializes the inspector and loads any `*-test.js` helper scripts
-// into the inspector page context.
-function runTest()
-{
-    // Don't try to use testRunner if running through the browser.
-    if (!window.testRunner)
-        return;
-
-    // Set up the test page before the load event fires.
-    testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-
-    window.internals.setInspectorIsUnderTest(true);
-    testRunner.showWebInspector();
-
-    function runInitializationMethodsInFrontend(initializersArray)
-    {
-        InspectorTest.testPageDidLoad();
-
-        // If the test page reloaded but we started running the test in a previous
-        // navigation, then don't initialize the inspector frontend again.
-        if (InspectorTest.didInjectTestCode)
-            return;
-
-        for (var initializer of initializersArray) {
-            try {
-                initializer();
-            } catch (e) {
-                console.error(&quot;Exception in test initialization: &quot; + e, e.stack || &quot;(no stack trace)&quot;);
-                InspectorTest.completeTest();
-            }
-        }
-    }
-
-    function runTestMethodInFrontend(testFunction)
-    {
-        if (InspectorTest.didInjectTestCode)
-            return;
-
-        InspectorTest.didInjectTestCode = true;
-
-        try {
-            testFunction();
-        } catch (e) {
-            console.error(&quot;Exception during test execution: &quot; + e, e.stack || &quot;(no stack trace)&quot;);
-            InspectorTest.completeTest();
-        }
-    }
-
-    var codeStringToEvaluate = &quot;(&quot; + runInitializationMethodsInFrontend.toString() + &quot;)([&quot; + InspectorTestProxy._initializers + &quot;]);&quot;;
-    testRunner.evaluateInWebInspector(codeStringToEvaluate);
-
-    // `test` refers to a function defined in global scope in the test HTML page.
-    codeStringToEvaluate = &quot;(&quot; + runTestMethodInFrontend.toString() + &quot;)(&quot; + test.toString() + &quot;);&quot;;
-    testRunner.evaluateInWebInspector(codeStringToEvaluate);
-}
-
-InspectorTestProxy.completeTest = function()
-{
-    // Don't try to use testRunner if running through the browser.
-    if (!window.testRunner)
-        return;
-
-    // Close inspector asynchrously in case we want to test tear-down behavior.
-    setTimeout(function() {
-        testRunner.closeWebInspector();
-        setTimeout(function() {
-            testRunner.notifyDone();
-        }, 0);
-    }, 0);
-}
-
-// Logs message to unbuffered process stdout, avoiding timeouts.
-// only be used to debug tests and not to produce normal test output.
-InspectorTestProxy.debugLog = function(message)
-{
-    window.alert(message);
-}
-
-// Add and clear test output from the results window.
-InspectorTestProxy.addResult = function(text)
-{
-    // For early errors triggered when loading the test page, write to stderr.
-    if (!document.body) {
-        this.debugLog(text);
-        this.completeTest();
-    }
-
-    if (!this._resultElement) {
-        this._resultElement = document.createElement(&quot;pre&quot;);
-        this._resultElement.id = &quot;output&quot;;
-        document.body.appendChild(this._resultElement);
-    }
-    this._resultElement.appendChild(document.createTextNode(text));
-    this._resultElement.appendChild(document.createElement(&quot;br&quot;));
-}
-
-InspectorTestProxy.clearResults = function()
-{
-    if (this._resultElement) {
-        this._resultElement.parentNode.removeChild(this._resultElement);
-        delete this._resultElement;
-    }
-}
-
-InspectorTestProxy.reportUncaughtException = function(message, url, lineNumber)
-{
-    var result = &quot;Uncaught exception in test page: &quot; + message + &quot; [&quot; + url + &quot;:&quot; + lineNumber + &quot;]&quot;;
-    InspectorTestProxy.addResult(result);
-    InspectorTestProxy.completeTest();
-}
-
-// Catch syntax errors, type errors, and other exceptions. Run this before loading other files.
-window.onerror = InspectorTestProxy.reportUncaughtException;
</del></span></pre></div>
<a id="trunkLayoutTestsinspectorpagemainframeresourcehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/page/main-frame-resource.html (166900 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/page/main-frame-resource.html        2014-04-08 00:39:55 UTC (rev 166900)
+++ trunk/LayoutTests/inspector/page/main-frame-resource.html        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> &lt;!doctype html&gt;
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><del>-&lt;script type=&quot;text/javascript&quot; src=&quot;../inspector-test.js&quot;&gt;&lt;/script&gt;
</del><ins>+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script&gt;
</span><span class="cx"> function test()
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorreplayjavascriptdatenowhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/replay/javascript-date-now.html (166900 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/replay/javascript-date-now.html        2014-04-08 00:39:55 UTC (rev 166900)
+++ trunk/LayoutTests/inspector/replay/javascript-date-now.html        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><del>-&lt;script type=&quot;text/javascript&quot; src=&quot;../inspector-test.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;./replay-test.js&quot;&gt;&lt;/script&gt;
</del><ins>+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/replay/replay-test.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script&gt;
</span><span class="cx"> 
</span><span class="cx"> window._times = [Date.now(), new Date().toString()];
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorreplayjavascriptrandomseedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/replay/javascript-random-seed.html (166900 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/replay/javascript-random-seed.html        2014-04-08 00:39:55 UTC (rev 166900)
+++ trunk/LayoutTests/inspector/replay/javascript-random-seed.html        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><del>-&lt;script type=&quot;text/javascript&quot; src=&quot;../inspector-test.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;./replay-test.js&quot;&gt;&lt;/script&gt;
</del><ins>+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/replay/replay-test.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script&gt;
</span><span class="cx"> 
</span><span class="cx"> window._randomNumber = Math.random();
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorreplayreplaytestjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/inspector/replay/replay-test.js (166900 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/replay/replay-test.js        2014-04-08 00:39:55 UTC (rev 166900)
+++ trunk/LayoutTests/inspector/replay/replay-test.js        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -1,79 +0,0 @@
</span><del>-InspectorTestProxy.registerInitializer(function() {
-
-InspectorTest.Replay = {};
-
-InspectorTest.Replay.runSingleSegmentRefTest = function(stateComparator)
-{
-    var stateDuringCapturing = null;
-    var stateDuringReplaying = null;
-
-    var ignoreCacheOnReload = true;
-    InspectorTest.reloadPage(ignoreCacheOnReload)
-    .then(function() {
-        return new Promise(function waitForMainResourceBeforeStarting(resolve, reject) {
-            InspectorTest.eventDispatcher.addEventListener(InspectorTest.EventDispatcher.Event.TestPageDidLoad, resolve);
-            InspectorTest.log(&quot;Waiting for test page to finish its initial load...&quot;);
-        });
-    })
-    .then(function() {
-        InspectorTest.log(&quot;Test page initial load done.&quot;);
-        return new Promise(function startCapturing(resolve, reject) {
-            InspectorTest.log(&quot;Waiting for capturing to start...&quot;);
-            WebInspector.replayManager.startCapturing();
-            WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.CaptureStarted, resolve);
-        });
-    })
-    .then(function() {
-        InspectorTest.log(&quot;Capturing has started.&quot;);
-        return new Promise(function waitToCaptureInitialNavigation(resolve, reject) {
-            InspectorTest.log(&quot;Waiting to capture initial navigation...&quot;);
-            InspectorTest.eventDispatcher.addEventListener(InspectorTest.EventDispatcher.Event.TestPageDidLoad, resolve);
-        });
-    })
-    .then(function() {
-        InspectorTest.log(&quot;Initial navigation captured. Dumping state....&quot;);
-        return RuntimeAgent.evaluate.promise(&quot;dumpNondeterministicState()&quot;);
-    })
-    .then(function(payload) {
-        stateDuringCapturing = payload.value;
-        return new Promise(function stopCapturing(resolve, reject) {
-            WebInspector.replayManager.stopCapturing();
-            WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.CaptureStopped, resolve);
-        });
-    })
-    .then(function() {
-        InspectorTest.log(&quot;Capture stopped, now starting replay to completion...&quot;)
-        return new Promise(function startPlayback(resolve, reject) {
-            WebInspector.replayManager.replayToCompletion();
-            WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.PlaybackStarted, resolve);
-        });
-    })
-    .then(function() {
-        InspectorTest.log(&quot;Playback has started.&quot;);
-        return new Promise(function waitForMainResourceWhenReplaying(resolve, reject) {
-            InspectorTest.log(&quot;Waiting to replay initial navigation...&quot;);
-            InspectorTest.eventDispatcher.addEventListener(InspectorTest.EventDispatcher.Event.TestPageDidLoad, resolve);
-        });
-    })
-    .then(function() {
-        InspectorTest.log(&quot;Initial navigation replayed. Dumping state...&quot;);
-        return RuntimeAgent.evaluate.promise(&quot;dumpNondeterministicState()&quot;);
-    })
-    .then(function(payload) {
-        stateDuringReplaying = payload.value;
-        return new Promise(function waitForReplayingToFinish(resolve, reject) {
-            WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.PlaybackFinished, resolve);
-        });
-    })
-    .then(function() {
-        var statesEqual = stateDuringCapturing === stateDuringReplaying;
-        InspectorTest.expectThat(statesEqual, &quot;Nondeterministic state should not differ during capture and replay.&quot;);
-        if (!statesEqual) {
-            InspectorTest.log(&quot;State during capturing: &quot; + stateDuringCapturing);
-            InspectorTest.log(&quot;State during replaying: &quot; + stateDuringReplaying);
-        }
-        InspectorTest.completeTest();
-    });
-};
-
-});
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsinspectortestharnesstriviallyworkshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/test-harness-trivially-works.html (166900 => 166901)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/test-harness-trivially-works.html        2014-04-08 00:39:55 UTC (rev 166900)
+++ trunk/LayoutTests/inspector/test-harness-trivially-works.html        2014-04-08 00:56:37 UTC (rev 166901)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><del>-&lt;script type=&quot;text/javascript&quot; src=&quot;inspector-test.js&quot;&gt;&lt;/script&gt;
</del><ins>+&lt;script type=&quot;text/javascript&quot; src=&quot;../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script&gt;
</span><span class="cx"> function test()
</span><span class="cx"> {
</span></span></pre>
</div>
</div>

</body>
</html>