<!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>[165501] 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/165501">165501</a></dd>
<dt>Author</dt> <dd>bburg@apple.com</dd>
<dt>Date</dt> <dd>2014-03-12 15:16:53 -0700 (Wed, 12 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: convert model tests and inspector-test.js to use Test.html
https://bugs.webkit.org/show_bug.cgi?id=129217

Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

Miscellaneous changes to make the inspector model test harness work well in
scenarios where the test page must navigate or reload. Also improve reporting
test failures so that messages will be dumped correctly even when an exception
is thrown in the Inspector or the test times out.

* UserInterface/Base/Test.js:
(WebInspector.loaded): register new managers and observers.
(InspectorTest.log): Stringify the argument if it's an object.
(InspectorTest.assert): Stringify the argument if it's an object. Don't log
unless the condition is false.

(InspectorTest.expectThat): Added. Like assert(), but always logs.
(InspectorTest.debugLog): Escape and unescape the string properly.
(InspectorTest.completeTest): Fix teardown so messages are not lost.
(InspectorTest.evaluateInPage): Accept a callback argument.
(InspectorTest.addResult): Don't rebuild results when adding a new result.
(InspectorTest._resendResults.decrementPendingResponseCount): Added.

(InspectorTest._resendResults): Added. Track the number of pending
responses and invoke a given callback when everything has been resent.

(InspectorTest.testPageDidLoad): Renamed from `pageLoaded`.
(InspectorTest.reloadPage): Added.
(InspectorTest.reportUncaughtException): Prevent the default handler from running.
* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackendClass.prototype.dispatch): Report uncaught exceptions when dispatching
messages on the inspector page without blowing away the entire call stack.

* UserInterface/Test.html: Add files used by Network and Timeline domains.

LayoutTests:

* TestExpectations: Add flaky content-flow and failing shape-outside inspector tests.
* inspector-protocol/model/probe-manager-add-remove-actions.html: Removed.
* inspector-protocol/resources/shape-info-helper.js: Removed.
* inspector/debugger/debugger-test.js: Added.
(InspectorTestProxy.registerInitializer.):
(InspectorTestProxy.registerInitializer):
* inspector/debugger/probe-manager-add-remove-actions-expected.txt: Renamed from LayoutTests/inspector-protocol/model/probe-manager-add-remove-actions-expected.txt.
* inspector/debugger/probe-manager-add-remove-actions.html: Added.
* inspector/debugger/resources/breakpoint.js: Added. Copied from LayoutTests/inspector-protocol/.
(breakpointActions):
* inspector/dom/content-flow-content-nodes-expected.txt: Renamed from LayoutTests/inspector-protocol/model/content-flow-content-nodes-expected.txt.
* inspector/dom/content-flow-content-nodes.html: Renamed from LayoutTests/inspector-protocol/model/content-flow-content-nodes.html.
* inspector/dom/content-flow-content-removal-expected.txt: Renamed from LayoutTests/inspector-protocol/model/content-flow-content-removal-expected.txt.
* inspector/dom/content-flow-content-removal.html: Renamed from LayoutTests/inspector-protocol/model/content-flow-content-removal.html.
* inspector/dom/content-flow-list-expected.txt: Renamed from LayoutTests/inspector-protocol/model/content-flow-list-expected.txt.
* inspector/dom/content-flow-list.html: Renamed from LayoutTests/inspector-protocol/model/content-flow-list.html.
* inspector/dom/content-node-region-info-expected.txt: Renamed from LayoutTests/inspector-protocol/model/content-node-region-info-expected.txt.
* inspector/dom/content-node-region-info.html: Renamed from LayoutTests/inspector-protocol/model/content-node-region-info.html.
* inspector/dom/highlight-shape-outside-expected.txt: Renamed from LayoutTests/inspector-protocol/model/highlight-shape-outside-expected.txt.
* inspector/dom/highlight-shape-outside-margin-expected.txt: Renamed from LayoutTests/inspector-protocol/model/highlight-shape-outside-margin-expected.txt.
* inspector/dom/highlight-shape-outside-margin.html: Renamed from LayoutTests/inspector-protocol/model/highlight-shape-outside-margin.html.
* inspector/dom/highlight-shape-outside.html: Renamed from LayoutTests/inspector-protocol/model/highlight-shape-outside.html.
* inspector/dom/shapes-test.js: Added. Refactor existing shape helpers to use model objects
where it makes sense, and use easy-to-read assertions.
(InspectorTestProxy.registerInitializer.):
* inspector/inspector-test.js: Handle reloaded test pages better. Use better names.
(InspectorTestProxy.registerInitializer): Renamed from `register`.
(runTest.runInitializationMethodsInFrontend):
(runTest.runTestMethodInFrontend):
(runTest):
(InspectorTestProxy.completeTest):
* inspector/page/main-frame-resource-expected.txt: Renamed from LayoutTests/inspector-protocol/model/main-frame-resource-expected.txt.
* inspector/page/main-frame-resource.html: Renamed from LayoutTests/inspector-protocol/model/main-frame-resource.html.
* inspector/page/resources/dummy-page.html: Added.
* platform/efl/TestExpectations: Move failing inspector tests to generic expectations.
* platform/gtk/TestExpectations: Move failing inspector tests to generic expectations.
* platform/win/TestExpectations: Move failing inspector tests to generic expectations.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsinspectorinspectortestjs">trunk/LayoutTests/inspector/inspector-test.js</a></li>
<li><a href="#trunkLayoutTestsplatformeflTestExpectations">trunk/LayoutTests/platform/efl/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformwinTestExpectations">trunk/LayoutTests/platform/win/TestExpectations</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseTestjs">trunk/Source/WebInspectorUI/UserInterface/Base/Test.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolInspectorBackendjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTesthtml">trunk/Source/WebInspectorUI/UserInterface/Test.html</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectordebuggerdebuggertestjs">trunk/LayoutTests/inspector/debugger/debugger-test.js</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerprobemanageraddremoveactionsexpectedtxt">trunk/LayoutTests/inspector/debugger/probe-manager-add-remove-actions-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerprobemanageraddremoveactionshtml">trunk/LayoutTests/inspector/debugger/probe-manager-add-remove-actions.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerresourcesbreakpointjs">trunk/LayoutTests/inspector/debugger/resources/breakpoint.js</a></li>
<li>trunk/LayoutTests/inspector/dom/</li>
<li><a href="#trunkLayoutTestsinspectordomcontentflowcontentnodesexpectedtxt">trunk/LayoutTests/inspector/dom/content-flow-content-nodes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordomcontentflowcontentnodeshtml">trunk/LayoutTests/inspector/dom/content-flow-content-nodes.html</a></li>
<li><a href="#trunkLayoutTestsinspectordomcontentflowcontentremovalexpectedtxt">trunk/LayoutTests/inspector/dom/content-flow-content-removal-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordomcontentflowcontentremovalhtml">trunk/LayoutTests/inspector/dom/content-flow-content-removal.html</a></li>
<li><a href="#trunkLayoutTestsinspectordomcontentflowlistexpectedtxt">trunk/LayoutTests/inspector/dom/content-flow-list-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordomcontentflowlisthtml">trunk/LayoutTests/inspector/dom/content-flow-list.html</a></li>
<li><a href="#trunkLayoutTestsinspectordomcontentnoderegioninfoexpectedtxt">trunk/LayoutTests/inspector/dom/content-node-region-info-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordomcontentnoderegioninfohtml">trunk/LayoutTests/inspector/dom/content-node-region-info.html</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightshapeoutsideexpectedtxt">trunk/LayoutTests/inspector/dom/highlight-shape-outside-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightshapeoutsidemarginexpectedtxt">trunk/LayoutTests/inspector/dom/highlight-shape-outside-margin-expected.txt</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="#trunkLayoutTestsinspectordomshapestestjs">trunk/LayoutTests/inspector/dom/shapes-test.js</a></li>
<li>trunk/LayoutTests/inspector/page/</li>
<li><a href="#trunkLayoutTestsinspectorpagemainframeresourceexpectedtxt">trunk/LayoutTests/inspector/page/main-frame-resource-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorpagemainframeresourcehtml">trunk/LayoutTests/inspector/page/main-frame-resource.html</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li>trunk/LayoutTests/inspector-protocol/model/</li>
<li><a href="#trunkLayoutTestsinspectorprotocolresourcesshapeinfohelperjs">trunk/LayoutTests/inspector-protocol/resources/shape-info-helper.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (165500 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-03-12 21:49:58 UTC (rev 165500)
+++ trunk/LayoutTests/ChangeLog        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2014-03-12  Brian Burg  &lt;bburg@apple.com&gt;
+
+        Web Inspector: convert model tests and inspector-test.js to use Test.html
+        https://bugs.webkit.org/show_bug.cgi?id=129217
+
+        Reviewed by Timothy Hatcher.
+
+        * TestExpectations: Add flaky content-flow and failing shape-outside inspector tests.
+        * inspector-protocol/model/probe-manager-add-remove-actions.html: Removed.
+        * inspector-protocol/resources/shape-info-helper.js: Removed.
+        * inspector/debugger/debugger-test.js: Added.
+        (InspectorTestProxy.registerInitializer.):
+        (InspectorTestProxy.registerInitializer):
+        * inspector/debugger/probe-manager-add-remove-actions-expected.txt: Renamed from LayoutTests/inspector-protocol/model/probe-manager-add-remove-actions-expected.txt.
+        * inspector/debugger/probe-manager-add-remove-actions.html: Added.
+        * inspector/debugger/resources/breakpoint.js: Added. Copied from LayoutTests/inspector-protocol/.
+        (breakpointActions):
+        * inspector/dom/content-flow-content-nodes-expected.txt: Renamed from LayoutTests/inspector-protocol/model/content-flow-content-nodes-expected.txt.
+        * inspector/dom/content-flow-content-nodes.html: Renamed from LayoutTests/inspector-protocol/model/content-flow-content-nodes.html.
+        * inspector/dom/content-flow-content-removal-expected.txt: Renamed from LayoutTests/inspector-protocol/model/content-flow-content-removal-expected.txt.
+        * inspector/dom/content-flow-content-removal.html: Renamed from LayoutTests/inspector-protocol/model/content-flow-content-removal.html.
+        * inspector/dom/content-flow-list-expected.txt: Renamed from LayoutTests/inspector-protocol/model/content-flow-list-expected.txt.
+        * inspector/dom/content-flow-list.html: Renamed from LayoutTests/inspector-protocol/model/content-flow-list.html.
+        * inspector/dom/content-node-region-info-expected.txt: Renamed from LayoutTests/inspector-protocol/model/content-node-region-info-expected.txt.
+        * inspector/dom/content-node-region-info.html: Renamed from LayoutTests/inspector-protocol/model/content-node-region-info.html.
+        * inspector/dom/highlight-shape-outside-expected.txt: Renamed from LayoutTests/inspector-protocol/model/highlight-shape-outside-expected.txt.
+        * inspector/dom/highlight-shape-outside-margin-expected.txt: Renamed from LayoutTests/inspector-protocol/model/highlight-shape-outside-margin-expected.txt.
+        * inspector/dom/highlight-shape-outside-margin.html: Renamed from LayoutTests/inspector-protocol/model/highlight-shape-outside-margin.html.
+        * inspector/dom/highlight-shape-outside.html: Renamed from LayoutTests/inspector-protocol/model/highlight-shape-outside.html.
+        * inspector/dom/shapes-test.js: Added. Refactor existing shape helpers to use model objects
+        where it makes sense, and use easy-to-read assertions.
+        (InspectorTestProxy.registerInitializer.):
+        * inspector/inspector-test.js: Handle reloaded test pages better. Use better names.
+        (InspectorTestProxy.registerInitializer): Renamed from `register`.
+        (runTest.runInitializationMethodsInFrontend):
+        (runTest.runTestMethodInFrontend):
+        (runTest):
+        (InspectorTestProxy.completeTest):
+        * inspector/page/main-frame-resource-expected.txt: Renamed from LayoutTests/inspector-protocol/model/main-frame-resource-expected.txt.
+        * inspector/page/main-frame-resource.html: Renamed from LayoutTests/inspector-protocol/model/main-frame-resource.html.
+        * inspector/page/resources/dummy-page.html: Added.
+        * platform/efl/TestExpectations: Move failing inspector tests to generic expectations.
+        * platform/gtk/TestExpectations: Move failing inspector tests to generic expectations.
+        * platform/win/TestExpectations: Move failing inspector tests to generic expectations.
+
</ins><span class="cx"> 2014-03-12  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WebVTT] HTML5 &quot;space&quot; cahracters around &quot;--&gt;&quot; are not required
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (165500 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations        2014-03-12 21:49:58 UTC (rev 165500)
+++ trunk/LayoutTests/TestExpectations        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -60,7 +60,8 @@
</span><span class="cx"> fast/mediastream/MediaStream-construct-with-ended-tracks.html [ Skip ]
</span><span class="cx"> fast/mediastream/MediaStream-clone.html [ Skip ]
</span><span class="cx"> 
</span><del>-webkit.org/b/124660 inspector-protocol/model/highlight-shape-outside.html [ Failure ]
</del><ins>+webkit.org/b/124660 inspector/dom/highlight-shape-outside.html [ Failure ]
+webkit.org/b/126519 inspector/dom/highlight-shape-outside-margin.html [ Failure ]
</ins><span class="cx"> 
</span><span class="cx"> webkit.org/b/126142 css3/calc/transitions-dependent.html [ Pass Failure ]
</span><span class="cx"> 
</span><span class="lines">@@ -98,4 +99,6 @@
</span><span class="cx"> webkit.org/b/129331 inspector-protocol/page/deny-X-FrameOption.html [ Pass Failure ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/129639 inspector-protocol/dom/dom-search-crash.html [ Skip ]
</span><del>-webkit.org/b/129642 inspector/test-harness-trivially-works.html [ Skip ]
</del><ins>+webkit.org/b/129642 inspector [ Skip ]
+webkit.org/b/129817 inspector/dom/content-flow-list.html [ Pass Failure ]
+webkit.org/b/129817 inspector/dom/content-flow-content-removal.html [ Pass Failure ]
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerdebuggertestjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/debugger-test.js (0 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/debugger-test.js                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/debugger-test.js        2014-03-12 22:16:53 UTC (rev 165501)
</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="trunkLayoutTestsinspectordebuggerprobemanageraddremoveactionsexpectedtxtfromrev165498trunkLayoutTestsinspectorprotocolmodelprobemanageraddremoveactionsexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/inspector/debugger/probe-manager-add-remove-actions-expected.txt (from rev 165498, trunk/LayoutTests/inspector-protocol/model/probe-manager-add-remove-actions-expected.txt) (0 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/probe-manager-add-remove-actions-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/probe-manager-add-remove-actions-expected.txt        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+Testing that the probe manager properly handles addition and removal of related probes.
+
+Breakpoint autocontinue state changed: true
+Probe set was added. New count: 1
+Probe with identifier 1 was added to probe set.
+Probe set's probe count: 1
+Breakpoint actions changed. New count: 1
+Probe with identifier 2 was added to probe set.
+Probe set's probe count: 2
+Breakpoint actions changed. New count: 2
+Breakpoint resolved state changed: true
+Breakpoint resolved state changed: true
+Breakpoint resolved state changed: false
+Breakpoint was added.
+PASS: Breakpoint should be resolved.
+Breakpoint resolved state changed: true
+Probe with identifier 1 added sample: [object Object]
+Hit test checkpoint event #0 with type: probe-object-sample-added
+Probe with identifier 2 added sample: [object Object]
+Hit test checkpoint event #1 with type: probe-object-sample-added
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerprobemanageraddremoveactionshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/probe-manager-add-remove-actions.html (0 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/probe-manager-add-remove-actions.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/probe-manager-add-remove-actions.html        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&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;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/breakpoint.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test()
+{
+    WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, function() {
+        InspectorTest.startTracingBreakpoints();
+        InspectorTest.startTracingProbes();
+
+        var currentTicks = 0;
+        const expectedTicks = 2;
+
+        function incrementTick(event)
+        {
+            InspectorTest.log(&quot;Hit test checkpoint event #&quot; + currentTicks + &quot; with type: &quot; + event.type);
+            if (++currentTicks === expectedTicks)
+                InspectorTest.completeTest();
+        }
+
+        WebInspector.Probe.addEventListener(WebInspector.Probe.Event.SampleAdded, incrementTick);
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+
+            var scriptObject = event.data.script;
+
+            if (!/breakpoint\.js$/.test(scriptObject.url))
+                return;
+
+            var location = scriptObject.createSourceCodeLocation(4, 0);
+            // Create the breakpoint and its actions before sending anything to the backend.
+            var breakpoint = new WebInspector.Breakpoint(location);
+            breakpoint.autoContinue = true;
+            for (var i of [0, 1])
+                breakpoint.createAction(WebInspector.BreakpointAction.Type.Probe, null, &quot;a&quot;);
+
+            WebInspector.debuggerManager.addBreakpoint(breakpoint);
+
+            breakpoint.addEventListener(WebInspector.Breakpoint.Event.ResolvedStateDidChange, function() {
+                InspectorTest.expectThat(breakpoint.resolved, &quot;Breakpoint should be resolved.&quot;);
+            });
+
+
+            InspectorTest.evaluateInPage(&quot;breakpointActions(12, {x:1,y:2})&quot;);
+          });
+    });
+
+    InspectorTest.reloadPage();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Testing that the probe manager properly handles addition and removal of related probes.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerresourcesbreakpointjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/resources/breakpoint.js (0 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/resources/breakpoint.js                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/resources/breakpoint.js        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+function breakpointActions(a, b)
+{
+    // Only preserve this message on the current test page load.
+    InspectorTestProxy.addResult(&quot;inside breakpointActions a:(&quot; + a + &quot;) b:(&quot; + b + &quot;)&quot;);
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomcontentflowcontentnodesexpectedtxtfromrev165498trunkLayoutTestsinspectorprotocolmodelcontentflowcontentnodesexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/inspector/dom/content-flow-content-nodes-expected.txt (from rev 165498, trunk/LayoutTests/inspector-protocol/model/content-flow-content-nodes-expected.txt) (0 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/content-flow-content-nodes-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/content-flow-content-nodes-expected.txt        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Testing that the ContentFlows events are correctly dispatched when nodes are attached to/detached from a flow.
+
+PASS: ContentFlow was added.
+PASS: ContentFlow.contentNodes has a length of 2.
+PASS: ContentFlow.contentNodes[0].id is &quot;#contentStatic&quot;.
+PASS: ContentFlow.contentNodes[1].id is &quot;#contentRemoved&quot;.
+PASS: &quot;#contentAddedAtTheTop&quot; was added before &quot;#contentStatic&quot;.
+PASS: &quot;#contentAddedAtTheTop&quot; is first in the contentNodes list.
+PASS: &quot;#contentAddedAtTheBottom&quot; was added last.
+PASS: &quot;#contentAddedAtTheBottom&quot; is last in the contentNodes list.
+PASS: &quot;#contentRemoved&quot; was removed.
+PASS: &quot;#contentRemoved&quot; cannot be found in the contentNodes list.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomcontentflowcontentnodeshtmlfromrev165498trunkLayoutTestsinspectorprotocolmodelcontentflowcontentnodeshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/inspector/dom/content-flow-content-nodes.html (from rev 165498, trunk/LayoutTests/inspector-protocol/model/content-flow-content-nodes.html) (0 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/content-flow-content-nodes.html                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/content-flow-content-nodes.html        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+.content
+{
+    -webkit-flow-into: flow;
+}
+.hidden
+{
+    -webkit-flow-into: none;
+}
+&lt;/style&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function changeFlowContent()
+{
+    document.getElementById(&quot;contentAddedAtTheTop&quot;).classList.remove(&quot;hidden&quot;);
+    // Force a layout to make sure the events are always fired in the expected order.
+    document.body.offsetTop;
+    document.getElementById(&quot;contentAddedAtTheBottom&quot;).classList.remove(&quot;hidden&quot;);
+    document.body.offsetTop;
+    document.getElementById(&quot;contentRemoved&quot;).classList.add(&quot;hidden&quot;);
+}
+
+function test()
+{
+    var contentFlow;
+
+    function onRootDOMNodeInvalidated()
+    {
+        WebInspector.frameResourceManager.mainFrame.domTree.requestContentFlowList();
+    }
+
+    function onContentFlowWasAdded(event)
+    {
+        contentFlow = event.data.flow;
+        InspectorTest.expectThat(contentFlow.name === &quot;flow&quot;, &quot;ContentFlow was added.&quot;);
+        InspectorTest.expectThat(contentFlow.contentNodes.length == 2, &quot;ContentFlow.contentNodes has a length of 2.&quot;);
+        InspectorTest.expectThat(contentFlow.contentNodes[0].getAttribute(&quot;id&quot;) === &quot;contentStatic&quot;, &quot;ContentFlow.contentNodes[0].id is \&quot;#contentStatic\&quot;.&quot;);
+        InspectorTest.expectThat(contentFlow.contentNodes[1].getAttribute(&quot;id&quot;) === &quot;contentRemoved&quot;, &quot;ContentFlow.contentNodes[1].id is \&quot;#contentRemoved\&quot;.&quot;);
+
+        contentFlow.addEventListener(WebInspector.ContentFlow.Event.ContentNodeWasAdded, onContentNodeWasAdded, null);
+        contentFlow.addEventListener(WebInspector.ContentFlow.Event.ContentNodeWasRemoved, onContentNodeWasRemoved, null);
+
+        InspectorTest.evaluateInPage(&quot;changeFlowContent()&quot;);
+    }
+
+    function onContentNodeWasAdded(event)
+    {
+        switch (event.data.node.getAttribute(&quot;id&quot;)) {
+        case &quot;contentAddedAtTheTop&quot;:
+            InspectorTest.expectThat(event.data.before.getAttribute(&quot;id&quot;) === &quot;contentStatic&quot;, &quot;\&quot;#contentAddedAtTheTop\&quot; was added before \&quot;#contentStatic\&quot;.&quot;);
+            InspectorTest.expectThat(contentFlow.contentNodes[0] === event.data.node, &quot;\&quot;#contentAddedAtTheTop\&quot; is first in the contentNodes list.&quot;);
+            break;
+        case &quot;contentAddedAtTheBottom&quot;:
+            InspectorTest.expectThat(!event.data.before, &quot;\&quot;#contentAddedAtTheBottom\&quot; was added last.&quot;);
+            InspectorTest.expectThat(contentFlow.contentNodes.lastValue === event.data.node, &quot;\&quot;#contentAddedAtTheBottom\&quot; is last in the contentNodes list.&quot;);
+            break;
+        default:
+            InspectorTest.log(&quot;FAIL: Only two add events are expected.&quot;);
+        }
+    }
+
+    function onContentNodeWasRemoved(event)
+    {
+        InspectorTest.expectThat(event.data.node.getAttribute(&quot;id&quot;) === &quot;contentRemoved&quot;, &quot;\&quot;#contentRemoved\&quot; was removed.&quot;);
+        InspectorTest.expectThat(contentFlow.contentNodes.indexOf(event.data.node) === -1, &quot;\&quot;#contentRemoved\&quot; cannot be found in the contentNodes list.&quot;);
+        InspectorTest.completeTest();
+    }
+
+    WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, function(event) {
+        var domTree = WebInspector.frameResourceManager.mainFrame.domTree;
+        domTree.addEventListener(WebInspector.DOMTree.Event.RootDOMNodeInvalidated, onRootDOMNodeInvalidated, null);
+        domTree.addEventListener(WebInspector.DOMTree.Event.ContentFlowWasAdded, onContentFlowWasAdded, null);
+        domTree.requestContentFlowList();
+    });
+
+    InspectorTest.reloadPage();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Testing that the ContentFlows events are correctly dispatched when nodes are attached to/detached from a flow.&lt;/p&gt;
+
+    &lt;div id=&quot;contentAddedAtTheTop&quot; class=&quot;content hidden&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;contentStatic&quot; class=&quot;content&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;contentRemoved&quot; class=&quot;content&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;contentAddedAtTheBottom&quot; class=&quot;content hidden&quot;&gt;&lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomcontentflowcontentremovalexpectedtxtfromrev165498trunkLayoutTestsinspectorprotocolmodelcontentflowcontentremovalexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/inspector/dom/content-flow-content-removal-expected.txt (from rev 165498, trunk/LayoutTests/inspector-protocol/model/content-flow-content-removal-expected.txt) (0 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/content-flow-content-removal-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/content-flow-content-removal-expected.txt        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+Testing that the ContentFlows events are correctly dispatched when content nodes are detached from the DOM.
+
+PASS: ContentFlow was added.
+PASS: ContentFlow.contentNodes has a length of 2.
+PASS: ContentFlow.contentNodes[0].id is &quot;#contentStatic&quot;.
+PASS: ContentFlow.contentNodes[1].id is &quot;#contentRemoved&quot;.
+PASS: &quot;#contentRemoved&quot; was removed.
+PASS: &quot;#contentRemoved&quot; cannot be found in the contentNodes list.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomcontentflowcontentremovalhtmlfromrev165498trunkLayoutTestsinspectorprotocolmodelcontentflowcontentremovalhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/inspector/dom/content-flow-content-removal.html (from rev 165498, trunk/LayoutTests/inspector-protocol/model/content-flow-content-removal.html) (0 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/content-flow-content-removal.html                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/content-flow-content-removal.html        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+.content
+{
+    -webkit-flow-into: flow;
+}
+&lt;/style&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function changeFlowContent()
+{
+    document.getElementById(&quot;contentRemoved&quot;).remove();
+}
+
+function test()
+{
+    var contentFlow;
+
+    function onRootDOMNodeInvalidated()
+    {
+        WebInspector.frameResourceManager.mainFrame.domTree.requestContentFlowList();
+    }
+
+    function onContentFlowWasAdded(event)
+    {
+        contentFlow = event.data.flow;
+        InspectorTest.expectThat(contentFlow.name === &quot;flow&quot;, &quot;ContentFlow was added.&quot;);
+        InspectorTest.expectThat(contentFlow.contentNodes.length === 2, &quot;ContentFlow.contentNodes has a length of 2.&quot;);
+        InspectorTest.expectThat(contentFlow.contentNodes[0].getAttribute(&quot;id&quot;) === &quot;contentStatic&quot;, &quot;ContentFlow.contentNodes[0].id is \&quot;#contentStatic\&quot;.&quot;);
+        InspectorTest.expectThat(contentFlow.contentNodes[1].getAttribute(&quot;id&quot;) === &quot;contentRemoved&quot;, &quot;ContentFlow.contentNodes[1].id is \&quot;#contentRemoved\&quot;.&quot;);
+
+        contentFlow.addEventListener(WebInspector.ContentFlow.Event.ContentNodeWasRemoved, onContentNodeWasRemoved, null);
+
+        InspectorTest.evaluateInPage(&quot;changeFlowContent()&quot;);
+    }
+
+    function onContentNodeWasRemoved(event)
+    {
+        InspectorTest.expectThat(event.data.node.getAttribute(&quot;id&quot;) === &quot;contentRemoved&quot;, &quot;\&quot;#contentRemoved\&quot; was removed.&quot;);
+        InspectorTest.expectThat(contentFlow.contentNodes.indexOf(event.data.node) === -1, &quot;\&quot;#contentRemoved\&quot; cannot be found in the contentNodes list.&quot;);
+        InspectorTest.completeTest();
+    }
+
+    WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, function() {
+        var domTree = WebInspector.frameResourceManager.mainFrame.domTree;
+        domTree.addEventListener(WebInspector.DOMTree.Event.RootDOMNodeInvalidated, onRootDOMNodeInvalidated, null);
+        domTree.addEventListener(WebInspector.DOMTree.Event.ContentFlowWasAdded, onContentFlowWasAdded, null);
+        domTree.requestContentFlowList();
+    });
+
+    InspectorTest.reloadPage();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Testing that the ContentFlows events are correctly dispatched when content nodes are detached from the DOM.&lt;/p&gt;
+
+    &lt;div id=&quot;contentStatic&quot; class=&quot;content&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;contentRemoved&quot; class=&quot;content&quot;&gt;&lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomcontentflowlistexpectedtxtfromrev165498trunkLayoutTestsinspectorprotocolmodelcontentflowlistexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/inspector/dom/content-flow-list-expected.txt (from rev 165498, trunk/LayoutTests/inspector-protocol/model/content-flow-list-expected.txt) (0 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/content-flow-list-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/content-flow-list-expected.txt        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+Testing that the ContentFlows events are correctly dispatched when new flows are created/removed.
+
+PASS: ContentFlow was added
+PASS: Flow count is 1
+PASS: ContentFlow was removed
+PASS: Flow count is 0
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomcontentflowlisthtmlfromrev165498trunkLayoutTestsinspectorprotocolmodelcontentflowlisthtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/inspector/dom/content-flow-list.html (from rev 165498, trunk/LayoutTests/inspector-protocol/model/content-flow-list.html) (0 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/content-flow-list.html                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/content-flow-list.html        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+#flow1
+{
+    -webkit-flow-into: flow1;
+}
+&lt;/style&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function removeFlow()
+{
+    document.getElementById(&quot;flow1&quot;).remove();
+}
+
+function test()
+{
+    function onRootDOMNodeInvalidated()
+    {
+        WebInspector.frameResourceManager.mainFrame.domTree.requestContentFlowList();
+    }
+
+    function onContentFlowWasAdded(event)
+    {
+        InspectorTest.expectThat(event.data.flow.name === &quot;flow1&quot;, &quot;ContentFlow was added&quot;);
+        InspectorTest.expectThat(WebInspector.frameResourceManager.mainFrame.domTree.flowsCount === 1, &quot;Flow count is 1&quot;);
+
+        InspectorTest.evaluateInPage(&quot;removeFlow()&quot;);
+    }
+
+    function onContentFlowWasRemoved(event)
+    {
+        InspectorTest.expectThat(event.data.flow.name === &quot;flow1&quot;, &quot;ContentFlow was removed&quot;);
+        InspectorTest.expectThat(WebInspector.frameResourceManager.mainFrame.domTree.flowsCount === 0, &quot;Flow count is 0&quot;);
+        InspectorTest.completeTest();
+    }
+
+    WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, function() {
+        var domTree = WebInspector.frameResourceManager.mainFrame.domTree;
+        domTree.addEventListener(WebInspector.DOMTree.Event.RootDOMNodeInvalidated, onRootDOMNodeInvalidated, null);
+        domTree.addEventListener(WebInspector.DOMTree.Event.ContentFlowWasAdded, onContentFlowWasAdded, null);
+        domTree.addEventListener(WebInspector.DOMTree.Event.ContentFlowWasRemoved, onContentFlowWasRemoved, null);
+        domTree.requestContentFlowList();
+    });
+
+    InspectorTest.reloadPage();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Testing that the ContentFlows events are correctly dispatched when new flows are created/removed.&lt;/p&gt;
+
+    &lt;div id=&quot;flow1&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomcontentnoderegioninfoexpectedtxtfromrev165498trunkLayoutTestsinspectorprotocolmodelcontentnoderegioninfoexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/inspector/dom/content-node-region-info-expected.txt (from rev 165498, trunk/LayoutTests/inspector-protocol/model/content-node-region-info-expected.txt) (0 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/content-node-region-info-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/content-node-region-info-expected.txt        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+Testing that the DOMTreeManager.getNodeContentFlowInfo returns the containing regions.
+
+
+Selector: #flow
+Region flow name: none
+Content flow name: flow
+Regions count: 2
+Regions: div#region1.region, div#region2.region
+
+Selector: .contentNode1
+Region flow name: none
+Content flow name: flow
+Regions count: 1
+Regions: div#region1.region
+
+Selector: .contentNode2
+Region flow name: none
+Content flow name: flow
+Regions count: 2
+Regions: div#region1.region, div#region2.region
+
+Selector: body
+Region flow name: none
+Content flow name: none
+Regions count: N/A
+Regions: N/A
+
+Selector: #region1
+Region flow name: flow
+Content flow name: none
+Regions count: N/A
+Regions: N/A
+
+Selector: #region2
+Region flow name: flow
+Content flow name: none
+Regions count: N/A
+Regions: N/A
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomcontentnoderegioninfohtmlfromrev165498trunkLayoutTestsinspectorprotocolmodelcontentnoderegioninfohtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/inspector/dom/content-node-region-info.html (from rev 165498, trunk/LayoutTests/inspector-protocol/model/content-node-region-info.html) (0 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/content-node-region-info.html                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/content-node-region-info.html        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+#flow
+{
+    -webkit-flow-into: flow;
+}
+.contentNode1
+{
+    width: 100%;
+    height: 50px;
+}
+.contentNode2
+{
+    width: 100%;
+    height: 150px;
+}
+.region
+{
+    -webkit-flow-from: flow;
+    width: 100px;
+    height: 100px;
+}
+&lt;/style&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test()
+{
+    var queryList = [&quot;#flow&quot;, &quot;.contentNode1&quot;, &quot;.contentNode2&quot;, &quot;body&quot;, &quot;#region1&quot;, &quot;#region2&quot;];
+    var documentNodeId;
+
+    WebInspector.domTreeManager.requestDocument(function(documentNode) {
+        documentNodeId = documentNode.id;
+        WebInspector.domTreeManager.getNamedFlowCollection(documentNodeId);
+        next();
+    });
+
+    function query(selector, callback)
+    {
+        InspectorTest.log(&quot;\nSelector: &quot; + selector);
+        WebInspector.domTreeManager.querySelector(documentNodeId, selector, function(contentNodeId) {
+            if (!contentNodeId) {
+                InspectorTest.log(&quot;DOM node not found.&quot;);
+                callback();
+            }
+            var domNode = WebInspector.domTreeManager.nodeForId(contentNodeId);
+            WebInspector.domTreeManager.getNodeContentFlowInfo(domNode, function(error, result) {
+                console.assert(!error);
+                if (result) {
+                    InspectorTest.log(&quot;Region flow name: &quot; + (result.regionFlow ? result.regionFlow.name : &quot;none&quot;));
+                    InspectorTest.log(&quot;Content flow name: &quot; + (result.contentFlow ? result.contentFlow.name : &quot;none&quot;));
+                    InspectorTest.log(&quot;Regions count: &quot; + (result.regions ? result.regions.length : &quot;N/A&quot;));
+                    InspectorTest.log(&quot;Regions: &quot; + (result.regions ? result.regions.map(WebInspector.displayNameForNode).join(&quot;, &quot;) : &quot;N/A&quot;));
+                } else
+                    InspectorTest.log(&quot;No region flow information.&quot;);
+                callback();
+            });
+        });
+    }
+
+    function next()
+    {
+        if (!queryList.length)
+            return InspectorTest.completeTest();
+        query(queryList.shift(), next);
+    }
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Testing that the DOMTreeManager.getNodeContentFlowInfo returns the containing regions.&lt;/p&gt;
+
+    &lt;div id=&quot;flow&quot;&gt;
+        &lt;div class=&quot;contentNode1&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;contentNode2&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+
+    &lt;div id=&quot;region1&quot; class=&quot;region&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;region2&quot; class=&quot;region&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightshapeoutsideexpectedtxtfromrev165498trunkLayoutTestsinspectorprotocolmodelhighlightshapeoutsideexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/inspector/dom/highlight-shape-outside-expected.txt (from rev 165498, trunk/LayoutTests/inspector-protocol/model/highlight-shape-outside-expected.txt) (0 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlight-shape-outside-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/highlight-shape-outside-expected.txt        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+PASS: Actual [M 50 50 L 150 50 L 150 100 L 50 100 L 50 50 Z] Expected [M 50 50 L 150 50 L 150 100 L 50 100 L 50 50 Z]
+PASS: Actual [M 50 50 L 100 50 L 100 100 L 50 100 Z] Expected [M 50 50 L 100 50 L 100 100 L 50 100 Z]
+PASS: Actual [M 75 75 L 175 75 L 175 125 L 75 125 L 75 75 Z] Expected [M 75 75 L 175 75 L 175 125 L 75 125 L 75 75 Z]
+PASS: Actual [M 50 50 L 150 50 L 150 100 L 50 100 L 50 50 Z] Expected [M 50 50 L 150 50 L 150 100 L 50 100 L 50 50 Z]
+PASS: Actual [M 50 50 L 50 100 L 150 100 L 150 50 L 50 50 Z] Expected [M 50 50 L 50 100 L 150 100 L 150 50 L 50 50 Z]
+PASS: Actual [M 150 50 L 150 100 L 50 100 L 50 50 L 150 50 Z] Expected [M 150 50 L 150 100 L 50 100 L 50 50 L 150 50 Z]
+PASS: Actual [M 175 75 L 175 125 L 75 125 L 75 75 L 175 75 Z] Expected [M 175 75 L 175 125 L 75 125 L 75 75 L 175 75 Z]
+PASS: Actual [M 150 50 L 150 100 L 50 100 L 50 50 L 150 50 Z] Expected [M 150 50 L 150 100 L 50 100 L 50 50 L 150 50 Z]
+PASS: Actual [M 25 25 L 125 25 L 125 125 L 25 125 L 25 25 Z] Expected [M 25 25 L 125 25 L 125 125 L 25 125 L 25 25 Z]
+PASS: Actual [M 50 50 L 100 50 L 100 100 L 50 100 Z] Expected [M 50 50 L 100 50 L 100 100 L 50 100 Z]
+PASS: Actual [M 35 35 L 115 35 L 115 65 L 35 65 Z M 35 85 L 115 85 L 115 115 L 35 115 Z] Expected [M 35 35 L 115 35 L 115 65 L 35 65 Z M 35 85 L 115 85 L 115 115 L 35 115 Z]
+PASS: Actual [M 50 50 L 100 50 L 100 100 L 50 100 Z] Expected [M 50 50 L 100 50 L 100 100 L 50 100 Z]
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightshapeoutsidemarginexpectedtxtfromrev165498trunkLayoutTestsinspectorprotocolmodelhighlightshapeoutsidemarginexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/inspector/dom/highlight-shape-outside-margin-expected.txt (from rev 165498, trunk/LayoutTests/inspector-protocol/model/highlight-shape-outside-margin-expected.txt) (0 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlight-shape-outside-margin-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/highlight-shape-outside-margin-expected.txt        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+PASS: Shape roughly equals [M 60 50 L 90 50 C 95.52 50 100 54.48 100 60 L 100 90 C 100 95.52 95.52 100 90 100 L 60 100 C 54.48 100 50 95.52 50 90 L 50 60 C 50 54.48 54.48 50 60 50 Z]
+PASS: Margin shape roughly equals [M 60 40 L 90 40 C 101.05 40 110 48.95 110 60 L 110 90 C 110 101.05 101.05 110 90 110 L 60 110 C 48.95 110 40 101.05 40 90 L 40 60 C 40 48.95 48.95 40 60 40 Z]
+PASS: Shape roughly equals [M 75 25 L 75 25 C 102.61 25 125 47.39 125 75 L 125 75 C 125 102.61 102.61 125 75 125 L 75 125 C 47.39 125 25 102.61 25 75 L 25 75 C 25 47.39 47.39 25 75 25 Z]
+PASS: Margin shape roughly equals [M 75 15 L 75 15 C 108.14 15 135 41.86 135 75 L 135 75 C 135 108.14 108.14 135 75 135 L 75 135 C 41.86 135 15 108.14 15 75 L 15 75 C 15 41.86 41.86 15 75 15 Z]
+PASS: Shape roughly equals [M 50 50 L 100 50 L 100 100 L 50 100 L 50 50 Z]
+PASS: Margin shape roughly equals [M 50 49 L 100 49 L 100 50 L 50 50 L 50 49 Z M 49 50 L 101 50 L 101 100 L 49 100 L 49 50 Z M 50 100 L 100 100 L 100 101 L 50 101 L 50 100 Z]
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightshapeoutsidemarginhtmlfromrev165498trunkLayoutTestsinspectorprotocolmodelhighlightshapeoutsidemarginhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/inspector/dom/highlight-shape-outside-margin.html (from rev 165498, trunk/LayoutTests/inspector-protocol/model/highlight-shape-outside-margin.html) (0 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlight-shape-outside-margin.html                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/highlight-shape-outside-margin.html        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -0,0 +1,101 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+body {
+    margin: 0;
+}
+.shape {
+    float: left;
+    width: 100px;
+    height: 100px;
+    padding: 25px 75px 75px 25px;
+    margin-right: -200px;
+    -webkit-shape-margin: 10px;
+}
+.inset {
+    -webkit-shape-outside: inset(25px 25px 25px 25px round 10px 10px) content-box;
+}
+.circle {
+    -webkit-shape-outside: circle(50px) content-box;
+}
+.svg {
+    -webkit-shape-outside: url(&quot;data:image/svg+xml;utf8,&lt;svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none' width='100px' height='100px'&gt;&lt;rect x='25' y='25' width='50' height='50' fill='blue' /&gt;&lt;/svg&gt;&quot;);
+    -webkit-shape-margin: 1px;
+}
+&lt;/style&gt;
+&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;
+&lt;script&gt;
+function test() {
+    var testcases = [
+    {
+        'selector' : '.inset',
+        'shape' : roundedRectCommands(50, 50, 50, 50, 10),
+        'marginShape' : roundedRectCommands(40, 40, 70, 70, 20)
+    },
+    {
+        'selector' : '.circle',
+        'shape' : roundedRectCommands(25, 25, 100, 100, 50),
+        'marginShape' : roundedRectCommands(15, 15, 120, 120, 60)
+    },
+    {
+        'selector' : '.svg',
+        'shape' : roundedRectCommands(50, 50, 50, 50, 0),
+        'marginShape' : [].concat(roundedRectCommands(50, 49, 50, 1, 0),
+            roundedRectCommands(49, 50, 52, 50, 0),
+            roundedRectCommands(50, 100, 50, 1, 0))
+    }
+    ];
+
+    function roundedRectCommands(x, y, w, h, r) {
+        if (!r)
+            return ['M', x, y, 'L', x + w, y, 'L', x + w, y + h, 'L', x, y + h, 'L', x, y, 'Z'];
+
+        // Approximate 1 - kappa, see Path.cpp
+        var control = .447715;
+
+        var commands = [];
+
+        commands.push('M', x + r, y);
+        commands.push('L', x + w - r, y);
+        commands.push('C', x + w - control * r, y, x + w, y + control * r, x + w, y + r);
+
+        commands.push('L', x + w, y + h - r);
+        commands.push('C', x + w, y + h - control * r, x + w - control * r, y + h, x + w - r, y + h);
+
+        commands.push('L', x + r, y + h);
+        commands.push('C', x + control * r, y + h, x, y + h - control * r, x, y + h - r);
+
+        commands.push('L', x, y + r);
+        commands.push('C', x, y + control * r, x + control * r, y, x + r, y);
+        commands.push('Z');
+
+        return commands;
+    }
+
+    function runNextTest(tests) {
+        var testcase = tests[0];
+
+        InspectorTest.Shapes.getShapeOutsideInfoForSelector(testcase.selector, function(payload) {
+            InspectorTest.log(&quot;Comparing shape information for selector: &quot; + testcase.selector);
+            InspectorTest.Shapes.assertPathsAreRoughlyEqual(payload.shape, testcase.shape, &quot;Shape information was not roughly equal.&quot;);
+            InspectorTest.Shapes.assertPathsAreRoughlyEqual(payload.marginShape, testcase.marginShape, &quot;Margin shape information was not roughly equal.&quot;);
+
+            if (tests.length &gt; 1)
+                runNextTest(tests.splice(1));
+            else
+                InspectorTest.completeTest();
+        });
+    }
+
+    runNextTest(testcases);
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;div class='shape inset'&gt;&lt;/div&gt;
+    &lt;div class='shape circle'&gt;&lt;/div&gt;
+    &lt;div class='shape svg'&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightshapeoutsidehtmlfromrev165498trunkLayoutTestsinspectorprotocolmodelhighlightshapeoutsidehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/inspector/dom/highlight-shape-outside.html (from rev 165498, trunk/LayoutTests/inspector-protocol/model/highlight-shape-outside.html) (0 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlight-shape-outside.html                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/highlight-shape-outside.html        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -0,0 +1,144 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+body {
+    margin: 0;
+}
+.shape {
+    float: left;
+    width: 200px;
+    height: 200px;
+    margin-right: -200px;
+}
+.padded {
+    width: 100px;
+    height: 100px;
+    padding: 25px 75px 75px 25px;
+}
+.border-box {
+    box-sizing: border-box;
+}
+.vertical-lr {
+    -webkit-writing-mode: vertical-lr;
+}
+.vertical-rl {
+    -webkit-writing-mode: vertical-rl;
+}
+.rectangle {
+    -webkit-shape-outside: rectangle(50px, 50px, 100px, 50px) content-box;
+}
+.rectangle.border-box {
+    -webkit-shape-outside: rectangle(50px, 50px, 100px, 50px) border-box;
+}
+.polygon {
+    -webkit-shape-outside: polygon(50px 50px, 100px 50px, 100px 100px, 50px 100px) content-box;
+}
+.polygon.border-box {
+    -webkit-shape-outside: polygon(50px 50px, 100px 50px, 100px 100px, 50px 100px) border-box;
+}
+.content-box {
+    -webkit-shape-outside: content-box;
+}
+.raster-svg {
+    -webkit-shape-outside: url(&quot;data:image/svg+xml;utf8,&lt;svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none' width='100px' height='100px'&gt;&lt;rect x='25' y='25' width='50' height='50' fill='blue' /&gt;&lt;/svg&gt;&quot;);
+}
+.raster-svg-complex {
+    -webkit-shape-outside: url(&quot;data:image/svg+xml;utf8,&lt;svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none' width='100px' height='100px'&gt;&lt;rect x='10' y='10' width='30' height='30' fill='blue' /&gt;&lt;rect x='60' y='10' width='30' height='30' fill='blue' /&gt;&lt;rect x='10' y='60' width='30' height='30' fill='blue' /&gt;&lt;rect x='60' y='60' width='30' height='30' fill='blue' /&gt;&lt;/svg&gt;&quot;);
+}
+.raster-png {
+    /* png version of raster-svg */
+   -webkit-shape-outside: url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAABHPGVmAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRFAAD/////e9yZLAAAAAJ0Uk5T/wDltzBKAAAASUlEQVR42uzYsQ0AMAgEsWf/pTMDBURIvgXcX2qhQCAQCAQCgUA+I2kHgUAgEAgEAoFAIBAIBAKBQOYRoxMCgUAgEAjkHPIEGAA2ih1NVnaDGgAAAABJRU5ErkJggg==&quot;);
+}
+&lt;/style&gt;
+&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;
+&lt;script&gt;
+function test() {
+    var testcases = [
+    {
+        'selector' : '.rectangle',
+        'path' : ['M', 50, 50, 'L', 150, 50, 'L', 150, 100, 'L', 50, 100, 'L', 50, 50, 'Z']
+    },
+    {
+        'selector' : '.polygon',
+        'path' : ['M', 50, 50, 'L', 100, 50, 'L', 100, 100, 'L', 50, 100, 'Z']
+    },
+    {
+        'selector' : '.rectangle.padded',
+        'path' : ['M', 75, 75, 'L', 175, 75, 'L', 175, 125, 'L', 75, 125, 'L', 75, 75, 'Z']
+    },
+    {
+        'selector' : '.rectangle.padded.border-box',
+        'path' : ['M', 50, 50, 'L', 150, 50, 'L', 150, 100, 'L', 50, 100, 'L', 50, 50, 'Z']
+    },
+    {
+        'selector' : '.vertical-lr &gt; .rectangle',
+        'path' : ['M', 50, 50, 'L', 50, 100, 'L', 150, 100, 'L', 150, 50, 'L', 50, 50, 'Z']
+    },
+    {
+        'selector' : '.vertical-rl &gt; .rectangle',
+        'path' : ['M', 150, 50, 'L', 150, 100, 'L', 50, 100, 'L', 50, 50, 'L', 150, 50, 'Z']
+    },
+    {
+        'selector' : '.vertical-rl &gt; .rectangle.padded',
+        'path' : ['M', 175, 75, 'L', 175, 125, 'L', 75, 125, 'L', 75, 75, 'L', 175, 75, 'Z']
+    },
+    {
+        'selector' : '.vertical-rl &gt; .rectangle.padded.border-box',
+        'path' : ['M', 150, 50, 'L', 150, 100, 'L', 50, 100, 'L', 50, 50, 'L', 150, 50, 'Z']
+    },
+    {
+        'selector' : '.content-box.padded',
+        'path' : ['M', 25, 25, 'L', 125, 25, 'L', 125, 125, 'L', 25, 125, 'L', 25, 25, 'Z']
+    },
+    {
+        'selector' : '.raster-svg.padded',
+        'path' : ['M', 50, 50, 'L', 100, 50, 'L', 100, 100, 'L', 50, 100, 'Z']
+    },
+    {
+        'selector' : '.raster-svg-complex.padded',
+        'path' : ['M', 35, 35, 'L', 115, 35, 'L', 115, 65, 'L', 35, 65, 'Z', 'M', 35, 85, 'L', 115, 85, 'L', 115, 115, 'L', 35, 115, 'Z']
+    },
+    {
+        'selector' : '.raster-png.padded',
+        'path' : ['M', 50, 50, 'L', 100, 50, 'L', 100, 100, 'L', 50, 100, 'Z']
+    }
+    ];
+
+    function runNextTest(tests) {
+        var testcase = tests[0];
+
+        InspectorTest.Shapes.getShapeOutsideInfo(testcase.selector, function(payload) {
+            InspectorTest.Shapes.assertPathsAreRoughlyEqual(payload.shape, testcase.shape, &quot;Shape information was not roughly equal.&quot;);
+            InspectorTest.Shapes.assertPathsAreRoughlyEqual(payload.marginShape, testcase.marginShape, &quot;Margin shape information was not roughly equal.&quot;);
+
+            if (tests.length &gt; 1)
+                runNextTest(tests.splice(1));
+            else
+                InspectorTest.completeTest();
+        });
+    }
+
+    runNextTest(testcases);
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;div class='shape rectangle'&gt;&lt;/div&gt;
+    &lt;div class='shape polygon'&gt;&lt;/div&gt;
+    &lt;div class='shape padded rectangle'&gt;&lt;/div&gt;
+    &lt;div class='shape padded rectangle border-box'&gt;&lt;/div&gt;
+    &lt;div class='vertical-lr'&gt;
+        &lt;div class='shape rectangle'&gt;&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div class='vertical-rl'&gt;
+        &lt;div class='shape rectangle'&gt;&lt;/div&gt;
+        &lt;div class='shape padded rectangle'&gt;&lt;/div&gt;
+        &lt;div class='shape padded rectangle border-box'&gt;&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div class='shape padded content-box'&gt;&lt;/div&gt;
+    &lt;div class='shape padded raster-svg'&gt;&lt;/div&gt;
+    &lt;div class='shape padded raster-svg-complex'&gt;&lt;/div&gt;
+    &lt;div class='shape padded raster-png'&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomshapestestjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/dom/shapes-test.js (0 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/shapes-test.js                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/shapes-test.js        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -0,0 +1,92 @@
</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="trunkLayoutTestsinspectorinspectortestjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/inspector-test.js (165500 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/inspector-test.js        2014-03-12 21:49:58 UTC (rev 165500)
+++ trunk/LayoutTests/inspector/inspector-test.js        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> // Helper scripts like `debugger-test.js` must register their initialization
</span><span class="cx"> // function with this method so it will be marshalled to the inspector page.
</span><del>-InspectorTestProxy.register = function(initializer)
</del><ins>+InspectorTestProxy.registerInitializer = function(initializer)
</ins><span class="cx"> {
</span><span class="cx">     if (typeof initializer === &quot;function&quot;)
</span><span class="cx">         this._initializers.push(initializer.toString());
</span><span class="lines">@@ -42,17 +42,26 @@
</span><span class="cx"> // into the inspector page context.
</span><span class="cx"> function runTest()
</span><span class="cx"> {
</span><ins>+    // Don't try to use testRunner if running through the browser.
+    if (!window.testRunner)
+        return;
+
</ins><span class="cx">     // Set up the test page before the load event fires.
</span><span class="cx">     testRunner.dumpAsText();
</span><span class="cx">     testRunner.waitUntilDone();
</span><span class="cx"> 
</span><del>-    if (window.internals)
-        internals.setInspectorIsUnderTest(true);
</del><ins>+    window.internals.setInspectorIsUnderTest(true);
</ins><span class="cx">     testRunner.showWebInspector();
</span><span class="cx"> 
</span><del>-    // This function runs the initializer functions in the Inspector page.
-    function initializeFrontend(initializersArray)
</del><ins>+    function runInitializationMethodsInFrontend(initializersArray)
</ins><span class="cx">     {
</span><ins>+        if (InspectorTest.didInjectTestCode) {
+            // If the test page reloaded but we started running the test in a previous
+            // navigation, then don't initialize the inspector frontend again.
+            InspectorTest.testPageDidLoad();
+            return;
+        }
+
</ins><span class="cx">         for (var initializer of initializersArray) {
</span><span class="cx">             try {
</span><span class="cx">                 initializer();
</span><span class="lines">@@ -63,9 +72,13 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // This function runs the test() method in the Inspector page.
-    function runTestInFrontend(testFunction)
</del><ins>+    function runTestMethodInFrontend(testFunction)
</ins><span class="cx">     {
</span><ins>+        if (InspectorTest.didInjectTestCode)
+            return;
+
+        InspectorTest.didInjectTestCode = true;
+
</ins><span class="cx">         try {
</span><span class="cx">             testFunction();
</span><span class="cx">         } catch (e) {
</span><span class="lines">@@ -74,16 +87,20 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    var codeStringToEvaluate = &quot;(&quot; + initializeFrontend.toString() + &quot;)([&quot; + InspectorTestProxy._initializers + &quot;]);&quot;;
</del><ins>+    var codeStringToEvaluate = &quot;(&quot; + runInitializationMethodsInFrontend.toString() + &quot;)([&quot; + InspectorTestProxy._initializers + &quot;]);&quot;;
</ins><span class="cx">     testRunner.evaluateInWebInspector(0, codeStringToEvaluate);
</span><span class="cx"> 
</span><span class="cx">     // `test` refers to a function defined in global scope in the test HTML page.
</span><del>-    codeStringToEvaluate = &quot;(&quot; + runTestInFrontend.toString() + &quot;)(&quot; + test.toString() + &quot;);&quot;;
</del><ins>+    codeStringToEvaluate = &quot;(&quot; + runTestMethodInFrontend.toString() + &quot;)(&quot; + test.toString() + &quot;);&quot;;
</ins><span class="cx">     testRunner.evaluateInWebInspector(0, codeStringToEvaluate);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InspectorTestProxy.completeTest = function()
</span><span class="cx"> {
</span><ins>+    // Don't try to use testRunner if running through the browser.
+    if (!window.testRunner)
+        return;
+
</ins><span class="cx">     // Close inspector asynchrously in case we want to test tear-down behavior.
</span><span class="cx">     setTimeout(function() {
</span><span class="cx">         testRunner.closeWebInspector();
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorpagemainframeresourceexpectedtxtfromrev165498trunkLayoutTestsinspectorprotocolmodelmainframeresourceexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/inspector/page/main-frame-resource-expected.txt (from rev 165498, trunk/LayoutTests/inspector-protocol/model/main-frame-resource-expected.txt) (0 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/page/main-frame-resource-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/page/main-frame-resource-expected.txt        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+Testing that the inspector scripts are loaded and the main frame URL can be received.
+
+Main frame: main-frame-resource.html
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorpagemainframeresourcehtmlfromrev165498trunkLayoutTestsinspectorprotocolmodelmainframeresourcehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/inspector/page/main-frame-resource.html (from rev 165498, trunk/LayoutTests/inspector-protocol/model/main-frame-resource.html) (0 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/page/main-frame-resource.html                                (rev 0)
+++ trunk/LayoutTests/inspector/page/main-frame-resource.html        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test()
+{
+    WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, function(event) {
+        var url = WebInspector.frameResourceManager.mainFrame.url;
+        InspectorTest.log(&quot;Main frame: &quot; + url.substring(url.lastIndexOf(&quot;/&quot;) + 1));
+        InspectorTest.completeTest();
+    });
+
+    InspectorTest.reloadPage();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Testing that the inspector scripts are loaded and the main frame URL can be received.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolresourcesshapeinfohelperjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/inspector-protocol/resources/shape-info-helper.js (165500 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/resources/shape-info-helper.js        2014-03-12 21:49:58 UTC (rev 165500)
+++ trunk/LayoutTests/inspector-protocol/resources/shape-info-helper.js        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -1,99 +0,0 @@
</span><del>-window.ShapeInfoHelper = (function() {
-    function shapeOutsideInfo(selector, callback) {
-        InspectorTest.sendCommand(&quot;DOM.getDocument&quot;, {}, onGotDocument);
-
-        function onGotDocument(msg) {
-            InspectorTest.checkForError(msg);
-            var node = msg.result.root;
-            InspectorTest.sendCommand(&quot;DOM.querySelector&quot;,
-            {
-                &quot;nodeId&quot;: node.nodeId,
-                &quot;selector&quot;: selector
-            },
-            onQuerySelector);
-        }
-
-        function onQuerySelector(msg) {
-            InspectorTest.checkForError(msg);
-            var node = msg.result;
-            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},
-            };
-            InspectorTest.sendCommand(&quot;DOM.highlightNode&quot;,
-            {
-                &quot;nodeId&quot;: node.nodeId,
-                &quot;highlightConfig&quot;: highlightConfig
-            },
-            onHighlightNode);
-        }
-
-        function onHighlightNode(msg) {
-            InspectorTest.checkForError(msg);
-            InspectorTest.sendCommand(&quot;Runtime.evaluate&quot;,
-            {
-                &quot;expression&quot;: &quot;window.internals.inspectorHighlightObject()&quot;
-            },
-            onRuntimeEvaluate);
-        }
-
-        function onRuntimeEvaluate(msg) {
-            InspectorTest.checkForError(msg);
-            var value = JSON.parse(msg.result.result.value);
-            callback(value.elementInfo.shapeOutsideInfo);
-        }
-    }
-
-    function pathsRoughlyEqual(actual, expected) {
-        function coordinatesRoughlyEqual(actual, expected) {
-            // Some platforms may only store integer path points, so the potential
-            // differences between correct paths can be roughly half a unit
-            return (typeof actual === 'number'
-                &amp;&amp; typeof expected === 'number'
-                &amp;&amp; Math.abs(actual - expected) &lt; 0.5);
-        }
-
-        var expectedSubpathStart = 0, ei, ai;
-        for (var ei = 0, ai = 0; ai &lt; actual.length &amp;&amp; ei &lt; expected.length; ai++, ei++) {
-            if (expected[ei] === 'M')
-                expectedSubpathStart = ei;
-
-            if (actual[ai] === expected[ei]
-                || coordinatesRoughlyEqual(actual[ai], expected[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 (actual[ai] === 'Z'
-                &amp;&amp; expected[ei] === 'L'
-                &amp;&amp; coordinatesRoughlyEqual(expected[expectedSubpathStart + 1], expected[ei + 1])
-                &amp;&amp; coordinatesRoughlyEqual(expected[expectedSubpathStart + 2], expected[ei + 2])) {
-                ei += 2;
-                ai--;
-                continue;
-            }
-            return false;
-        }
-        return true;
-    }
-
-    function runShapeTest(testfn) {
-        var body = [
-            &quot;InspectorTest.shapeOutsideInfo = &quot; + shapeOutsideInfo.toString(),
-            &quot;InspectorTest.pathsRoughlyEqual = &quot; + pathsRoughlyEqual.toString(),
-            &quot;(&quot; + testfn.toString() + &quot;)()&quot;
-        ];
-        window.test = new Function(
-            body.join(';\n')
-        );
-        runTest();
-    }
-
-    return {
-        'runShapeTest' : runShapeTest
-    }
-})();
</del></span></pre></div>
<a id="trunkLayoutTestsplatformeflTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/efl/TestExpectations (165500 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/efl/TestExpectations        2014-03-12 21:49:58 UTC (rev 165500)
+++ trunk/LayoutTests/platform/efl/TestExpectations        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -1705,8 +1705,6 @@
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/124658 fast/text/break-word-pre-wrap.html [ ImageOnlyFailure ]
</span><span class="cx"> 
</span><del>-webkit.org/b/124660 inspector-protocol/model/highlight-shape-outside.html [ Failure ]
-
</del><span class="cx"> webkit.org/b/124662 mathml/presentation/mspace-units.html [ ImageOnlyFailure ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/124663 media/track/track-legacyapi-with-automatic-mode.html [ Skip ]
</span><span class="lines">@@ -1778,8 +1776,6 @@
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/127489 http/tests/misc/will-send-request-returns-null-on-redirect.html [ Failure ]
</span><span class="cx"> 
</span><del>-webkit.org/b/126519 inspector-protocol/model/highlight-shape-outside-margin.html [ Failure ]
-
</del><span class="cx"> webkit.org/b/126619 http/tests/media/video-auth.html [ Failure ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/127723 accessibility/menu-list-sends-change-notification.html [ Failure ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (165500 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2014-03-12 21:49:58 UTC (rev 165500)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -1324,8 +1324,6 @@
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/124566 fast/dom/SelectorAPI/resig-SelectorsAPI-test.xhtml [ Failure ]
</span><span class="cx"> 
</span><del>-webkit.org/b/124567 inspector-protocol/model/highlight-shape-outside.html [ Failure ]
-
</del><span class="cx"> webkit.org/b/124770 fast/dom/access-key-iframe.html [ Failure ]
</span><span class="cx"> webkit.org/b/124770 fast/forms/ValidityState-valueMissing-002.html [ Failure ]
</span><span class="cx"> webkit.org/b/124770 fast/forms/access-key-for-all-elements.html [ Failure ]
</span><span class="lines">@@ -1349,8 +1347,6 @@
</span><span class="cx"> webkit.org/b/126425 fast/block/float/overhanging-tall-block.html [ Failure ]
</span><span class="cx"> webkit.org/b/126425 scrollbars/scrollbar-large-overflow-rectangle.html [ Failure ]
</span><span class="cx"> 
</span><del>-webkit.org/b/126519 inspector-protocol/model/highlight-shape-outside-margin.html [ Failure ]
-
</del><span class="cx"> webkit.org/b/126521 accessibility/menu-list-sends-change-notification.html [ Failure ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/126619 http/tests/media/video-auth.html [ Failure ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwinTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/win/TestExpectations (165500 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/win/TestExpectations        2014-03-12 21:49:58 UTC (rev 165500)
+++ trunk/LayoutTests/platform/win/TestExpectations        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -1902,7 +1902,7 @@
</span><span class="cx"> webkit.org/b/128979 inspector-protocol/debugger/setBreakpoint-dfg-and-modify-local.html [ Failure ]
</span><span class="cx"> webkit.org/b/128979 inspector-protocol/debugger/setBreakpoint-dfg.html [ Failure ]
</span><span class="cx"> webkit.org/b/100846 inspector-protocol/debugger/terminate-dedicated-worker-while-paused.html [ Failure ]
</span><del>-webkit.org/b/128979 inspector-protocol/model/content-node-region-info.html [ Pass Failure ]
</del><ins>+webkit.org/b/128979 inspector/dom/content-node-region-info.html [ Pass Failure ]
</ins><span class="cx"> webkit.org/b/128979 [ Debug ] inspector-protocol/dom/getAccessibilityPropertiesForNode.html [ Crash ]
</span><span class="cx"> webkit.org/b/128979 [ Release ] inspector-protocol/dom/getAccessibilityPropertiesForNode.html [ Pass Failure ]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (165500 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2014-03-12 21:49:58 UTC (rev 165500)
+++ trunk/Source/WebInspectorUI/ChangeLog        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -1,3 +1,40 @@
</span><ins>+2014-03-12  Brian Burg  &lt;bburg@apple.com&gt;
+
+        Web Inspector: convert model tests and inspector-test.js to use Test.html
+        https://bugs.webkit.org/show_bug.cgi?id=129217
+
+        Reviewed by Timothy Hatcher.
+
+        Miscellaneous changes to make the inspector model test harness work well in
+        scenarios where the test page must navigate or reload. Also improve reporting
+        test failures so that messages will be dumped correctly even when an exception
+        is thrown in the Inspector or the test times out.
+
+        * UserInterface/Base/Test.js:
+        (WebInspector.loaded): register new managers and observers.
+        (InspectorTest.log): Stringify the argument if it's an object.
+        (InspectorTest.assert): Stringify the argument if it's an object. Don't log
+        unless the condition is false.
+
+        (InspectorTest.expectThat): Added. Like assert(), but always logs.
+        (InspectorTest.debugLog): Escape and unescape the string properly.
+        (InspectorTest.completeTest): Fix teardown so messages are not lost.
+        (InspectorTest.evaluateInPage): Accept a callback argument.
+        (InspectorTest.addResult): Don't rebuild results when adding a new result.
+        (InspectorTest._resendResults.decrementPendingResponseCount): Added.
+
+        (InspectorTest._resendResults): Added. Track the number of pending
+        responses and invoke a given callback when everything has been resent.
+
+        (InspectorTest.testPageDidLoad): Renamed from `pageLoaded`.
+        (InspectorTest.reloadPage): Added.
+        (InspectorTest.reportUncaughtException): Prevent the default handler from running.
+        * UserInterface/Protocol/InspectorBackend.js:
+        (InspectorBackendClass.prototype.dispatch): Report uncaught exceptions when dispatching
+        messages on the inspector page without blowing away the entire call stack.
+
+        * UserInterface/Test.html: Add files used by Network and Timeline domains.
+
</ins><span class="cx"> 2014-03-11  Brian Burg  &lt;bburg@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: DataGrid should have an API to set sort column and direction
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseTestjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Test.js (165500 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/Test.js        2014-03-12 21:49:58 UTC (rev 165500)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Test.js        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -30,7 +30,9 @@
</span><span class="cx">     InspectorBackend.registerInspectorDispatcher(new WebInspector.InspectorObserver);
</span><span class="cx">     InspectorBackend.registerPageDispatcher(new WebInspector.PageObserver);
</span><span class="cx">     InspectorBackend.registerDOMDispatcher(new WebInspector.DOMObserver);
</span><ins>+    InspectorBackend.registerNetworkDispatcher(new WebInspector.NetworkObserver);
</ins><span class="cx">     InspectorBackend.registerDebuggerDispatcher(new WebInspector.DebuggerObserver);
</span><ins>+    InspectorBackend.registerTimelineDispatcher(new WebInspector.TimelineObserver);
</ins><span class="cx">     InspectorBackend.registerCSSDispatcher(new WebInspector.CSSObserver);
</span><span class="cx">     InspectorBackend.registerRuntimeDispatcher(new WebInspector.RuntimeObserver);
</span><span class="cx"> 
</span><span class="lines">@@ -39,6 +41,7 @@
</span><span class="cx">     this.domTreeManager = new WebInspector.DOMTreeManager;
</span><span class="cx">     this.cssStyleManager = new WebInspector.CSSStyleManager;
</span><span class="cx">     this.runtimeManager = new WebInspector.RuntimeManager;
</span><ins>+    this.timelineManager = new WebInspector.TimelineManager;
</ins><span class="cx">     this.debuggerManager = new WebInspector.DebuggerManager;
</span><span class="cx">     this.probeManager = new WebInspector.ProbeManager;
</span><span class="cx"> 
</span><span class="lines">@@ -72,63 +75,92 @@
</span><span class="cx"> // Appends a log message in the test document.
</span><span class="cx"> InspectorTest.log = function(message)
</span><span class="cx"> {
</span><del>-    this.evaluateInPage(&quot;InspectorTestProxy.addResult(&quot; + JSON.stringify(message) + &quot;)&quot;);
</del><ins>+    var stringifiedMessage = typeof message !== &quot;object&quot; ? message : JSON.stringify(message);
+    InspectorTest.addResult(stringifiedMessage);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-// Appends an assert message in the test document.
</del><ins>+// Appends a message in the test document only if the condition is false.
</ins><span class="cx"> InspectorTest.assert = function(condition, message)
</span><span class="cx"> {
</span><del>-    var status = condition ? &quot;PASS&quot; : &quot;FAIL&quot;;
-    this.evaluateInPage(&quot;InspectorTestProxy.addResult(&quot; + JSON.stringify(status + &quot;: &quot; + message) + &quot;)&quot;);
</del><ins>+    if (condition)
+        return;
+
+    var stringifiedMessage = typeof message !== &quot;object&quot; ? message : JSON.stringify(message);
+    InspectorTest.addResult(&quot;ASSERT: &quot; + stringifiedMessage);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// Appends a message in the test document whether the condition is true or not.
+InspectorTest.expectThat = function(condition, message)
+{
+    var prefix = condition ? &quot;PASS&quot; : &quot;FAIL&quot;;
+    var stringifiedMessage = typeof message !== &quot;object&quot; ? message : JSON.stringify(message);
+    InspectorTest.addResult(prefix + &quot;: &quot; + stringifiedMessage);
+}
+
</ins><span class="cx"> // This function should only be used to debug tests and not to produce normal test output.
</span><span class="cx"> InspectorTest.debugLog = function(message)
</span><span class="cx"> {
</span><del>-    this.evaluateInPage(&quot;InspectorTestProxy.debugLog(&quot; + JSON.stringify(message) + &quot;)&quot;);
</del><ins>+    this.evaluateInPage(&quot;InspectorTestProxy.debugLog(unescape(&quot; + escape(JSON.stringify(message)) + &quot;))&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InspectorTest.completeTest = function()
</span><span class="cx"> {
</span><del>-    InspectorBackend.runAfterPendingDispatches(this.evaluateInPage.bind(this, &quot;InspectorTestProxy.completeTest()&quot;));
</del><ins>+    function signalCompletionToTestPage() {
+        InspectorBackend.runAfterPendingDispatches(this.evaluateInPage.bind(this, &quot;InspectorTestProxy.completeTest()&quot;));
+    }
+
+    // Wait for results to be resent before requesting completeTest(). Otherwise, messages will be
+    // queued after pending dispatches run to zero and the test page will quit before processing them.
+    if (this._shouldResendResults)
+        this._resendResults(signalCompletionToTestPage.bind(this));
+    else
+        signalCompletionToTestPage.call(this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-InspectorTest.evaluateInPage = function(codeString)
</del><ins>+InspectorTest.evaluateInPage = function(codeString, callback)
</ins><span class="cx"> {
</span><span class="cx">     // If we load this page outside of the inspector, or hit an early error when loading
</span><span class="cx">     // the test frontend, then defer evaluating the commands (indefinitely in the former case).
</span><span class="cx">     if (!RuntimeAgent) {
</span><del>-        InspectorTest._originalConsoleMethods[&quot;error&quot;](&quot;Tried to evaluate in test page, but connection not yet established:&quot;, codeString);
</del><ins>+        this._originalConsoleMethods[&quot;error&quot;](&quot;Tried to evaluate in test page, but connection not yet established:&quot;, codeString);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RuntimeAgent.evaluate(codeString, &quot;test&quot;, false);
</del><ins>+    RuntimeAgent.evaluate.invoke({expression: codeString, objectGroup: &quot;test&quot;, includeCommandLineAPI: false}, callback);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InspectorTest.addResult = function(text)
</span><span class="cx"> {
</span><span class="cx">     this._results.push(text);
</span><del>-    // If the test page reloaded, then we need to re-add the results from before the navigation.
-    if (this._shouldRebuildResults) {
-        delete this._shouldRebuildResults;
</del><ins>+    this.evaluateInPage(&quot;InspectorTestProxy.addResult(unescape('&quot; + escape(text) + &quot;'))&quot;);
+}
</ins><span class="cx"> 
</span><del>-        this.clearResults();
-        for (var result of this._results)
-            InspectorTest.evaluateInPage(&quot;InspectorTestProxy.addResult(unescape('&quot; + escape(text) + &quot;'))&quot;);
</del><ins>+InspectorTest._resendResults = function(callback)
+{
+    console.assert(this._shouldResendResults);
+    delete this._shouldResendResults;
+
+    var pendingResponseCount = 1 + this._results.length;
+    function decrementPendingResponseCount() {
+        pendingResponseCount--;
+        if (!pendingResponseCount &amp;&amp; typeof callback === &quot;function&quot;)
+            callback();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    InspectorTest.evaluateInPage(&quot;InspectorTestProxy.addResult(unescape('&quot; + escape(text) + &quot;'))&quot;);
</del><ins>+    this.evaluateInPage(&quot;InspectorTestProxy.clearResults()&quot;, decrementPendingResponseCount);
+    for (var result of this._results)
+        this.evaluateInPage(&quot;InspectorTestProxy.addResult(unescape('&quot; + escape(result) + &quot;'))&quot;, decrementPendingResponseCount);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-InspectorTest.clearResults = function(text)
</del><ins>+InspectorTest.testPageDidLoad = function()
</ins><span class="cx"> {
</span><del>-    InspectorTest.evaluateInPage(&quot;InspectorTestProxy.clearResults()&quot;);
</del><ins>+    this._shouldResendResults = true;
+    this._resendResults();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-InspectorTest.pageLoaded = function()
</del><ins>+InspectorTest.reloadPage = function(shouldIgnoreCache)
</ins><span class="cx"> {
</span><del>-    InspectorTest._shouldRebuildResults = true;
-    InspectorTest.addResult(&quot;Page reloaded.&quot;);
</del><ins>+    PageAgent.reload.invoke({ignoreCache: !!shouldIgnoreCache});
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InspectorTest.reportUncaughtException = function(message, url, lineNumber)
</span><span class="lines">@@ -138,21 +170,23 @@
</span><span class="cx">     // If the connection to the test page is not set up, then just dump to console and give up.
</span><span class="cx">     // Errors encountered this early can be debugged by loading Test.html in a normal browser page.
</span><span class="cx">     if (!InspectorFrontendHost || !InspectorBackend) {
</span><del>-        InspectorTest._originalConsoleMethods[&quot;error&quot;](result);
-        return;
</del><ins>+        this._originalConsoleMethods[&quot;error&quot;](result);
+        return false;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    InspectorTest.addResult(result);
-    InspectorTest.completeTest();
</del><ins>+    this.addResult(result);
+    this.completeTest();
+    // Stop default handler so we can empty InspectorBackend's message queue.
+    return true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Initialize reporting mechanisms before loading the rest of the inspector page.
</span><span class="cx"> InspectorTest._results = [];
</span><del>-InspectorTest._shouldRebuildResults = true;
</del><ins>+InspectorTest._shouldResendResults = true;
</ins><span class="cx"> InspectorTest._originalConsoleMethods = {};
</span><span class="cx"> 
</span><del>-// Catch syntax errors, type errors, and other exceptions. Run this before loading other files.
-window.onerror = InspectorTest.reportUncaughtException;
</del><ins>+// Catch syntax errors, type errors, and other exceptions.
+window.onerror = InspectorTest.reportUncaughtException.bind(InspectorTest);
</ins><span class="cx"> 
</span><span class="cx"> for (var logType of [&quot;log&quot;, &quot;error&quot;, &quot;info&quot;]) {
</span><span class="cx">     // Redirect console methods to log messages into the test page's DOM.
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolInspectorBackendjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js (165500 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js        2014-03-12 21:49:58 UTC (rev 165500)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -253,7 +253,11 @@
</span><span class="cx">             if (this.dumpInspectorTimeStats)
</span><span class="cx">                 processingStartTime = Date.now();
</span><span class="cx"> 
</span><del>-            dispatcher[functionName].apply(dispatcher, params);
</del><ins>+            try {
+                dispatcher[functionName].apply(dispatcher, params);
+            } catch (e) {
+                console.error(&quot;Uncaught exception in inspector page: &quot;, e);
+            }
</ins><span class="cx"> 
</span><span class="cx">             if (this.dumpInspectorTimeStats)
</span><span class="cx">                 console.log(&quot;time-stats: &quot; + messageObject.method + &quot; = &quot; + (Date.now() - processingStartTime));
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTesthtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Test.html (165500 => 165501)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Test.html        2014-03-12 21:49:58 UTC (rev 165500)
+++ trunk/Source/WebInspectorUI/UserInterface/Test.html        2014-03-12 22:16:53 UTC (rev 165501)
</span><span class="lines">@@ -48,12 +48,19 @@
</span><span class="cx">     &lt;script src=&quot;Protocol/DOMObserver.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Protocol/DOMStorageObserver.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Protocol/DebuggerObserver.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Protocol/NetworkObserver.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Protocol/PageObserver.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Protocol/RemoteObject.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Protocol/RuntimeObserver.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Protocol/TimelineObserver.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> 
</span><span class="cx">     &lt;script src=&quot;Models/BreakpointAction.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Models/SourceCode.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;Models/Timeline.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;Models/TimelineRecord.js&quot;&gt;&lt;/script&gt;
+
</ins><span class="cx">     &lt;script src=&quot;Models/Breakpoint.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Models/CallFrame.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Models/Color.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/ContentFlow.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/DOMNode.js&quot;&gt;&lt;/script&gt;
</span><span class="lines">@@ -62,24 +69,32 @@
</span><span class="cx">     &lt;script src=&quot;Models/ExecutionContext.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/ExecutionContextList.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/Frame.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Models/Geometry.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Models/IndexedDatabase.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/IndexedDatabaseObjectStore.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/IndexedDatabaseObjectStoreIndex.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Models/LayoutTimelineRecord.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;Models/NetworkTimeline.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Models/Probe.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/ProbeSet.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/ProbeSetDataFrame.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/ProbeSetDataTable.js&quot;&gt;&lt;/script&gt;
</span><del>-
-    &lt;script src=&quot;Models/SourceCode.js&quot;&gt;&lt;/script&gt;
</del><ins>+    &lt;script src=&quot;Models/Profile.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;Models/ProfileNode.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;Models/ProfileNodeCall.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Models/Resource.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/ResourceCollection.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Models/ResourceTimelineRecord.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Models/Revision.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/Script.js&quot;&gt;&lt;/script&gt;
</span><del>-    &lt;script src=&quot;Models/Setting.js&quot;&gt;&lt;/script&gt;
</del><ins>+    &lt;script src=&quot;Models/ScriptTimelineRecord.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Models/SourceCodeLocation.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/SourceCodeRevision.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Models/SourceCodeTimeline.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Models/SourceMapResource.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Models/TextRange.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Models/TimelineMarker.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;Models/TimelineRecording.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> 
</span><span class="cx">     &lt;script src=&quot;Controllers/CSSStyleManager.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Controllers/DOMTreeManager.js&quot;&gt;&lt;/script&gt;
</span><span class="lines">@@ -88,6 +103,7 @@
</span><span class="cx">     &lt;script src=&quot;Controllers/ProbeManager.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Controllers/RuntimeManager.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Controllers/StorageManager.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Controllers/TimelineManager.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> 
</span><span class="cx">     &lt;script type=&quot;text/javascript&quot;&gt;
</span><span class="cx">         WebInspector.loaded();
</span></span></pre>
</div>
</div>

</body>
</html>