Changeset 76020 in webkit


Ignore:
Timestamp:
Jan 18, 2011 6:09:35 AM (13 years ago)
Author:
podivilov@chromium.org
Message:

2011-01-18 Pavel Podivilov <podivilov@chromium.org>

Reviewed by Yury Semikhatsky.

Web Inspector: fix flaky debugger tests.
https://bugs.webkit.org/show_bug.cgi?id=51320

  • http/tests/inspector/debugger-test2.js: (initialize_DebuggerTest.InspectorTest.setBreakpoint): (initialize_DebuggerTest.InspectorTest.showScriptSource): (initialize_DebuggerTest.InspectorTest._showScriptSource):
  • inspector/debugger-pause-on-breakpoint-expected.txt:
  • inspector/debugger-pause-on-breakpoint.html:
Location:
trunk/LayoutTests
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r76012 r76020  
     12011-01-18  Pavel Podivilov  <podivilov@chromium.org>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Web Inspector: fix flaky debugger tests.
     6        https://bugs.webkit.org/show_bug.cgi?id=51320
     7
     8        * http/tests/inspector/debugger-test2.js:
     9        (initialize_DebuggerTest.InspectorTest.setBreakpoint):
     10        (initialize_DebuggerTest.InspectorTest.showScriptSource):
     11        (initialize_DebuggerTest.InspectorTest._showScriptSource):
     12        * inspector/debugger-pause-on-breakpoint-expected.txt:
     13        * inspector/debugger-pause-on-breakpoint.html:
     14
    1152011-01-18  Antti Koivisto  <antti@apple.com>
    216
  • trunk/LayoutTests/http/tests/inspector/debugger-test2.js

    r75943 r76020  
    9494{
    9595    var scripts = WebInspector.debuggerModel.scriptsForURL(url);
    96     if (scripts.length) {
    97         WebInspector.debuggerModel.setBreakpoint(scripts[0].sourceID, lineNumber, enabled, condition);
    98         callback();
    99     } else {
    100         var handler = InspectorTest.setBreakpoint.bind(InspectorTest, url, lineNumber, enabled, condition, callback);
    101         InspectorTest._addSniffer(WebInspector.debuggerModel, "_parsedScriptSource", handler);
    102     }
     96    for (var i = 0; i < scripts.length; ++i)
     97        WebInspector.debuggerModel.setBreakpoint(scripts[i].sourceID, lineNumber, enabled, condition);
    10398}
    10499
     
    127122InspectorTest.showScriptSource = function(scriptName, callback)
    128123{
    129     if (InspectorTest._scriptsAreParsed([scriptName])) {
    130         var scriptOrResource = InspectorTest._showScriptSource(scriptName);
    131         callback(scriptOrResource.sourceFrame);
    132     } else
     124    if (InspectorTest._scriptsAreParsed([scriptName]))
     125        InspectorTest._showScriptSource(scriptName, callback);
     126     else
    133127        InspectorTest._addSniffer(WebInspector.debuggerModel, "_parsedScriptSource", InspectorTest.showScriptSource.bind(InspectorTest, scriptName, callback));
    134128};
     
    175169        scriptsPanel._showScriptOrResource(scriptResource);
    176170    }
    177     return scriptResource;
     171
     172    var sourceFrame = WebInspector.currentPanel.visibleView.sourceFrame;
     173    if (sourceFrame._content)
     174        callback(sourceFrame);
     175    else
     176        InspectorTest._addSniffer(sourceFrame._textModel, "setText", callback.bind(null, sourceFrame));
    178177};
    179178
  • trunk/LayoutTests/inspector/debugger-breakpoints-not-activated-on-reload.html

    r75943 r76020  
    2525    {
    2626        InspectorTest.addResult("Main resource was shown.");
    27         InspectorTest.setBreakpoint(WebInspector.mainResource.url, 8, true, "", step3);
     27        InspectorTest.setBreakpoint(WebInspector.mainResource.url, 8, true, "");
     28        WebInspector.panels.scripts.toggleBreakpointsButton.element.click();
     29        InspectorTest.reloadPage(step4);
    2830    }
    2931
    3032    function step3()
    3133    {
    32         WebInspector.panels.scripts.toggleBreakpointsButton.element.click();
    33         InspectorTest.reloadPage(step4);
     34        InspectorTest.showScriptSource(testName, step4);
    3435    }
    3536
    3637    function step4()
    37     {
    38         InspectorTest.showScriptSource(testName, step5);
    39     }
    40 
    41     function step5()
    4238    {
    4339        InspectorTest.addResult("Main resource was shown.");
  • trunk/LayoutTests/inspector/debugger-pause-on-breakpoint-expected.txt

    r75943 r76020  
    22
    33Debugger was enabled.
     4Script source was shown.
    45Set timer for test function.
    56Script execution paused.
  • trunk/LayoutTests/inspector/debugger-pause-on-breakpoint.html

    r75943 r76020  
    1717    function step1()
    1818    {
    19         InspectorTest.setBreakpoint(WebInspector.mainResource.url, 9, true, "", step2);
     19        InspectorTest.showScriptSource("debugger-pause-on-breakpoint.html", step2);
    2020    }
    2121
    2222    function step2()
    2323    {
     24        InspectorTest.addResult("Script source was shown.");
     25        InspectorTest.setBreakpoint(WebInspector.mainResource.url, 9, true, "");
    2426        InspectorTest.runTestFunctionAndWaitUntilPaused(step3);
    2527    }
Note: See TracChangeset for help on using the changeset viewer.