Commit 55cd997a authored by vsevik@chromium.org's avatar vsevik@chromium.org

DevTools: Add a test for disabling breakpoints.

The test is added disabled since this functionality is currently broken

BUG=432493
R=pfeldman, yurys, sergeyv

Review URL: https://codereview.chromium.org/724053003

git-svn-id: svn://svn.chromium.org/blink/trunk@185304 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent e50b767a
CONSOLE MESSAGE: line 9: Done.
CONSOLE MESSAGE: line 9: Done.
CONSOLE MESSAGE: line 9: Done.
Tests disabling breakpoints.
Running: testSetBreakpointPauseResumeThenDisable
Script source was shown.
Set timer for test function.
Script execution paused.
Call stack:
0) testFunction (disable-breakpoints.html:8)
Breakpoint sidebar pane
disable-breakpoints.html:8 var x = Math.sqrt(10);
Script execution resumed.
Test function finished.
Disabling breakpoints...
Running test function again...
Set timer for test function.
Test function finished.
Running: testEnableBreakpointsAgain
Enabling breakpoints...
Running test function...
Set timer for test function.
Script execution paused.
Call stack:
0) testFunction (disable-breakpoints.html:8)
Breakpoint sidebar pane
disable-breakpoints.html:8 var x = Math.sqrt(10);
Script execution resumed.
Test function finished.
Breakpoint sidebar pane
disable-breakpoints.html:8 var x = Math.sqrt(10);
Breakpoints removed.
Breakpoint sidebar pane
<html>
<head>
<script src="../../../http/tests/inspector/inspector-test.js"></script>
<script src="../../../http/tests/inspector/debugger-test.js"></script>
<script>
function testFunction()
{
var x = Math.sqrt(10);
console.log("Done.");
return x;
}
var test = function()
{
var currentSourceFrame;
InspectorTest.setQuiet(true);
InspectorTest.runDebuggerTestSuite([
function testSetBreakpointPauseResumeThenDisable(next)
{
InspectorTest.showScriptSource("disable-breakpoints.html", didShowScriptSource);
function didShowScriptSource(sourceFrame)
{
InspectorTest.addResult("Script source was shown.");
InspectorTest.setBreakpoint(sourceFrame, 7, "", true);
InspectorTest.waitUntilPaused(didPause);
InspectorTest.runTestFunction();
}
function didPause(callFrames)
{
InspectorTest.addResult("Script execution paused.");
InspectorTest.captureStackTrace(callFrames);
InspectorTest.dumpBreakpointSidebarPane();
InspectorTest.addConsoleSniffer(testFunctionFinishedForTheFirstTime);
InspectorTest.resumeExecution(didResume);
}
function didResume(callFrames)
{
InspectorTest.addResult("Script execution resumed.");
}
function testFunctionFinishedForTheFirstTime()
{
InspectorTest.addResult("Test function finished.");
InspectorTest.addResult("Disabling breakpoints...");
WebInspector.breakpointManager.setBreakpointsActive(false);
InspectorTest.addResult("Running test function again...");
InspectorTest.addConsoleSniffer(testFunctionFinishedForTheSecondTime);
InspectorTest.runTestFunction();
}
function testFunctionFinishedForTheSecondTime(callFrames)
{
InspectorTest.addResult("Test function finished.");
next();
}
},
function testEnableBreakpointsAgain(next)
{
InspectorTest.showScriptSource("disable-breakpoints.html", didShowScriptSource);
function didShowScriptSource(sourceFrame)
{
currentSourceFrame = sourceFrame;
InspectorTest.addResult("Enabling breakpoints...");
WebInspector.breakpointManager.setBreakpointsActive(true);
InspectorTest.addResult("Running test function...");
InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
}
function didPause(callFrames)
{
InspectorTest.addResult("Script execution paused.");
InspectorTest.captureStackTrace(callFrames);
InspectorTest.dumpBreakpointSidebarPane();
InspectorTest.addConsoleSniffer(testFunctionFinished);
InspectorTest.resumeExecution(didResume);
}
function didResume(callFrames)
{
InspectorTest.addResult("Script execution resumed.");
}
function testFunctionFinished()
{
InspectorTest.addResult("Test function finished.");
InspectorTest.dumpBreakpointSidebarPane();
InspectorTest.addSniffer(currentSourceFrame, "_removeBreakpointDecoration", breakpointRemoved);
InspectorTest.removeBreakpoint(currentSourceFrame, 7);
}
function breakpointRemoved()
{
InspectorTest.addResult("Breakpoints removed.");
InspectorTest.dumpBreakpointSidebarPane();
next();
}
},
]);
}
</script>
</head>
<body onload="runTest()">
<p>Tests disabling breakpoints.</p>
</body>
</html>
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