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

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

<h3>Log Message</h3>
<pre>Web Inspector: clean up initialization of managers and observers in InspectorTest
https://bugs.webkit.org/show_bug.cgi?id=127707

Reviewed by Timothy Hatcher.

The test harness was setting up managers and observers before
telling the frontend host that the page loaded. The InspectorObserver
was also not being initialized.

For clarity, rename importInspectorScripts to initializeInspectorModels.
For easier debugging, make model test assertions use InspectorTest.log.

* http/tests/inspector-protocol/resources/InspectorTest.js:
(InspectorTest.initializeInspectorModels.console.error.window.onerror):
(InspectorTest.initializeInspectorModels.console.assert):
(InspectorTest.initializeInspectorModels):
* inspector-protocol/model/content-flow-content-nodes.html:
* inspector-protocol/model/content-flow-content-removal.html:
* inspector-protocol/model/content-flow-list.html:
* inspector-protocol/model/content-node-region-info.html:
* inspector-protocol/model/main-frame-resource.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestshttptestsinspectorprotocolresourcesInspectorTestjs">trunk/LayoutTests/http/tests/inspector-protocol/resources/InspectorTest.js</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocolmodelcontentflowcontentnodeshtml">trunk/LayoutTests/inspector-protocol/model/content-flow-content-nodes.html</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocolmodelcontentflowcontentremovalhtml">trunk/LayoutTests/inspector-protocol/model/content-flow-content-removal.html</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocolmodelcontentflowlisthtml">trunk/LayoutTests/inspector-protocol/model/content-flow-list.html</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocolmodelcontentnoderegioninfohtml">trunk/LayoutTests/inspector-protocol/model/content-node-region-info.html</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocolmodelmainframeresourcehtml">trunk/LayoutTests/inspector-protocol/model/main-frame-resource.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (162895 => 162896)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-01-28 01:50:27 UTC (rev 162895)
+++ trunk/LayoutTests/ChangeLog        2014-01-28 01:56:54 UTC (rev 162896)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2014-01-27  Brian Burg  &lt;bburg@apple.com&gt;
+
+        Web Inspector: clean up initialization of managers and observers in InspectorTest
+        https://bugs.webkit.org/show_bug.cgi?id=127707
+
+        Reviewed by Timothy Hatcher.
+
+        The test harness was setting up managers and observers before
+        telling the frontend host that the page loaded. The InspectorObserver
+        was also not being initialized.
+
+        For clarity, rename importInspectorScripts to initializeInspectorModels.
+        For easier debugging, make model test assertions use InspectorTest.log.
+
+        * http/tests/inspector-protocol/resources/InspectorTest.js:
+        (InspectorTest.initializeInspectorModels.console.error.window.onerror):
+        (InspectorTest.initializeInspectorModels.console.assert):
+        (InspectorTest.initializeInspectorModels):
+        * inspector-protocol/model/content-flow-content-nodes.html:
+        * inspector-protocol/model/content-flow-content-removal.html:
+        * inspector-protocol/model/content-flow-list.html:
+        * inspector-protocol/model/content-node-region-info.html:
+        * inspector-protocol/model/main-frame-resource.html:
+
</ins><span class="cx"> 2014-01-27  David Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [New Multicolumn] Add support for block progression axis and reverse direction
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsinspectorprotocolresourcesInspectorTestjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/inspector-protocol/resources/InspectorTest.js (162895 => 162896)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/inspector-protocol/resources/InspectorTest.js        2014-01-28 01:50:27 UTC (rev 162895)
+++ trunk/LayoutTests/http/tests/inspector-protocol/resources/InspectorTest.js        2014-01-28 01:56:54 UTC (rev 162896)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2012 Samsung Electronics. All rights reserved.
</span><ins>+ * Copyright (C) 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -151,12 +152,12 @@
</span><span class="cx">     window.eval(script);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-InspectorTest.importInspectorScripts = function()
</del><ins>+InspectorTest.initializeInspectorModels = function()
</ins><span class="cx"> {
</span><span class="cx">     // Catch any errors and finish the test early.
</span><span class="cx">     console.error = window.onerror = function()
</span><span class="cx">     {
</span><del>-        console.log(Array.prototype.join.call(arguments, ', '));
</del><ins>+        InspectorTest.log(Array.prototype.join.call(arguments, ', '));
</ins><span class="cx">         InspectorTest.completeTest();
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="lines">@@ -164,8 +165,8 @@
</span><span class="cx">     {
</span><span class="cx">         if (assertion)
</span><span class="cx">             return;
</span><del>-        console.log(&quot;ASSERT:&quot; + message);
</del><span class="cx">         InspectorTest.completeTest();
</span><ins>+        InspectorTest.log(&quot;ASSERT:&quot; + message);
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     // Note: This function overwrites the InspectorFrontendAPI, so there's currently no
</span><span class="lines">@@ -183,6 +184,7 @@
</span><span class="cx">         &quot;URLUtilities&quot;,
</span><span class="cx">         &quot;MessageDispatcher&quot;,
</span><span class="cx">         &quot;Setting&quot;,
</span><ins>+        &quot;InspectorObserver&quot;,
</ins><span class="cx">         &quot;PageObserver&quot;,
</span><span class="cx">         &quot;DOMObserver&quot;,
</span><span class="cx">         &quot;CSSObserver&quot;,
</span><span class="lines">@@ -206,6 +208,8 @@
</span><span class="cx">         &quot;RuntimeObserver&quot;,
</span><span class="cx">         &quot;RuntimeManager&quot;
</span><span class="cx">     ];
</span><ins>+
+    // This corresponds to loading the scripts in Main.hml.
</ins><span class="cx">     for (var i = 0; i &lt; inspectorScripts.length; ++i)
</span><span class="cx">         InspectorTest.importScript(&quot;../../../../../Source/WebInspectorUI/UserInterface/&quot; + inspectorScripts[i] + &quot;.js&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -213,6 +217,12 @@
</span><span class="cx">     // FIXME: As soon as we can support all the observers and managers we should remove UI related tasks
</span><span class="cx">     // from WebInspector.loaded, so that it can be used from the LayoutTests.
</span><span class="cx"> 
</span><ins>+    InspectorFrontendHost.loaded();
+
+    // Enable agents.
+    InspectorAgent.enable();
+
+    InspectorBackend.registerInspectorDispatcher(new WebInspector.InspectorObserver);
</ins><span class="cx">     InspectorBackend.registerPageDispatcher(new WebInspector.PageObserver);
</span><span class="cx">     InspectorBackend.registerDOMDispatcher(new WebInspector.DOMObserver);
</span><span class="cx">     InspectorBackend.registerCSSDispatcher(new WebInspector.CSSObserver);
</span><span class="lines">@@ -223,8 +233,6 @@
</span><span class="cx">     WebInspector.domTreeManager = new WebInspector.DOMTreeManager;
</span><span class="cx">     WebInspector.cssStyleManager = new WebInspector.CSSStyleManager;
</span><span class="cx">     WebInspector.runtimeManager = new WebInspector.RuntimeManager;
</span><del>-
-    InspectorFrontendHost.loaded();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolmodelcontentflowcontentnodeshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector-protocol/model/content-flow-content-nodes.html (162895 => 162896)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/model/content-flow-content-nodes.html        2014-01-28 01:50:27 UTC (rev 162895)
+++ trunk/LayoutTests/inspector-protocol/model/content-flow-content-nodes.html        2014-01-28 01:56:54 UTC (rev 162896)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><del>-    InspectorTest.importInspectorScripts();
</del><ins>+    InspectorTest.initializeInspectorModels();
</ins><span class="cx"> 
</span><span class="cx">     var contentFlow;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolmodelcontentflowcontentremovalhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector-protocol/model/content-flow-content-removal.html (162895 => 162896)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/model/content-flow-content-removal.html        2014-01-28 01:50:27 UTC (rev 162895)
+++ trunk/LayoutTests/inspector-protocol/model/content-flow-content-removal.html        2014-01-28 01:56:54 UTC (rev 162896)
</span><span class="lines">@@ -16,7 +16,7 @@
</span><span class="cx"> 
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><del>-    InspectorTest.importInspectorScripts();
</del><ins>+    InspectorTest.initializeInspectorModels();
</ins><span class="cx"> 
</span><span class="cx">     var contentFlow;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolmodelcontentflowlisthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector-protocol/model/content-flow-list.html (162895 => 162896)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/model/content-flow-list.html        2014-01-28 01:50:27 UTC (rev 162895)
+++ trunk/LayoutTests/inspector-protocol/model/content-flow-list.html        2014-01-28 01:56:54 UTC (rev 162896)
</span><span class="lines">@@ -16,7 +16,7 @@
</span><span class="cx"> 
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><del>-    InspectorTest.importInspectorScripts();
</del><ins>+    InspectorTest.initializeInspectorModels();
</ins><span class="cx"> 
</span><span class="cx">     WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.MainFrameDidChange, function(event) {
</span><span class="cx">         var domTree = WebInspector.frameResourceManager.mainFrame.domTree;
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolmodelcontentnoderegioninfohtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector-protocol/model/content-node-region-info.html (162895 => 162896)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/model/content-node-region-info.html        2014-01-28 01:50:27 UTC (rev 162895)
+++ trunk/LayoutTests/inspector-protocol/model/content-node-region-info.html        2014-01-28 01:56:54 UTC (rev 162896)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx">     var queryList = [&quot;#flow&quot;, &quot;.contentNode1&quot;, &quot;.contentNode2&quot;, &quot;body&quot;, &quot;#region1&quot;, &quot;#region2&quot;];
</span><span class="cx">     var documentNodeId;
</span><span class="cx"> 
</span><del>-    InspectorTest.importInspectorScripts();
</del><ins>+    InspectorTest.initializeInspectorModels();
</ins><span class="cx">     WebInspector.domTreeManager.requestDocument(function(documentNode) {
</span><span class="cx">         documentNodeId = documentNode.id;
</span><span class="cx">         WebInspector.domTreeManager.getNamedFlowCollection(documentNodeId);
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolmodelmainframeresourcehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector-protocol/model/main-frame-resource.html (162895 => 162896)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/model/main-frame-resource.html        2014-01-28 01:50:27 UTC (rev 162895)
+++ trunk/LayoutTests/inspector-protocol/model/main-frame-resource.html        2014-01-28 01:56:54 UTC (rev 162896)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx"> &lt;script&gt;
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><del>-    InspectorTest.importInspectorScripts();
</del><ins>+    InspectorTest.initializeInspectorModels();
</ins><span class="cx"> 
</span><span class="cx">     WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.MainFrameDidChange, function(event) {
</span><span class="cx">         var url = WebInspector.frameResourceManager.mainFrame.url;
</span></span></pre>
</div>
</div>

</body>
</html>