Commit 37dda3c5 authored by podivilov@chromium.org's avatar podivilov@chromium.org
Browse files

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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76020 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8e0c8f10
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:
2011-01-18 Antti Koivisto <antti@apple.com>
 
Reviewed by Dave Hyatt.
......
......@@ -93,13 +93,8 @@ InspectorTest.captureStackTrace = function(callFrames)
InspectorTest.setBreakpoint = function(url, lineNumber, enabled, condition, callback)
{
var scripts = WebInspector.debuggerModel.scriptsForURL(url);
if (scripts.length) {
WebInspector.debuggerModel.setBreakpoint(scripts[0].sourceID, lineNumber, enabled, condition);
callback();
} else {
var handler = InspectorTest.setBreakpoint.bind(InspectorTest, url, lineNumber, enabled, condition, callback);
InspectorTest._addSniffer(WebInspector.debuggerModel, "_parsedScriptSource", handler);
}
for (var i = 0; i < scripts.length; ++i)
WebInspector.debuggerModel.setBreakpoint(scripts[i].sourceID, lineNumber, enabled, condition);
}
InspectorTest._pausedScript = function(details)
......@@ -126,10 +121,9 @@ InspectorTest._resumedScript = function()
InspectorTest.showScriptSource = function(scriptName, callback)
{
if (InspectorTest._scriptsAreParsed([scriptName])) {
var scriptOrResource = InspectorTest._showScriptSource(scriptName);
callback(scriptOrResource.sourceFrame);
} else
if (InspectorTest._scriptsAreParsed([scriptName]))
InspectorTest._showScriptSource(scriptName, callback);
else
InspectorTest._addSniffer(WebInspector.debuggerModel, "_parsedScriptSource", InspectorTest.showScriptSource.bind(InspectorTest, scriptName, callback));
};
......@@ -174,7 +168,12 @@ InspectorTest._showScriptSource = function(scriptName, callback)
scriptResource = options[pageScriptIndex].representedObject;
scriptsPanel._showScriptOrResource(scriptResource);
}
return scriptResource;
var sourceFrame = WebInspector.currentPanel.visibleView.sourceFrame;
if (sourceFrame._content)
callback(sourceFrame);
else
InspectorTest._addSniffer(sourceFrame._textModel, "setText", callback.bind(null, sourceFrame));
};
InspectorTest.expandProperties = function(properties, callback)
......
......@@ -24,21 +24,17 @@ var test = function()
function step2()
{
InspectorTest.addResult("Main resource was shown.");
InspectorTest.setBreakpoint(WebInspector.mainResource.url, 8, true, "", step3);
}
function step3()
{
InspectorTest.setBreakpoint(WebInspector.mainResource.url, 8, true, "");
WebInspector.panels.scripts.toggleBreakpointsButton.element.click();
InspectorTest.reloadPage(step4);
}
function step4()
function step3()
{
InspectorTest.showScriptSource(testName, step5);
InspectorTest.showScriptSource(testName, step4);
}
function step5()
function step4()
{
InspectorTest.addResult("Main resource was shown.");
if (!WebInspector.panels.scripts.breakpointsActivated)
......
Tests that debugger will stop on breakpoint.
Debugger was enabled.
Script source was shown.
Set timer for test function.
Script execution paused.
Call stack:
......
......@@ -16,11 +16,13 @@ var test = function()
function step1()
{
InspectorTest.setBreakpoint(WebInspector.mainResource.url, 9, true, "", step2);
InspectorTest.showScriptSource("debugger-pause-on-breakpoint.html", step2);
}
function step2()
{
InspectorTest.addResult("Script source was shown.");
InspectorTest.setBreakpoint(WebInspector.mainResource.url, 9, true, "");
InspectorTest.runTestFunctionAndWaitUntilPaused(step3);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment