<!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>[80416] 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/80416">80416</a></dd>
<dt>Author</dt> <dd>pfeldman@chromium.org</dd>
<dt>Date</dt> <dd>2011-03-05 02:09:35 -0800 (Sat, 05 Mar 2011)</dd>
</dl>

<h3>Log Message</h3>
<pre>2011-03-04  Pavel Feldman  <pfeldman@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: fix layout tests flakiness.
        https://bugs.webkit.org/show_bug.cgi?id=55816

        - Timeline now uses instrumentation calls, not UI representation while collecting events for tests
        - No reloads in debugger tests that don't need them
        - Forcing layout in timeline via calculating offsetHeight

        * http/tests/inspector/inspector-test.js:
        * inspector/console/console-uncaught-exception-expected.txt:
        * inspector/console/console-uncaught-exception.html:
        * inspector/debugger/debugger-autocontinue-on-syntax-error-expected.txt:
        * inspector/debugger/debugger-autocontinue-on-syntax-error.html:
        * inspector/debugger/resources/syntax-error.html: Added.
        * inspector/debugger/resources/syntax-error.js: Removed.
        * inspector/elements/elements-panel-limited-children-expected.txt:
        * inspector/extensions/extensions-events-expected.txt:
        * inspector/styles/styles-update-from-js-expected.txt:
        * inspector/styles/styles-update-from-js.html:
        * inspector/timeline/timeline-layout.html:
        * inspector/timeline/timeline-network-resource-expected.txt:
        * inspector/timeline/timeline-network-resource.html:
        * inspector/timeline/timeline-script-tag-1.html:
        * inspector/timeline/timeline-script-tag-2.html:
        * inspector/timeline/timeline-test.js:
        (initialize_Timeline.InspectorTest.startTimeline.addRecord):
        (initialize_Timeline.InspectorTest.startTimeline):
        (initialize_Timeline.InspectorTest.stopTimeline):
        (initialize_Timeline.InspectorTest.performActionsAndPrint.step2):
        (initialize_Timeline.InspectorTest.performActionsAndPrint):
        (initialize_Timeline.InspectorTest.printTimelineRecords):
        * inspector/timeline/timeline-trivial.html:
        * platform/chromium/inspector/timeline/timeline-network-resource-expected.txt:
2011-03-04  Pavel Feldman  <pfeldman@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: fix layout tests flakiness.
        https://bugs.webkit.org/show_bug.cgi?id=55816

        - Order of issuing of evaluateForTestInFrontend was not guaranteed on the backend side (InspectorAgent side)
        - Order of dispatching using timeouts was guaranteed via queueing. Source of all kinds of pains on SnowLeopard Release (inspector.js)

        * inspector/CodeGeneratorInspector.pm:
        * inspector/InspectorAgent.cpp:
        (WebCore::InspectorAgent::InspectorAgent):
        (WebCore::InspectorAgent::disconnectFrontend):
        (WebCore::InspectorAgent::populateScriptObjects):
        (WebCore::InspectorAgent::evaluateForTestInFrontend):
        (WebCore::InspectorAgent::issueEvaluateForTestCommands):
        * inspector/InspectorAgent.h:
        * inspector/front-end/TimelinePanel.js:
        (WebInspector.TimelinePanel.FormattedRecord):
        * inspector/front-end/inspector.js:
        (WebInspector.dispatch):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestshttptestsinspectorinspectortestjs">trunk/LayoutTests/http/tests/inspector/inspector-test.js</a></li>
