blob: 3c8323544b83001ed031214782c66f1af2fd708f [file] [log] [blame]
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/debugger-test.js"></script>
<script>
function testElementClicked()
{
return 0;
}
function addListenerAndClick()
{
var element = document.getElementById("test");
element.addEventListener("click", testElementClicked, true);
element.click();
}
function timerFired()
{
return 0;
}
function test()
{
WebInspector.showPanel("scripts");
var pane = WebInspector.panels.scripts.sidebarPanes.eventListenerBreakpoints;
InspectorTest.runDebuggerTestSuite([
function testClickBreakpoint(next)
{
pane._setBreakpoint("listener:click");
InspectorTest.waitUntilPaused(paused);
InspectorTest.evaluateInPageWithTimeout("addListenerAndClick()");
function paused(callFrames)
{
InspectorTest.captureStackTrace(callFrames);
pane._removeBreakpoint("listener:click");
InspectorTest.resumeExecution(resumed);
}
function resumed()
{
InspectorTest.evaluateInPage("addListenerAndClick())", next);
}
},
function testTimerFiredBreakpoint(next)
{
pane._setBreakpoint("instrumentation:timerFired");
InspectorTest.waitUntilPaused(paused);
InspectorTest.evaluateInPage("setTimeout(timerFired, 10)");
function paused(callFrames)
{
InspectorTest.captureStackTrace(callFrames);
pane._removeBreakpoint("instrumentation:timerFired");
InspectorTest.resumeExecution(next);
}
}
]);
}
</script>
</head>
<body onload="runTest()">
<p>
Tests event listener breakpoints.
</p>
<input type=button id="test"></input>
</body>
</html>