Changeset 80416 in webkit


Ignore:
Timestamp:
Mar 5, 2011 2:09:35 AM (13 years ago)
Author:
pfeldman@chromium.org
Message:

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):
Location:
trunk
Files:
2 added
1 deleted
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r80413 r80416  
     12011-03-04  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Web Inspector: fix layout tests flakiness.
     6        https://bugs.webkit.org/show_bug.cgi?id=55816
     7
     8        - Timeline now uses instrumentation calls, not UI representation while collecting events for tests
     9        - No reloads in debugger tests that don't need them
     10        - Forcing layout in timeline via calculating offsetHeight
     11
     12        * http/tests/inspector/inspector-test.js:
     13        * inspector/console/console-uncaught-exception-expected.txt:
     14        * inspector/console/console-uncaught-exception.html:
     15        * inspector/debugger/debugger-autocontinue-on-syntax-error-expected.txt:
     16        * inspector/debugger/debugger-autocontinue-on-syntax-error.html:
     17        * inspector/debugger/resources/syntax-error.html: Added.
     18        * inspector/debugger/resources/syntax-error.js: Removed.
     19        * inspector/elements/elements-panel-limited-children-expected.txt:
     20        * inspector/extensions/extensions-events-expected.txt:
     21        * inspector/styles/styles-update-from-js-expected.txt:
     22        * inspector/styles/styles-update-from-js.html:
     23        * inspector/timeline/timeline-layout.html:
     24        * inspector/timeline/timeline-network-resource-expected.txt:
     25        * inspector/timeline/timeline-network-resource.html:
     26        * inspector/timeline/timeline-script-tag-1.html:
     27        * inspector/timeline/timeline-script-tag-2.html:
     28        * inspector/timeline/timeline-test.js:
     29        (initialize_Timeline.InspectorTest.startTimeline.addRecord):
     30        (initialize_Timeline.InspectorTest.startTimeline):
     31        (initialize_Timeline.InspectorTest.stopTimeline):
     32        (initialize_Timeline.InspectorTest.performActionsAndPrint.step2):
     33        (initialize_Timeline.InspectorTest.performActionsAndPrint):
     34        (initialize_Timeline.InspectorTest.printTimelineRecords):
     35        * inspector/timeline/timeline-trivial.html:
     36        * platform/chromium/inspector/timeline/timeline-network-resource-expected.txt:
     37
    1382011-03-05  Csaba Osztrogonác  <ossy@webkit.org>
    239
  • trunk/LayoutTests/http/tests/inspector/inspector-test.js

    r80373 r80416  
    277277        }
    278278
    279         WebInspector.showPanel("elements");
     279        WebInspector.showPanel("console");
    280280        try {
    281281            testFunction();
     
    329329{
    330330    if (!outputElement) {
     331        var intermediate = document.createElement("div");
     332        document.body.appendChild(intermediate);
     333
     334        var intermediate2 = document.createElement("div");
     335        intermediate.appendChild(intermediate2);
     336
    331337        outputElement = document.createElement("div");
    332338        outputElement.className = "output";
    333339        outputElement.style.whiteSpace = "pre";
    334         document.body.appendChild(outputElement);
     340        intermediate2.appendChild(outputElement);
    335341    }
    336342    outputElement.appendChild(document.createTextNode(text));
  • trunk/LayoutTests/inspector/audits/audits-panel-functional.html

    r80061 r80416  
    1717var test = function()
    1818{
     19    WebInspector.showPanel("elements");
     20
    1921    InspectorTest.reloadPage(step1);
    2022
     
    3133
    3234        InspectorTest.runAfterPendingDispatches(step2);
    33     }   
     35    }
    3436
    3537    function step2()
  • trunk/LayoutTests/inspector/console/console-uncaught-exception-expected.txt

    r78535 r80416  
    1 CONSOLE MESSAGE: line 35: Error: Exception in inline script.
    2 CONSOLE MESSAGE: line 19: Error: Exception in 'load' event listener.
    3 CONSOLE MESSAGE: line 27: Error: Exception in setTimeout callback.
    4 CONSOLE MESSAGE: line 35: Error: Exception in inline script.
    5 CONSOLE MESSAGE: line 19: Error: Exception in 'load' event listener.
    6 CONSOLE MESSAGE: line 27: Error: Exception in setTimeout callback.
     1CONSOLE MESSAGE: line 18: Error: Exception in inline script.
     2CONSOLE MESSAGE: line 11: Error: Exception in 'load' event listener.
     3CONSOLE MESSAGE: line 6: Error: Exception in setTimeout callback.
    74Tests that uncaught exceptions are logged into console.Bug 47250.
    85
    9 Page reloaded.
    10 console-uncaught-exception.html:35Error: Exception in inline script.
    11 console-uncaught-exception.html:19Error: Exception in 'load' event listener.
    12 console-uncaught-exception.html:27Error: Exception in setTimeout callback.
    136
     7uncaught-in-iframe.html:18Error: Exception in inline script.
     8uncaught-in-iframe.html:11Error: Exception in 'load' event listener.
     9uncaught-in-iframe.html:6Error: Exception in setTimeout callback.
     10
  • trunk/LayoutTests/inspector/console/console-uncaught-exception.html

    r78535 r80416  
    55<script>
    66
    7 
    87function test()
    98{
    10     InspectorTest.reloadPage(function() {
    11         InspectorTest.expandConsoleMessages();
    12         InspectorTest.dumpConsoleMessages();
    13         InspectorTest.completeTest();
    14     });
     9    InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", addMessage, true);
     10    InspectorTest.evaluateInPage("loadIframe()");
     11    function addMessage(message)
     12    {
     13        if (message.toString().indexOf("setTimeout") !== -1) {
     14            InspectorTest.expandConsoleMessages();
     15            InspectorTest.dumpConsoleMessages();
     16            InspectorTest.completeTest();
     17        }
     18    }
    1519}
    1620
    17 window.addEventListener("load", function(e) {
    18     function f() {
    19         throw new Error("Exception in 'load' event listener.")
    20     }
    21     f();
    22 }, false);
    23 
    24 
    25 setTimeout(function() {
    26     function bar() {
    27         throw new Error("Exception in setTimeout callback.");
    28     }
    29     bar();
    30 }, 0);
    31 
    32 
    33 function a()
     21function loadIframe()
    3422{
    35     throw new Error("Exception in inline script.")
     23    var iframe = document.createElement("iframe");
     24    iframe.src = "resources/uncaught-in-iframe.html";
     25    document.body.appendChild(iframe);
    3626}
    37 
    38 function b()
    39 {
    40     a();
    41 }
    42 
    43 b();
    4427
    4528</script>
  • trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error-expected.txt

    r78535 r80416  
    1 CONSOLE MESSAGE: line 1: SyntaxError: Parse error
    2 CONSOLE MESSAGE: line 1: SyntaxError: Parse error
     1CONSOLE MESSAGE: line 4: SyntaxError: Parse error
     2CONSOLE MESSAGE: line 8: Iframe loaded
    33Tests that debugger won't stop on syntax errors even if "pause on uncaught exceptions" is on.
    44
    55Debugger was enabled.
    6 Page reloaded.
    76Debugger was disabled.
    87
  • trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error.html

    r78717 r80416  
    33<script src="../../http/tests/inspector/inspector-test.js"></script>
    44<script src="../../http/tests/inspector/debugger-test.js"></script>
    5 <script src="resources/syntax-error.js"></script>
    65<script>
     6
     7function loadIframe()
     8{
     9    var iframe = document.createElement("iframe");
     10    iframe.src = "resources/syntax-error.html";
     11    document.body.appendChild(iframe);
     12}
    713
    814function test()
    915{
    1016    WebInspector.showPanel("scripts");
    11     InspectorTest.startDebuggerTest(startDebuggerTestCallback);
     17    InspectorTest.startDebuggerTest(step1);
    1218
    13     function startDebuggerTestCallback()
     19    function step1()
    1420    {
    1521        DebuggerAgent.setPauseOnExceptionsState(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
    16         InspectorTest.showScriptSource("debugger-autocontinue-on-syntax-error.html", reloadInspectedPage);
     22        InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
     23        InspectorTest.evaluateInPage("loadIframe()");
    1724    }
    1825
    19     function reloadInspectedPage()
     26    function step2()
    2027    {
    21         InspectorTest.reloadPage(function() {
    22             InspectorTest.completeDebuggerTest();
    23         });
     28        InspectorTest.completeDebuggerTest();
    2429    }
    25 
    2630}
    2731
  • trunk/LayoutTests/inspector/elements/elements-delete-inline-style.html

    r78535 r80416  
    77function test()
    88{
    9 
     9    WebInspector.showPanel("elements");
    1010    InspectorTest.selectNodeWithId("inspected", step1);
    1111
    12     function step1()
     12    function step1(node)
    1313    {
    1414        InspectorTest.addResult("Before style property removal:");
    1515        InspectorTest.dumpSelectedElementStyles(true);
    16 
    17         var treeElement;
    18         var innerMapping = WebInspector.domAgent._idToDOMNode;
    19         for (var nodeId in innerMapping) {
    20             if (innerMapping[nodeId].nodeName === "DIV") {
    21                 treeElement = WebInspector.panels.elements.treeOutline.findTreeElement(innerMapping[nodeId]);
    22                 break;
    23             }
    24         }
    25         var styleAttrElement = treeElement.listItemElement.getElementsByClassName("webkit-html-attribute")[1];
    26         treeElement._startEditingTarget(styleAttrElement);
    27         var editorElement = window.getSelection().anchorNode.parentElement;
    28 
    29         // Remove the "style" attribute altogether (not just clear its value).
    30         editorElement.textContent = "";
    31         editorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
     16        node.removeAttribute("style");
    3217        InspectorTest.runAfterPendingDispatches(step2);
    3318    }
  • trunk/LayoutTests/inspector/elements/elements-panel-limited-children-expected.txt

    r78576 r80416  
    3838          </div>
    3939          <p>Tests that src and href element targets are rewritten properly.</p>
    40         + <div class="output" style="white-space: pre; ">…</div>
     40        + <div>…</div>
    4141      </body>
    4242  </html>
     
    5959          </div>
    6060          <p>Tests that src and href element targets are rewritten properly.</p>
    61         + <div class="output" style="white-space: pre; ">…</div>
     61        + <div>…</div>
    6262      </body>
    6363  </html>
  • trunk/LayoutTests/inspector/elements/elements-panel-search.html

    r80204 r80416  
    66function test()
    77{
     8    WebInspector.showPanel("elements");
     9
    810    var searchResults = [];
    911    function addSearchResult(markupValue)
  • trunk/LayoutTests/inspector/extensions/extensions-events-expected.txt

    r78535 r80416  
    66onFinished fired
    77RUNNING TEST: extension_testPageLoadEvents
     8Page reloaded.
    89onDOMContentLoaded fired: number
    910onLoaded fired: number
    10 Page reloaded.
    1111All tests done.
    1212
  • trunk/LayoutTests/inspector/styles/styles-add-blank-property.html

    r78535 r80416  
    77function test()
    88{
     9    WebInspector.showPanel("elements");
    910    InspectorTest.selectNodeWithId("inspected", step1);
    1011
  • trunk/LayoutTests/inspector/styles/styles-update-from-js-expected.txt

    r79009 r80416  
    11Tests that changes to an inline style from JavaScript are reflected in the Styles pane and Elements tree.
    22
    3 'style' attribute modified:
     3
     4Running: testInit
     5
     6Running: testSetStyleAttribute
    47<div id="container" style="color: #daC0DE; border: 1px solid black;"></div>
    58[expanded] element.style { ()
     
    2023
    2124
    22 cssText modified:
     25
     26Running: testSetStyleCSSText
    2327<div id="container" style="color: rgb(192, 255, 238); "></div>
    2428[expanded] element.style { ()
     
    2630
    2731
    28 parsed attributes modified:
     32
     33Running: testSetViaParsedAttributes
    2934<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>
    3035[expanded] element.style { ()
  • trunk/LayoutTests/inspector/styles/styles-update-from-js.html

    r79205 r80416  
    99}
    1010
    11 function modifyCssText()
     11function modifyCSSText()
    1212{
    1313    document.getElementById("container").style.cssText = "color: #C0FFEE";
     
    2323function test()
    2424{
    25     InspectorTest.selectNodeWithId("container", step0);
     25    InspectorTest.runTestSuite([
    2626
    27     // Set style via "style" attribute.
    28     function step0()
    29     {
    30         InspectorTest.evaluateInPage("modifyStyleAttribute()");
    31         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
    32     }
     27        function testInit(next)
     28        {
     29            InspectorTest.selectNodeWithId("container", next);
     30        },
    3331
    34     // Set style via cssText.
    35     function step1()
    36     {
    37         InspectorTest.addResult("'style' attribute modified:");
    38         dumpAttributeAndStyles();
     32        function testSetStyleAttribute(next)
     33        {
     34            var updateCount = 0;
     35            function callback()
     36            {
     37                // Expect two updates while setting attribute.
     38                if (++updateCount === 2) {
     39                    dumpAttributeAndStyles();
     40                    next();
     41                }
     42            }
     43            InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", callback, true);
     44            InspectorTest.evaluateInPage("modifyStyleAttribute()");
     45        },
    3946
    40         // Inhibit the second Styles pane update from step0().
    41         function callback()
     47        function testSetStyleCSSText(next)
    4248        {
    43             InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step2);
     49            var updateCount = 0;
     50            function callback()
     51            {
     52                // Expect two updates while setting css text.
     53                if (++updateCount === 2) {
     54                    dumpAttributeAndStyles();
     55                    next();
     56                }
     57            }
     58            InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", callback, true);
     59            InspectorTest.evaluateInPage("modifyCSSText()", callback);
     60        },
     61
     62        function testSetViaParsedAttributes(next)
     63        {
     64            function callback()
     65            {
     66                dumpAttributeAndStyles();
     67                next();
     68            }
     69            InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", callback);
     70            InspectorTest.evaluateInPage("modifyParsedAttributes()");
    4471        }
    45 
    46         InspectorTest.evaluateInPage("modifyCssText()", callback);
    47     }
    48 
    49     // Set style via parsed attributes.
    50     function step2()
    51     {
    52         InspectorTest.addResult("cssText modified:");
    53         dumpAttributeAndStyles();
    54 
    55         InspectorTest.evaluateInPage("modifyParsedAttributes()");
    56         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step3);
    57     }
    58 
    59     // Finish the test.
    60     function step3()
    61     {
    62         InspectorTest.addResult("parsed attributes modified:");
    63         dumpAttributeAndStyles();
    64         InspectorTest.completeTest();
    65     }
     72    ]);
    6673
    6774    function dumpAttributeAndStyles()
     
    7885    function findNodeTreeElement()
    7986    {
     87        WebInspector.panels.elements.updateModifiedNodes();
    8088        var expandedNode = InspectorTest.expandedNodeWithId("container");
    8189        if (!expandedNode) {
  • trunk/LayoutTests/inspector/timeline/timeline-layout.html

    r78535 r80416  
    1010    element.innerHTML = "Test data";
    1111    document.body.appendChild(element);
     12    // Force layout.
     13    var foo = element.offsetHeight;
    1214}
    1315
  • trunk/LayoutTests/inspector/timeline/timeline-network-resource-expected.txt

    r80351 r80416  
    22Tests the Timeline API instrumentation of a network resource load
    33
    4 Start
    5 step0
    6 step1
    7 step2
    8 step3
     4Script resource loaded
    95
    106ResourceSendRequest Properties:
     
    5046    totalHeapSize : <number>
    5147}
    52 Script resource loaded
     48
  • trunk/LayoutTests/inspector/timeline/timeline-network-resource.html

    r80351 r80416  
    1919    var scriptUrl = "timeline-network-resource.js";
    2020
    21     InspectorTest.evaluateInPage("true", step0);
    22     InspectorTest.addResult("Start");
    23 
    24     function step0()
    25         {
    26             InspectorTest.addResult("step0");
    27             TimelineAgent.start(step1);
    28         }
     21    InspectorTest.startTimeline(step1);
    2922
    3023    function step1()
    3124    {
    32         InspectorTest.addResult("step1");
    3325        InspectorTest.evaluateInPage("performActions()");
    3426        InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
     
    3729    function step2()
    3830    {
    39         InspectorTest.addResult("step2");
    40         TimelineAgent.stop(step3);
     31        InspectorTest.stopTimeline(step3);
    4132    }
    4233
    4334    function step3()
    4435    {
    45         InspectorTest.addResult("step3");
    4636        function format(record)
    4737        {
  • trunk/LayoutTests/inspector/timeline/timeline-script-tag-1.html

    r79323 r80416  
    1414function test()
    1515{
    16     TimelineAgent.start(step1);
     16    InspectorTest.startTimeline(step1);
    1717    function step1()
    1818    {
     19        InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
    1920        InspectorTest.evaluateInPage("performActions()");
    20         InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
    2121    }
    2222
    2323    function step2()
    2424    {
    25         TimelineAgent.stop(step3);
     25        InspectorTest.stopTimeline(step3);
    2626    }
    2727
  • trunk/LayoutTests/inspector/timeline/timeline-script-tag-2.html

    r79323 r80416  
    1414function test()
    1515{
    16     TimelineAgent.start(step1);
     16    InspectorTest.startTimeline(step1);
    1717    function step1()
    1818    {
     
    2323    function step2()
    2424    {
    25         TimelineAgent.stop(step3);
     25        InspectorTest.stopTimeline(step3);
    2626    }
    2727
  • trunk/LayoutTests/inspector/timeline/timeline-test.js

    r79323 r80416  
    1616};
    1717
     18InspectorTest.startTimeline = function(callback)
     19{
     20    InspectorTest._timelineRecords = [];
     21    TimelineAgent.start(callback);
     22    function addRecord(record)
     23    {
     24        InspectorTest._timelineRecords.push(record);
     25        for (var i = 0; record.children && i < record.children.length; ++i)
     26            addRecord(record.children[i]);
     27    }
     28    InspectorTest.addSniffer(WebInspector.TimelineDispatcher.prototype, "addRecordToTimeline", addRecord, true);
     29};
     30
     31InspectorTest.stopTimeline = function(callback)
     32{
     33    TimelineAgent.stop(callback);
     34};
     35
    1836InspectorTest.performActionsAndPrint = function(actions, typeName)
    1937{
    20     TimelineAgent.start(step1);
     38    InspectorTest.startTimeline(step1);
    2139    function step1()
    2240    {
     
    2644    function step2()
    2745    {
    28         TimelineAgent.stop(step3);
     46        InspectorTest.stopTimeline(step3);
    2947    }
    3048
     
    3452        InspectorTest.completeTest();
    3553    }
    36 }
     54};
    3755
    3856InspectorTest.printTimelineRecords = function(typeName, formatter)
    3957{
    40     var timelineRecords = InspectorTest._timelineResults();
    41     for (var i = 0; i < timelineRecords.length; ++i) {
    42         var record = timelineRecords[i];
     58    for (var i = 0; i < InspectorTest._timelineRecords.length; ++i) {
     59        var record = InspectorTest._timelineRecords[i];
    4360        if (typeName && record.type === WebInspector.TimelineAgent.RecordType[typeName])
    4461            InspectorTest.printTimelineRecordProperties(record);
     
    4663            formatter(record);
    4764    }
    48 };
    49 
    50 InspectorTest._timelineResults = function() {
    51     var result = [];
    52     function addRecords(records)
    53     {
    54         if (!records)
    55             return;
    56         for (var i = 0; i < records.length; ++i) {
    57             result.push(records[i].originalRecordForTests);
    58             addRecords(records[i].children);
    59         }
    60     }
    61     addRecords(WebInspector.panels.timeline._rootRecord.children);
    62     return result;
    6365};
    6466
  • trunk/LayoutTests/inspector/timeline/timeline-trivial.html

    r79323 r80416  
    22<head>
    33<script src="../../http/tests/inspector/inspector-test.js"></script>
     4<script src="timeline-test.js"></script>
    45<script>
    56
     
    1112        InspectorTest.completeTest();
    1213    }
    13     TimelineAgent.start(callback);
     14    InspectorTest.startTimeline(callback);
    1415}
    1516
  • trunk/LayoutTests/platform/chromium/inspector/console/console-uncaught-exception-expected.txt

    r78535 r80416  
    1 CONSOLE MESSAGE: line 35: Uncaught Error: Exception in inline script.
    2 CONSOLE MESSAGE: line 19: Uncaught Error: Exception in 'load' event listener.
    3 CONSOLE MESSAGE: line 27: Uncaught Error: Exception in setTimeout callback.
    4 CONSOLE MESSAGE: line 35: Uncaught Error: Exception in inline script.
    5 CONSOLE MESSAGE: line 19: Uncaught Error: Exception in 'load' event listener.
    6 CONSOLE MESSAGE: line 27: Uncaught Error: Exception in setTimeout callback.
     1CONSOLE MESSAGE: line 18: Uncaught Error: Exception in inline script.
     2CONSOLE MESSAGE: line 11: Uncaught Error: Exception in 'load' event listener.
     3CONSOLE MESSAGE: line 6: Uncaught Error: Exception in setTimeout callback.
    74Tests that uncaught exceptions are logged into console.Bug 47250.
    85
    9 Page reloaded.
    10 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
    11 console-uncaught-exception.html:19Uncaught Error: Exception in 'load' event listener.fconsole-uncaught-exception.html:19(anonymous function)console-uncaught-exception.html:21
    12 console-uncaught-exception.html:27Uncaught Error: Exception in setTimeout callback.barconsole-uncaught-exception.html:27(anonymous function)console-uncaught-exception.html:29
     6uncaught-iframe.html:18Uncaught Error: Exception in inline script.auncaught-iframe.html:18buncaught-iframe.html:23(anonymous function)uncaught-iframe.html:26
     7uncaught-iframe.html:11Uncaught Error: Exception in 'load' event listener.funcaught-iframe.html:11(anonymous function)uncaught-iframe.html:13
     8uncaught-iframe.html:6Uncaught Error: Exception in setTimeout callback.baruncaught-iframe.html:6(anonymous function)uncaught-iframe.html:8
    139
  • trunk/LayoutTests/platform/chromium/inspector/debugger/debugger-autocontinue-on-syntax-error-expected.txt

    r78535 r80416  
    1 CONSOLE MESSAGE: line 1: Uncaught SyntaxError: Unexpected token )
    2 CONSOLE MESSAGE: line 1: Uncaught SyntaxError: Unexpected token )
     1CONSOLE MESSAGE: line 4: Uncaught SyntaxError: Unexpected token )
     2CONSOLE MESSAGE: line 8: Iframe loaded
    33Tests that debugger won't stop on syntax errors even if "pause on uncaught exceptions" is on.
    44
    55Debugger was enabled.
    6 Page reloaded.
    76Debugger was disabled.
    87
  • trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-network-resource-expected.txt

    r80364 r80416  
    22Tests the Timeline API instrumentation of a network resource load
    33
    4 Start
    5 step0
    6 step1
    7 step2
    8 step3
     4Script resource loaded
    95
    106ResourceSendRequest Properties:
     
    5147    totalHeapSize : <number>
    5248}
    53 Script resource loaded
     49
  • trunk/Source/WebCore/ChangeLog

    r80415 r80416  
     12011-03-04  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Web Inspector: fix layout tests flakiness.
     6        https://bugs.webkit.org/show_bug.cgi?id=55816
     7
     8        - Order of issuing of evaluateForTestInFrontend was not guaranteed on the backend side (InspectorAgent side)
     9        - Order of dispatching using timeouts was guaranteed via queueing. Source of all kinds of pains on SnowLeopard Release (inspector.js)
     10
     11        * inspector/CodeGeneratorInspector.pm:
     12        * inspector/InspectorAgent.cpp:
     13        (WebCore::InspectorAgent::InspectorAgent):
     14        (WebCore::InspectorAgent::disconnectFrontend):
     15        (WebCore::InspectorAgent::populateScriptObjects):
     16        (WebCore::InspectorAgent::evaluateForTestInFrontend):
     17        (WebCore::InspectorAgent::issueEvaluateForTestCommands):
     18        * inspector/InspectorAgent.h:
     19        * inspector/front-end/TimelinePanel.js:
     20        (WebInspector.TimelinePanel.FormattedRecord):
     21        * inspector/front-end/inspector.js:
     22        (WebInspector.dispatch):
     23
    1242011-03-05  Adam Barth  <abarth@webkit.org>
    225
  • trunk/Source/WebCore/inspector/CodeGeneratorInspector.pm

    r80349 r80416  
    779779    {
    780780        var callbackId = this._lastCallbackId++;
    781         ++this._pendingResponsesCount;
    782781        this._callbacks[callbackId] = callback || function() {};
    783782        return callbackId;
     
    825824
    826825        var message = JSON.stringify(request);
     826
     827        ++this._pendingResponsesCount;
    827828        InspectorFrontendHost.sendMessageToBackend(message);
    828829    },
  • trunk/Source/WebCore/inspector/InspectorAgent.cpp

    r80350 r80416  
    159159    , m_profilerAgent(InspectorProfilerAgent::create(m_instrumentingAgents.get(), m_consoleAgent.get(), page))
    160160#endif
     161    , m_canIssueEvaluateForTestInFrontend(false)
    161162{
    162163    ASSERT_ARG(page, page);
     
    395396        return;
    396397
     398    m_canIssueEvaluateForTestInFrontend = false;
     399    m_pendingEvaluateTestCommands.clear();
     400
    397401    // Destroying agents would change the state, but we don't want that.
    398402    // Pre-disconnect state will be used to restore inspector agents.
     
    470474
    471475    // Dispatch pending frontend commands
    472     for (Vector<pair<long, String> >::iterator it = m_pendingEvaluateTestCommands.begin(); it != m_pendingEvaluateTestCommands.end(); ++it)
    473         m_frontend->inspector()->evaluateForTestInFrontend((*it).first, (*it).second);
    474     m_pendingEvaluateTestCommands.clear();
     476    issueEvaluateForTestCommands();
    475477}
    476478
     
    763765void InspectorAgent::evaluateForTestInFrontend(long callId, const String& script)
    764766{
    765     if (m_frontend)
    766         m_frontend->inspector()->evaluateForTestInFrontend(callId, script);
    767     else
    768         m_pendingEvaluateTestCommands.append(pair<long, String>(callId, script));
     767    m_pendingEvaluateTestCommands.append(pair<long, String>(callId, script));
     768    if (m_canIssueEvaluateForTestInFrontend)
     769        issueEvaluateForTestCommands();
    769770}
    770771
     
    10941095}
    10951096
     1097void InspectorAgent::issueEvaluateForTestCommands()
     1098{
     1099    if (m_frontend) {
     1100        Vector<pair<long, String> > copy = m_pendingEvaluateTestCommands;
     1101        m_pendingEvaluateTestCommands.clear();
     1102        for (Vector<pair<long, String> >::iterator it = copy.begin(); m_frontend && it != copy.end(); ++it)
     1103            m_frontend->inspector()->evaluateForTestInFrontend((*it).first, (*it).second);
     1104        m_canIssueEvaluateForTestInFrontend = true;
     1105    }
     1106}
     1107
    10961108} // namespace WebCore
    10971109
  • trunk/Source/WebCore/inspector/InspectorAgent.h

    r80338 r80416  
    240240    void focusNode();
    241241    bool isMainResourceLoader(DocumentLoader*, const KURL& requestUrl);
     242    void issueEvaluateForTestCommands();
    242243
    243244    Page* m_inspectedPage;
     
    283284#if ENABLE(WORKERS)
    284285    typedef HashMap<intptr_t, RefPtr<InspectorWorkerResource> > WorkersMap;
    285 
    286286    WorkersMap m_workers;
    287287#endif
     288    bool m_canIssueEvaluateForTestInFrontend;
    288289};
    289290
  • trunk/Source/WebCore/inspector/front-end/TimelinePanel.js

    r79323 r80416  
    866866    this._selfTime = this.endTime - this.startTime;
    867867    this._lastChildEndTime = this.endTime;
    868     this.originalRecordForTests = record;
    869868    if (record.stackTrace && record.stackTrace.length)
    870869        this.stackTrace = record.stackTrace;
  • trunk/Source/WebCore/inspector/front-end/inspector.js

    r80239 r80416  
    571571window.addEventListener("DOMContentLoaded", windowLoaded, false);
    572572
     573// We'd like to enforce asynchronous interaction between the inspector controller and the frontend.
     574// It is needed to prevent re-entering the backend code.
     575// Also, native dispatches do not guarantee setTimeouts to be serialized, so we
     576// enforce serialization using 'messagesToDispatch' queue. It is also important that JSC debugger
     577// tests require that each command was dispatch within individual timeout callback, so we don't batch them.
     578
     579var messagesToDispatch = [];
     580
    573581WebInspector.dispatch = function(message) {
    574     // We'd like to enforce asynchronous interaction between the inspector controller and the frontend.
    575     // This is important to LayoutTests.
    576     setTimeout(InspectorBackend.dispatch.bind(InspectorBackend), 0, message);
     582    messagesToDispatch.push(message);
     583    setTimeout(function() {
     584        InspectorBackend.dispatch(messagesToDispatch.shift());
     585    }, 0);
    577586}
    578587
Note: See TracChangeset for help on using the changeset viewer.