<li><a href="#trunkLayoutTestsinspectorauditsauditspanelfunctionalhtml">trunk/LayoutTests/inspector/audits/audits-panel-functional.html</a></li>
<li><a href="#trunkLayoutTestsinspectorconsoleconsoleuncaughtexceptionexpectedtxt">trunk/LayoutTests/inspector/console/console-uncaught-exception-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorconsoleconsoleuncaughtexceptionhtml">trunk/LayoutTests/inspector/console/console-uncaught-exception.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerdebuggerautocontinueonsyntaxerrorexpectedtxt">trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerdebuggerautocontinueonsyntaxerrorhtml">trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error.html</a></li>
<li><a href="#trunkLayoutTestsinspectorelementselementsdeleteinlinestylehtml">trunk/LayoutTests/inspector/elements/elements-delete-inline-style.html</a></li>
<li><a href="#trunkLayoutTestsinspectorelementselementspanellimitedchildrenexpectedtxt">trunk/LayoutTests/inspector/elements/elements-panel-limited-children-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorelementselementspanelsearchhtml">trunk/LayoutTests/inspector/elements/elements-panel-search.html</a></li>
<li><a href="#trunkLayoutTestsinspectorextensionsextensionseventsexpectedtxt">trunk/LayoutTests/inspector/extensions/extensions-events-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorstylesstylesaddblankpropertyhtml">trunk/LayoutTests/inspector/styles/styles-add-blank-property.html</a></li>
<li><a href="#trunkLayoutTestsinspectorstylesstylesupdatefromjsexpectedtxt">trunk/LayoutTests/inspector/styles/styles-update-from-js-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorstylesstylesupdatefromjshtml">trunk/LayoutTests/inspector/styles/styles-update-from-js.html</a></li>
<li><a href="#trunkLayoutTestsinspectortimelinetimelinelayouthtml">trunk/LayoutTests/inspector/timeline/timeline-layout.html</a></li>
<li><a href="#trunkLayoutTestsinspectortimelinetimelinenetworkresourceexpectedtxt">trunk/LayoutTests/inspector/timeline/timeline-network-resource-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectortimelinetimelinenetworkresourcehtml">trunk/LayoutTests/inspector/timeline/timeline-network-resource.html</a></li>
<li><a href="#trunkLayoutTestsinspectortimelinetimelinescripttag1html">trunk/LayoutTests/inspector/timeline/timeline-script-tag-1.html</a></li>
<li><a href="#trunkLayoutTestsinspectortimelinetimelinescripttag2html">trunk/LayoutTests/inspector/timeline/timeline-script-tag-2.html</a></li>
<li><a href="#trunkLayoutTestsinspectortimelinetimelinetestjs">trunk/LayoutTests/inspector/timeline/timeline-test.js</a></li>
<li><a href="#trunkLayoutTestsinspectortimelinetimelinetrivialhtml">trunk/LayoutTests/inspector/timeline/timeline-trivial.html</a></li>
<li><a href="#trunkLayoutTestsplatformchromiuminspectorconsoleconsoleuncaughtexceptionexpectedtxt">trunk/LayoutTests/platform/chromium/inspector/console/console-uncaught-exception-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformchromiuminspectordebuggerdebuggerautocontinueonsyntaxerrorexpectedtxt">trunk/LayoutTests/platform/chromium/inspector/debugger/debugger-autocontinue-on-syntax-error-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformchromiuminspectortimelinetimelinenetworkresourceexpectedtxt">trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-network-resource-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectorCodeGeneratorInspectorpm">trunk/Source/WebCore/inspector/CodeGeneratorInspector.pm</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorAgentcpp">trunk/Source/WebCore/inspector/InspectorAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorAgenth">trunk/Source/WebCore/inspector/InspectorAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorfrontendTimelinePaneljs">trunk/Source/WebCore/inspector/front-end/TimelinePanel.js</a></li>
<li><a href="#trunkSourceWebCoreinspectorfrontendinspectorjs">trunk/Source/WebCore/inspector/front-end/inspector.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectorconsoleresourcesuncaughtiniframehtml">trunk/LayoutTests/inspector/console/resources/uncaught-in-iframe.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerresourcessyntaxerrorhtml">trunk/LayoutTests/inspector/debugger/resources/syntax-error.html</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectordebuggerresourcessyntaxerrorjs">trunk/LayoutTests/inspector/debugger/resources/syntax-error.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/ChangeLog 2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -1,3 +1,40 @@
</span><ins>+2011-03-04  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: fix layout tests flakiness.
+        https://bugs.webkit.org/show_bug.cgi?id=55816
+
+        - Timeline now uses instrumentation calls, not UI representation while collecting events for tests
+        - No reloads in debugger tests that don't need them
+        - Forcing layout in timeline via calculating offsetHeight
+
+        * http/tests/inspector/inspector-test.js:
+        * inspector/console/console-uncaught-exception-expected.txt:
+        * inspector/console/console-uncaught-exception.html:
+        * inspector/debugger/debugger-autocontinue-on-syntax-error-expected.txt:
+        * inspector/debugger/debugger-autocontinue-on-syntax-error.html:
+        * inspector/debugger/resources/syntax-error.html: Added.
+        * inspector/debugger/resources/syntax-error.js: Removed.
+        * inspector/elements/elements-panel-limited-children-expected.txt:
+        * inspector/extensions/extensions-events-expected.txt:
+        * inspector/styles/styles-update-from-js-expected.txt:
+        * inspector/styles/styles-update-from-js.html:
+        * inspector/timeline/timeline-layout.html:
+        * inspector/timeline/timeline-network-resource-expected.txt:
+        * inspector/timeline/timeline-network-resource.html:
+        * inspector/timeline/timeline-script-tag-1.html:
+        * inspector/timeline/timeline-script-tag-2.html:
+        * inspector/timeline/timeline-test.js:
+        (initialize_Timeline.InspectorTest.startTimeline.addRecord):
+        (initialize_Timeline.InspectorTest.startTimeline):
+        (initialize_Timeline.InspectorTest.stopTimeline):
+        (initialize_Timeline.InspectorTest.performActionsAndPrint.step2):
+        (initialize_Timeline.InspectorTest.performActionsAndPrint):
+        (initialize_Timeline.InspectorTest.printTimelineRecords):
+        * inspector/timeline/timeline-trivial.html:
+        * platform/chromium/inspector/timeline/timeline-network-resource-expected.txt:
+
</ins><span class="cx"> 2011-03-05  Csaba Osztrogonác  <ossy@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Unreviewed.
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsinspectorinspectortestjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/inspector/inspector-test.js (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/inspector/inspector-test.js 2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/http/tests/inspector/inspector-test.js    2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -276,7 +276,7 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        WebInspector.showPanel("elements");
</del><ins>+        WebInspector.showPanel("console");
</ins><span class="cx">         try {
</span><span class="cx">             testFunction();
</span><span class="cx">         } catch (e) {
</span><span class="lines">@@ -328,10 +328,16 @@
</span><span class="cx"> function output(text)
</span><span class="cx"> {
</span><span class="cx">     if (!outputElement) {
</span><ins>+        var intermediate = document.createElement("div");
+        document.body.appendChild(intermediate);
+
+        var intermediate2 = document.createElement("div");
+        intermediate.appendChild(intermediate2);
+
</ins><span class="cx">         outputElement = document.createElement("div");
</span><span class="cx">         outputElement.className = "output";
</span><span class="cx">         outputElement.style.whiteSpace = "pre";
</span><del>-        document.body.appendChild(outputElement);
</del><ins>+        intermediate2.appendChild(outputElement);
</ins><span class="cx">     }
</span><span class="cx">     outputElement.appendChild(document.createTextNode(text));
</span><span class="cx">     outputElement.appendChild(document.createElement("br"));
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorauditsauditspanelfunctionalhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/audits/audits-panel-functional.html (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/audits/audits-panel-functional.html  2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/audits/audits-panel-functional.html     2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -16,6 +16,8 @@
</span><span class="cx"> <script>
</span><span class="cx"> var test = function()
</span><span class="cx"> {
</span><ins>+    WebInspector.showPanel("elements");
+
</ins><span class="cx">     InspectorTest.reloadPage(step1);
</span><span class="cx"> 
</span><span class="cx">     function step1()
</span><span class="lines">@@ -30,7 +32,7 @@
</span><span class="cx">         launcherView._launchButtonClicked();
</span><span class="cx"> 
</span><span class="cx">         InspectorTest.runAfterPendingDispatches(step2);
</span><del>-    }    
</del><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     function step2()
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorconsoleconsoleuncaughtexceptionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/console/console-uncaught-exception-expected.txt (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/console/console-uncaught-exception-expected.txt      2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/console/console-uncaught-exception-expected.txt 2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -1,13 +1,10 @@
</span><del>-CONSOLE MESSAGE: line 35: Error: Exception in inline script.
-CONSOLE MESSAGE: line 19: Error: Exception in 'load' event listener.
-CONSOLE MESSAGE: line 27: Error: Exception in setTimeout callback.
-CONSOLE MESSAGE: line 35: Error: Exception in inline script.
-CONSOLE MESSAGE: line 19: Error: Exception in 'load' event listener.
-CONSOLE MESSAGE: line 27: Error: Exception in setTimeout callback.
</del><ins>+CONSOLE MESSAGE: line 18: Error: Exception in inline script.
+CONSOLE MESSAGE: line 11: Error: Exception in 'load' event listener.
+CONSOLE MESSAGE: line 6: Error: Exception in setTimeout callback.
</ins><span class="cx"> Tests that uncaught exceptions are logged into console.Bug 47250.
</span><span class="cx"> 
</span><del>-Page reloaded.
-console-uncaught-exception.html:35Error: Exception in inline script.
-console-uncaught-exception.html:19Error: Exception in 'load' event listener.
-console-uncaught-exception.html:27Error: Exception in setTimeout callback.
</del><span class="cx"> 
</span><ins>+uncaught-in-iframe.html:18Error: Exception in inline script.
+uncaught-in-iframe.html:11Error: Exception in 'load' event listener.
+uncaught-in-iframe.html:6Error: Exception in setTimeout callback.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorconsoleconsoleuncaughtexceptionhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/console/console-uncaught-exception.html (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/console/console-uncaught-exception.html      2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/console/console-uncaught-exception.html 2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -4,44 +4,27 @@
</span><span class="cx"> <script src="../../http/tests/inspector/console-test.js"></script>
</span><span class="cx"> <script>
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> function test()
</span><span class="cx"> {
</span><del>-    InspectorTest.reloadPage(function() {
-        InspectorTest.expandConsoleMessages();
-        InspectorTest.dumpConsoleMessages();
-        InspectorTest.completeTest();
-    });
-}
-
-window.addEventListener("load", function(e) {
-    function f() {
-        throw new Error("Exception in 'load' event listener.")
</del><ins>+    InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", addMessage, true);
+    InspectorTest.evaluateInPage("loadIframe()");
+    function addMessage(message)
+    {
+        if (message.toString().indexOf("setTimeout") !== -1) {
+            InspectorTest.expandConsoleMessages();
+            InspectorTest.dumpConsoleMessages();
+            InspectorTest.completeTest();
+        }
</ins><span class="cx">     }
</span><del>-    f();
-}, false);
-
-
-setTimeout(function() {
-    function bar() {
-        throw new Error("Exception in setTimeout callback.");
-    }
-    bar();
-}, 0);
-
-
-function a()
-{
-    throw new Error("Exception in inline script.")
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-function b()
</del><ins>+function loadIframe()
</ins><span class="cx"> {
</span><del>-    a();
</del><ins>+    var iframe = document.createElement("iframe");
+    iframe.src = "resources/uncaught-in-iframe.html";
+    document.body.appendChild(iframe);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-b();
-
</del><span class="cx"> </script>
</span><span class="cx"> </head>
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorconsoleresourcesuncaughtiniframehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/console/resources/uncaught-in-iframe.html (0 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/console/resources/uncaught-in-iframe.html                            (rev 0)
+++ trunk/LayoutTests/inspector/console/resources/uncaught-in-iframe.html       2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+<script>
+window.addEventListener("load", function(e) {
+    function f() {
+        setTimeout(function() {
+            function bar() {
+                throw new Error("Exception in setTimeout callback.");
+            }
+            bar();
+        }, 0);
+
+        throw new Error("Exception in 'load' event listener.")
+    }
+    f();
+}, false);
+
+function a()
+{
+    throw new Error("Exception in inline script.")
+}
+
+function b()
+{
+    a();
+}
+
+b();
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerdebuggerautocontinueonsyntaxerrorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error-expected.txt (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error-expected.txt  2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error-expected.txt     2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -1,8 +1,7 @@
</span><del>-CONSOLE MESSAGE: line 1: SyntaxError: Parse error
-CONSOLE MESSAGE: line 1: SyntaxError: Parse error
</del><ins>+CONSOLE MESSAGE: line 4: SyntaxError: Parse error
+CONSOLE MESSAGE: line 8: Iframe loaded
</ins><span class="cx"> Tests that debugger won't stop on syntax errors even if "pause on uncaught exceptions" is on.
</span><span class="cx"> 
</span><span class="cx"> Debugger was enabled.
</span><del>-Page reloaded.
</del><span class="cx"> Debugger was disabled.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerdebuggerautocontinueonsyntaxerrorhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error.html (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error.html  2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error.html     2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -2,27 +2,31 @@
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../http/tests/inspector/inspector-test.js"></script>
</span><span class="cx"> <script src="../../http/tests/inspector/debugger-test.js"></script>
</span><del>-<script src="resources/syntax-error.js"></script>
</del><span class="cx"> <script>
</span><span class="cx"> 
</span><ins>+function loadIframe()
+{
+    var iframe = document.createElement("iframe");
+    iframe.src = "resources/syntax-error.html";
+    document.body.appendChild(iframe);
+}
+
</ins><span class="cx"> function test()
</span><span class="cx"> {
</span><span class="cx">     WebInspector.showPanel("scripts");
</span><del>-    InspectorTest.startDebuggerTest(startDebuggerTestCallback);
</del><ins>+    InspectorTest.startDebuggerTest(step1);
</ins><span class="cx"> 
</span><del>-    function startDebuggerTestCallback()
</del><ins>+    function step1()
</ins><span class="cx">     {
</span><span class="cx">         DebuggerAgent.setPauseOnExceptionsState(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
</span><del>-        InspectorTest.showScriptSource("debugger-autocontinue-on-syntax-error.html", reloadInspectedPage);
</del><ins>+        InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+        InspectorTest.evaluateInPage("loadIframe()");
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    function reloadInspectedPage()
</del><ins>+    function step2()
</ins><span class="cx">     {
</span><del>-        InspectorTest.reloadPage(function() {
-            InspectorTest.completeDebuggerTest();
-        });
</del><ins>+        InspectorTest.completeDebuggerTest();
</ins><span class="cx">     }
</span><del>-
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerresourcessyntaxerrorhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/resources/syntax-error.html (0 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/resources/syntax-error.html                         (rev 0)
+++ trunk/LayoutTests/inspector/debugger/resources/syntax-error.html    2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+<html>
+<head>
+<script>
+)
+</script>
+</head>
+
+<body onload="console.log('Iframe loaded');">
+</body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerresourcessyntaxerrorjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/inspector/debugger/resources/syntax-error.js (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/resources/syntax-error.js   2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/debugger/resources/syntax-error.js      2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -1 +0,0 @@
</span><del>-)
</del></span></pre></div>
<a id="trunkLayoutTestsinspectorelementselementsdeleteinlinestylehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/elements/elements-delete-inline-style.html (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/elements/elements-delete-inline-style.html   2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/elements/elements-delete-inline-style.html      2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -6,29 +6,14 @@
</span><span class="cx"> 
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><del>-
</del><ins>+    WebInspector.showPanel("elements");
</ins><span class="cx">     InspectorTest.selectNodeWithId("inspected", step1);
</span><span class="cx"> 
</span><del>-    function step1()
</del><ins>+    function step1(node)
</ins><span class="cx">     {
</span><span class="cx">         InspectorTest.addResult("Before style property removal:");
</span><span class="cx">         InspectorTest.dumpSelectedElementStyles(true);
</span><del>-
-        var treeElement;
-        var innerMapping = WebInspector.domAgent._idToDOMNode;
-        for (var nodeId in innerMapping) {
-            if (innerMapping[nodeId].nodeName === "DIV") {
-                treeElement = WebInspector.panels.elements.treeOutline.findTreeElement(innerMapping[nodeId]);
-                break;
-            }
-        }
-        var styleAttrElement = treeElement.listItemElement.getElementsByClassName("webkit-html-attribute")[1];
-        treeElement._startEditingTarget(styleAttrElement);
-        var editorElement = window.getSelection().anchorNode.parentElement;
-
-        // Remove the "style" attribute altogether (not just clear its value).
-        editorElement.textContent = "";
-        editorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
</del><ins>+        node.removeAttribute("style");
</ins><span class="cx">         InspectorTest.runAfterPendingDispatches(step2);
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorelementselementspanellimitedchildrenexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/elements/elements-panel-limited-children-expected.txt (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/elements/elements-panel-limited-children-expected.txt        2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/elements/elements-panel-limited-children-expected.txt   2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx">               Show All Nodes (6 More)
</span><span class="cx">           </div>
</span><span class="cx">           <p>Tests that src and href element targets are rewritten properly.</p>
</span><del>-        + <div class="output" style="white-space: pre; ">…</div>
</del><ins>+        + <div>…</div>
</ins><span class="cx">       </body>
</span><span class="cx">   </html>
</span><span class="cx"> =========== Loaded all children ===========
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx">               <a></a>
</span><span class="cx">           </div>
</span><span class="cx">           <p>Tests that src and href element targets are rewritten properly.</p>
</span><del>-        + <div class="output" style="white-space: pre; ">…</div>
</del><ins>+        + <div>…</div>
</ins><span class="cx">       </body>
</span><span class="cx">   </html>
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorelementselementspanelsearchhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/elements/elements-panel-search.html (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/elements/elements-panel-search.html  2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/elements/elements-panel-search.html     2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -5,6 +5,8 @@
</span><span class="cx"> <script>
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><ins>+    WebInspector.showPanel("elements");
+
</ins><span class="cx">     var searchResults = [];
</span><span class="cx">     function addSearchResult(markupValue)
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorextensionsextensionseventsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/extensions/extensions-events-expected.txt (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/extensions/extensions-events-expected.txt    2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/extensions/extensions-events-expected.txt       2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -5,8 +5,8 @@
</span><span class="cx"> RUNNING TEST: extension_testOnResourceFinished
</span><span class="cx"> onFinished fired
</span><span class="cx"> RUNNING TEST: extension_testPageLoadEvents
</span><ins>+Page reloaded.
</ins><span class="cx"> onDOMContentLoaded fired: number
</span><span class="cx"> onLoaded fired: number
</span><del>-Page reloaded.
</del><span class="cx"> All tests done.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorstylesstylesaddblankpropertyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/styles/styles-add-blank-property.html (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/styles/styles-add-blank-property.html        2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/styles/styles-add-blank-property.html   2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -6,6 +6,7 @@
</span><span class="cx"> 
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><ins>+    WebInspector.showPanel("elements");
</ins><span class="cx">     InspectorTest.selectNodeWithId("inspected", step1);
</span><span class="cx"> 
</span><span class="cx">     var treeElement;
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorstylesstylesupdatefromjsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/styles/styles-update-from-js-expected.txt (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/styles/styles-update-from-js-expected.txt    2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/styles/styles-update-from-js-expected.txt       2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -1,6 +1,9 @@
</span><span class="cx"> Tests that changes to an inline style from JavaScript are reflected in the Styles pane and Elements tree.
</span><span class="cx"> 
</span><del>-'style' attribute modified:
</del><ins>+
+Running: testInit
+
+Running: testSetStyleAttribute
</ins><span class="cx"> <div id="container" style="color: #daC0DE; border: 1px solid black;"></div>
</span><span class="cx"> [expanded] element.style { ()
</span><span class="cx"> color: #DAC0DE;
</span><span class="lines">@@ -19,13 +22,15 @@
</span><span class="cx">     border-left-color: black;
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-cssText modified:
</del><ins>+
+Running: testSetStyleCSSText
</ins><span class="cx"> <div id="container" style="color: rgb(192, 255, 238); "></div>
</span><span class="cx"> [expanded] element.style { ()
</span><span class="cx"> color: #C0FFEE;
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-parsed attributes modified:
</del><ins>+
+Running: testSetViaParsedAttributes
</ins><span class="cx"> <div id="container" style="color: rgb(192, 255, 238); border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: green; border-right-color: green; border-bottom-color: green; border-left-color: green; border-top-width: 3px; border-right-width: 3px; border-bottom-width: 3px; border-left-width: 3px; "></div>
</span><span class="cx"> [expanded] element.style { ()
</span><span class="cx"> color: #C0FFEE;
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorstylesstylesupdatefromjshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/styles/styles-update-from-js.html (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/styles/styles-update-from-js.html    2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/styles/styles-update-from-js.html       2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx">     document.getElementById("container").setAttribute("style", "color: #daC0DE; border: 1px solid black;");
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function modifyCssText()
</del><ins>+function modifyCSSText()
</ins><span class="cx"> {
</span><span class="cx">     document.getElementById("container").style.cssText = "color: #C0FFEE";
</span><span class="cx"> }
</span><span class="lines">@@ -22,48 +22,55 @@
</span><span class="cx"> 
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><del>-    InspectorTest.selectNodeWithId("container", step0);
</del><ins>+    InspectorTest.runTestSuite([
</ins><span class="cx"> 
</span><del>-    // Set style via "style" attribute.
-    function step0()
-    {
-        InspectorTest.evaluateInPage("modifyStyleAttribute()");
-        InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
-    }
</del><ins>+        function testInit(next)
+        {
+            InspectorTest.selectNodeWithId("container", next);
+        },
</ins><span class="cx"> 
</span><del>-    // Set style via cssText.
-    function step1()
-    {
-        InspectorTest.addResult("'style' attribute modified:");
-        dumpAttributeAndStyles();
</del><ins>+        function testSetStyleAttribute(next)
+        {
+            var updateCount = 0;
+            function callback()
+            {
+                // Expect two updates while setting attribute.
+                if (++updateCount === 2) {
+                    dumpAttributeAndStyles();
+                    next();
+                }
+            }
+            InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", callback, true);
+            InspectorTest.evaluateInPage("modifyStyleAttribute()");
+        },
</ins><span class="cx"> 
</span><del>-        // Inhibit the second Styles pane update from step0().
-        function callback()
</del><ins>+        function testSetStyleCSSText(next)
</ins><span class="cx">         {
</span><del>-            InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step2);
</del><ins>+            var updateCount = 0;
+            function callback()
+            {
+                // Expect two updates while setting css text.
+                if (++updateCount === 2) {
+                    dumpAttributeAndStyles();
+                    next();
+                }
+            }
+            InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", callback, true);
+            InspectorTest.evaluateInPage("modifyCSSText()", callback);
+        },
+
+        function testSetViaParsedAttributes(next)
+        {
+            function callback()
+            {
+                dumpAttributeAndStyles();
+                next();
+            }
+            InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", callback);
+            InspectorTest.evaluateInPage("modifyParsedAttributes()");
</ins><span class="cx">         }
</span><ins>+    ]);
</ins><span class="cx"> 
</span><del>-        InspectorTest.evaluateInPage("modifyCssText()", callback);
-    }
-
-    // Set style via parsed attributes.
-    function step2()
-    {
-        InspectorTest.addResult("cssText modified:");
-        dumpAttributeAndStyles();
-
-        InspectorTest.evaluateInPage("modifyParsedAttributes()");
-        InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step3);
-    }
-
-    // Finish the test.
-    function step3()
-    {
-        InspectorTest.addResult("parsed attributes modified:");
-        dumpAttributeAndStyles();
-        InspectorTest.completeTest();
-    }
-
</del><span class="cx">     function dumpAttributeAndStyles()
</span><span class="cx">     {
</span><span class="cx">         var treeElement = findNodeTreeElement()
</span><span class="lines">@@ -77,6 +84,7 @@
</span><span class="cx"> 
</span><span class="cx">     function findNodeTreeElement()
</span><span class="cx">     {
</span><ins>+        WebInspector.panels.elements.updateModifiedNodes();
</ins><span class="cx">         var expandedNode = InspectorTest.expandedNodeWithId("container");
</span><span class="cx">         if (!expandedNode) {
</span><span class="cx">             InspectorTest.addResult("'container' node not found");
</span></span></pre></div>
<a id="trunkLayoutTestsinspectortimelinetimelinelayouthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/timeline/timeline-layout.html (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/timeline/timeline-layout.html        2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/timeline/timeline-layout.html   2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -9,6 +9,8 @@
</span><span class="cx">     var element = document.createElement("div");
</span><span class="cx">     element.innerHTML = "Test data";
</span><span class="cx">     document.body.appendChild(element);
</span><ins>+    // Force layout.
+    var foo = element.offsetHeight;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function test()
</span></span></pre></div>
<a id="trunkLayoutTestsinspectortimelinetimelinenetworkresourceexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/timeline/timeline-network-resource-expected.txt (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/timeline/timeline-network-resource-expected.txt      2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/timeline/timeline-network-resource-expected.txt 2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -1,11 +1,7 @@
</span><span class="cx"> CONSOLE MESSAGE: line 7: Script evaluated
</span><span class="cx"> Tests the Timeline API instrumentation of a network resource load
</span><span class="cx"> 
</span><del>-Start
-step0
-step1
-step2
-step3
</del><ins>+Script resource loaded
</ins><span class="cx"> 
</span><span class="cx"> ResourceSendRequest Properties:
</span><span class="cx"> {
</span><span class="lines">@@ -49,4 +45,4 @@
</span><span class="cx">     usedHeapSize : <number>
</span><span class="cx">     totalHeapSize : <number>
</span><span class="cx"> }
</span><del>-Script resource loaded
</del><ins>+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectortimelinetimelinenetworkresourcehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/timeline/timeline-network-resource.html (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/timeline/timeline-network-resource.html      2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/timeline/timeline-network-resource.html 2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -18,31 +18,21 @@
</span><span class="cx">     var resourceId;
</span><span class="cx">     var scriptUrl = "timeline-network-resource.js";
</span><span class="cx"> 
</span><del>-    InspectorTest.evaluateInPage("true", step0);
-    InspectorTest.addResult("Start");
</del><ins>+    InspectorTest.startTimeline(step1);
</ins><span class="cx"> 
</span><del>-    function step0()
-       {
-           InspectorTest.addResult("step0");
-           TimelineAgent.start(step1);
-       }
-
</del><span class="cx">     function step1()
</span><span class="cx">     {
</span><del>-        InspectorTest.addResult("step1");
</del><span class="cx">         InspectorTest.evaluateInPage("performActions()");
</span><span class="cx">         InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function step2()
</span><span class="cx">     {
</span><del>-        InspectorTest.addResult("step2");
-        TimelineAgent.stop(step3);
</del><ins>+        InspectorTest.stopTimeline(step3);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function step3()
</span><span class="cx">     {
</span><del>-        InspectorTest.addResult("step3");
</del><span class="cx">         function format(record)
</span><span class="cx">         {
</span><span class="cx">             if (record.type === WebInspector.TimelineAgent.RecordType.ResourceSendRequest)
</span></span></pre></div>
<a id="trunkLayoutTestsinspectortimelinetimelinescripttag1html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/timeline/timeline-script-tag-1.html (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/timeline/timeline-script-tag-1.html  2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/timeline/timeline-script-tag-1.html     2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -13,16 +13,16 @@
</span><span class="cx"> 
</span><span class="cx"> function test() 
</span><span class="cx"> {
</span><del>-    TimelineAgent.start(step1);
</del><ins>+    InspectorTest.startTimeline(step1);
</ins><span class="cx">     function step1()
</span><span class="cx">     {
</span><ins>+        InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
</ins><span class="cx">         InspectorTest.evaluateInPage("performActions()");
</span><del>-        InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function step2()
</span><span class="cx">     {
</span><del>-        TimelineAgent.stop(step3);
</del><ins>+        InspectorTest.stopTimeline(step3);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function step3()
</span></span></pre></div>
<a id="trunkLayoutTestsinspectortimelinetimelinescripttag2html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/timeline/timeline-script-tag-2.html (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/timeline/timeline-script-tag-2.html  2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/timeline/timeline-script-tag-2.html     2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx"> 
</span><span class="cx"> function test() 
</span><span class="cx"> {
</span><del>-    TimelineAgent.start(step1);
</del><ins>+    InspectorTest.startTimeline(step1);
</ins><span class="cx">     function step1()
</span><span class="cx">     {
</span><span class="cx">         InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> 
</span><span class="cx">     function step2()
</span><span class="cx">     {
</span><del>-        TimelineAgent.stop(step3);
</del><ins>+        InspectorTest.stopTimeline(step3);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function step3()
</span></span></pre></div>
<a id="trunkLayoutTestsinspectortimelinetimelinetestjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/timeline/timeline-test.js (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/timeline/timeline-test.js    2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/timeline/timeline-test.js       2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -15,9 +15,27 @@
</span><span class="cx">     mimeType : 1
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+InspectorTest.startTimeline = function(callback)
+{
+    InspectorTest._timelineRecords = [];
+    TimelineAgent.start(callback);
+    function addRecord(record)
+    {
+        InspectorTest._timelineRecords.push(record);
+        for (var i = 0; record.children && i < record.children.length; ++i)
+            addRecord(record.children[i]);
+    }
+    InspectorTest.addSniffer(WebInspector.TimelineDispatcher.prototype, "addRecordToTimeline", addRecord, true);
+};
+
+InspectorTest.stopTimeline = function(callback)
+{
+    TimelineAgent.stop(callback);
+};
+
</ins><span class="cx"> InspectorTest.performActionsAndPrint = function(actions, typeName)
</span><span class="cx"> {
</span><del>-    TimelineAgent.start(step1);
</del><ins>+    InspectorTest.startTimeline(step1);
</ins><span class="cx">     function step1()
</span><span class="cx">     {
</span><span class="cx">         InspectorTest.evaluateInPage(actions, step2);
</span><span class="lines">@@ -25,7 +43,7 @@
</span><span class="cx"> 
</span><span class="cx">     function step2()
</span><span class="cx">     {
</span><del>-        TimelineAgent.stop(step3);
</del><ins>+        InspectorTest.stopTimeline(step3);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function step3()
</span><span class="lines">@@ -33,13 +51,12 @@
</span><span class="cx">         InspectorTest.printTimelineRecords(typeName);
</span><span class="cx">         InspectorTest.completeTest();
</span><span class="cx">     }
</span><del>-}
</del><ins>+};
</ins><span class="cx"> 
</span><span class="cx"> InspectorTest.printTimelineRecords = function(typeName, formatter)
</span><span class="cx"> {
</span><del>-    var timelineRecords = InspectorTest._timelineResults();
-    for (var i = 0; i < timelineRecords.length; ++i) {
-        var record = timelineRecords[i];
</del><ins>+    for (var i = 0; i < InspectorTest._timelineRecords.length; ++i) {
+        var record = InspectorTest._timelineRecords[i];
</ins><span class="cx">         if (typeName && record.type === WebInspector.TimelineAgent.RecordType[typeName])
</span><span class="cx">             InspectorTest.printTimelineRecordProperties(record);
</span><span class="cx">         if (formatter)
</span><span class="lines">@@ -47,21 +64,6 @@
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-InspectorTest._timelineResults = function() {
-    var result = [];
-    function addRecords(records)
-    {
-        if (!records)
-            return;
-        for (var i = 0; i < records.length; ++i) {
-            result.push(records[i].originalRecordForTests);
-            addRecords(records[i].children);
-        }
-    }
-    addRecords(WebInspector.panels.timeline._rootRecord.children);
-    return result;
-};
-
</del><span class="cx"> // Dump just the record name, indenting output on separate lines for subrecords
</span><span class="cx"> InspectorTest.dumpTimelineRecord = function(record, level) 
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkLayoutTestsinspectortimelinetimelinetrivialhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/timeline/timeline-trivial.html (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/timeline/timeline-trivial.html       2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/inspector/timeline/timeline-trivial.html  2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../http/tests/inspector/inspector-test.js"></script>
</span><ins>+<script src="timeline-test.js"></script>
</ins><span class="cx"> <script>
</span><span class="cx"> 
</span><span class="cx"> function test() {
</span><span class="lines">@@ -10,7 +11,7 @@
</span><span class="cx">         InspectorTest.addResult("Timeline started");
</span><span class="cx">         InspectorTest.completeTest();
</span><span class="cx">     }
</span><del>-    TimelineAgent.start(callback);
</del><ins>+    InspectorTest.startTimeline(callback);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformchromiuminspectorconsoleconsoleuncaughtexceptionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/chromium/inspector/console/console-uncaught-exception-expected.txt (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/chromium/inspector/console/console-uncaught-exception-expected.txt    2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/platform/chromium/inspector/console/console-uncaught-exception-expected.txt       2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -1,13 +1,9 @@
</span><del>-CONSOLE MESSAGE: line 35: Uncaught Error: Exception in inline script.
-CONSOLE MESSAGE: line 19: Uncaught Error: Exception in 'load' event listener.
-CONSOLE MESSAGE: line 27: Uncaught Error: Exception in setTimeout callback.
-CONSOLE MESSAGE: line 35: Uncaught Error: Exception in inline script.
-CONSOLE MESSAGE: line 19: Uncaught Error: Exception in 'load' event listener.
-CONSOLE MESSAGE: line 27: Uncaught Error: Exception in setTimeout callback.
</del><ins>+CONSOLE MESSAGE: line 18: Uncaught Error: Exception in inline script.
+CONSOLE MESSAGE: line 11: Uncaught Error: Exception in 'load' event listener.
+CONSOLE MESSAGE: line 6: Uncaught Error: Exception in setTimeout callback.
</ins><span class="cx"> Tests that uncaught exceptions are logged into console.Bug 47250.
</span><span class="cx"> 
</span><del>-Page reloaded.
-console-uncaught-exception.html:35Uncaught Error: Exception in inline script.aconsole-uncaught-exception.html:35bconsole-uncaught-exception.html:40(anonymous function)console-uncaught-exception.html:43
-console-uncaught-exception.html:19Uncaught Error: Exception in 'load' event listener.fconsole-uncaught-exception.html:19(anonymous function)console-uncaught-exception.html:21
-console-uncaught-exception.html:27Uncaught Error: Exception in setTimeout callback.barconsole-uncaught-exception.html:27(anonymous function)console-uncaught-exception.html:29
</del><ins>+uncaught-iframe.html:18Uncaught Error: Exception in inline script.auncaught-iframe.html:18buncaught-iframe.html:23(anonymous function)uncaught-iframe.html:26
+uncaught-iframe.html:11Uncaught Error: Exception in 'load' event listener.funcaught-iframe.html:11(anonymous function)uncaught-iframe.html:13
+uncaught-iframe.html:6Uncaught Error: Exception in setTimeout callback.baruncaught-iframe.html:6(anonymous function)uncaught-iframe.html:8
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformchromiuminspectordebuggerdebuggerautocontinueonsyntaxerrorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/chromium/inspector/debugger/debugger-autocontinue-on-syntax-error-expected.txt (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/chromium/inspector/debugger/debugger-autocontinue-on-syntax-error-expected.txt        2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/platform/chromium/inspector/debugger/debugger-autocontinue-on-syntax-error-expected.txt   2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -1,8 +1,7 @@
</span><del>-CONSOLE MESSAGE: line 1: Uncaught SyntaxError: Unexpected token )
-CONSOLE MESSAGE: line 1: Uncaught SyntaxError: Unexpected token )
</del><ins>+CONSOLE MESSAGE: line 4: Uncaught SyntaxError: Unexpected token )
+CONSOLE MESSAGE: line 8: Iframe loaded
</ins><span class="cx"> Tests that debugger won't stop on syntax errors even if "pause on uncaught exceptions" is on.
</span><span class="cx"> 
</span><span class="cx"> Debugger was enabled.
</span><del>-Page reloaded.
</del><span class="cx"> Debugger was disabled.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformchromiuminspectortimelinetimelinenetworkresourceexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-network-resource-expected.txt (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-network-resource-expected.txt    2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-network-resource-expected.txt       2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -1,11 +1,7 @@
</span><span class="cx"> CONSOLE MESSAGE: line 7: Script evaluated
</span><span class="cx"> Tests the Timeline API instrumentation of a network resource load
</span><span class="cx"> 
</span><del>-Start
-step0
-step1
-step2
-step3
</del><ins>+Script resource loaded
</ins><span class="cx"> 
</span><span class="cx"> ResourceSendRequest Properties:
</span><span class="cx"> {
</span><span class="lines">@@ -50,4 +46,4 @@
</span><span class="cx">     usedHeapSize : <number>
</span><span class="cx">     totalHeapSize : <number>
</span><span class="cx"> }
</span><del>-Script resource loaded
</del><ins>+
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/Source/WebCore/ChangeLog      2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2011-03-04  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: fix layout tests flakiness.
+        https://bugs.webkit.org/show_bug.cgi?id=55816
+
+        - Order of issuing of evaluateForTestInFrontend was not guaranteed on the backend side (InspectorAgent side)
+        - Order of dispatching using timeouts was guaranteed via queueing. Source of all kinds of pains on SnowLeopard Release (inspector.js)
+
+        * inspector/CodeGeneratorInspector.pm:
+        * inspector/InspectorAgent.cpp:
+        (WebCore::InspectorAgent::InspectorAgent):
+        (WebCore::InspectorAgent::disconnectFrontend):
+        (WebCore::InspectorAgent::populateScriptObjects):
+        (WebCore::InspectorAgent::evaluateForTestInFrontend):
+        (WebCore::InspectorAgent::issueEvaluateForTestCommands):
+        * inspector/InspectorAgent.h:
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel.FormattedRecord):
+        * inspector/front-end/inspector.js:
+        (WebInspector.dispatch):
+
</ins><span class="cx"> 2011-03-05  Adam Barth  <abarth@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Dimitri Glazkov.
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorCodeGeneratorInspectorpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/CodeGeneratorInspector.pm (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/CodeGeneratorInspector.pm 2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/Source/WebCore/inspector/CodeGeneratorInspector.pm    2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -778,7 +778,6 @@
</span><span class="cx">     _wrap: function(callback)
</span><span class="cx">     {
</span><span class="cx">         var callbackId = this._lastCallbackId++;
</span><del>-        ++this._pendingResponsesCount;
</del><span class="cx">         this._callbacks[callbackId] = callback || function() {};
</span><span class="cx">         return callbackId;
</span><span class="cx">     },
</span><span class="lines">@@ -824,6 +823,8 @@
</span><span class="cx">             console.log("frontend: " + JSON.stringify(request));
</span><span class="cx"> 
</span><span class="cx">         var message = JSON.stringify(request);
</span><ins>+
+        ++this._pendingResponsesCount;
</ins><span class="cx">         InspectorFrontendHost.sendMessageToBackend(message);
</span><span class="cx">     },
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorAgent.cpp (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorAgent.cpp        2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/Source/WebCore/inspector/InspectorAgent.cpp   2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -158,6 +158,7 @@
</span><span class="cx">     , m_browserDebuggerAgent(InspectorBrowserDebuggerAgent::create(m_instrumentingAgents.get(), m_state.get(), m_domAgent.get(), m_debuggerAgent.get(), this))
</span><span class="cx">     , m_profilerAgent(InspectorProfilerAgent::create(m_instrumentingAgents.get(), m_consoleAgent.get(), page))
</span><span class="cx"> #endif
</span><ins>+    , m_canIssueEvaluateForTestInFrontend(false)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT_ARG(page, page);
</span><span class="cx">     ASSERT_ARG(client, client);
</span><span class="lines">@@ -394,6 +395,9 @@
</span><span class="cx">     if (!m_frontend)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    m_canIssueEvaluateForTestInFrontend = false;
+    m_pendingEvaluateTestCommands.clear();
+
</ins><span class="cx">     // Destroying agents would change the state, but we don't want that.
</span><span class="cx">     // Pre-disconnect state will be used to restore inspector agents.
</span><span class="cx">     m_state->mute();
</span><span class="lines">@@ -469,9 +473,7 @@
</span><span class="cx">     restoreProfiler(ProfilerRestoreNoAction);
</span><span class="cx"> 
</span><span class="cx">     // Dispatch pending frontend commands
</span><del>-    for (Vector<pair<long, String> >::iterator it = m_pendingEvaluateTestCommands.begin(); it != m_pendingEvaluateTestCommands.end(); ++it)
-        m_frontend->inspector()->evaluateForTestInFrontend((*it).first, (*it).second);
-    m_pendingEvaluateTestCommands.clear();
</del><ins>+    issueEvaluateForTestCommands();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorAgent::pushDataCollectedOffline()
</span><span class="lines">@@ -762,10 +764,9 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorAgent::evaluateForTestInFrontend(long callId, const String& script)
</span><span class="cx"> {
</span><del>-    if (m_frontend)
-        m_frontend->inspector()->evaluateForTestInFrontend(callId, script);
-    else
-        m_pendingEvaluateTestCommands.append(pair<long, String>(callId, script));
</del><ins>+    m_pendingEvaluateTestCommands.append(pair<long, String>(callId, script));
+    if (m_canIssueEvaluateForTestInFrontend)
+        issueEvaluateForTestCommands();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorAgent::didEvaluateForTestInFrontend(ErrorString*, long callId, const String& jsonResult)
</span><span class="lines">@@ -1093,6 +1094,17 @@
</span><span class="cx">     m_frontend->inspector()->showPanel(panel);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InspectorAgent::issueEvaluateForTestCommands()
+{
+    if (m_frontend) {
+        Vector<pair<long, String> > copy = m_pendingEvaluateTestCommands;
+        m_pendingEvaluateTestCommands.clear();
+        for (Vector<pair<long, String> >::iterator it = copy.begin(); m_frontend && it != copy.end(); ++it)
+            m_frontend->inspector()->evaluateForTestInFrontend((*it).first, (*it).second);
+        m_canIssueEvaluateForTestInFrontend = true;
+    }
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INSPECTOR)
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorAgent.h (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorAgent.h  2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/Source/WebCore/inspector/InspectorAgent.h     2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -239,6 +239,7 @@
</span><span class="cx"> 
</span><span class="cx">     void focusNode();
</span><span class="cx">     bool isMainResourceLoader(DocumentLoader*, const KURL& requestUrl);
</span><ins>+    void issueEvaluateForTestCommands();
</ins><span class="cx"> 
</span><span class="cx">     Page* m_inspectedPage;
</span><span class="cx">     InspectorClient* m_client;
</span><span class="lines">@@ -282,9 +283,9 @@
</span><span class="cx">     String m_userAgentOverride;
</span><span class="cx"> #if ENABLE(WORKERS)
</span><span class="cx">     typedef HashMap<intptr_t, RefPtr<InspectorWorkerResource> > WorkersMap;
</span><del>-
</del><span class="cx">     WorkersMap m_workers;
</span><span class="cx"> #endif
</span><ins>+    bool m_canIssueEvaluateForTestInFrontend;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorfrontendTimelinePaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/front-end/TimelinePanel.js (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/front-end/TimelinePanel.js        2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/Source/WebCore/inspector/front-end/TimelinePanel.js   2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -865,7 +865,6 @@
</span><span class="cx">     this.endTime = (typeof record.endTime !== "undefined") ? record.endTime / 1000 : this.startTime;
</span><span class="cx">     this._selfTime = this.endTime - this.startTime;
</span><span class="cx">     this._lastChildEndTime = this.endTime;
</span><del>-    this.originalRecordForTests = record;
</del><span class="cx">     if (record.stackTrace && record.stackTrace.length)
</span><span class="cx">         this.stackTrace = record.stackTrace;
</span><span class="cx">     this.totalHeapSize = record.totalHeapSize;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorfrontendinspectorjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/front-end/inspector.js (80415 => 80416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/front-end/inspector.js    2011-03-05 09:50:37 UTC (rev 80415)
+++ trunk/Source/WebCore/inspector/front-end/inspector.js       2011-03-05 10:09:35 UTC (rev 80416)
</span><span class="lines">@@ -570,10 +570,19 @@
</span><span class="cx"> 
</span><span class="cx"> window.addEventListener("DOMContentLoaded", windowLoaded, false);
</span><span class="cx"> 
</span><ins>+// We'd like to enforce asynchronous interaction between the inspector controller and the frontend.
+// It is needed to prevent re-entering the backend code.
+// Also, native dispatches do not guarantee setTimeouts to be serialized, so we
+// enforce serialization using 'messagesToDispatch' queue. It is also important that JSC debugger
+// tests require that each command was dispatch within individual timeout callback, so we don't batch them.
+
+var messagesToDispatch = [];
+
</ins><span class="cx"> WebInspector.dispatch = function(message) {
</span><del>-    // We'd like to enforce asynchronous interaction between the inspector controller and the frontend.
-    // This is important to LayoutTests.
-    setTimeout(InspectorBackend.dispatch.bind(InspectorBackend), 0, message);
</del><ins>+    messagesToDispatch.push(message);
+    setTimeout(function() {
+        InspectorBackend.dispatch(messagesToDispatch.shift());
+    }, 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebInspector.dispatchMessageFromBackend = function(messageObject)
</span></span></pre>
</div>
</div>

</body>
</html>