blob: 2648192b727d382d2c08eb2fcbe607e867b1f195 [file] [log] [blame]
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/debugger-test.js"></script>
<script src="resources/script1.js"></script>
<script src="resources/script2.js"></script>
<script>
function test()
{
InspectorTest.runDebuggerTestSuite([
function testSourceFramesCount(next)
{
var panel = WebInspector.panels.scripts;
var sourceFrameCount = 0;
InspectorTest.showScriptSource("script1.js", didShowScriptSources);
function didShowScriptSources()
{
InspectorTest.reloadPage(didReload);
}
function didReload()
{
InspectorTest.showScriptSource("script2.js", didShowScriptSourceAgain);
}
function didShowScriptSourceAgain()
{
var listeners = WebInspector.breakpointManager._listeners["breakpoint-added"];
// There should be 3 breakpoint-added event listeners:
// - BreakpointsSidebarPane
// - 2 shown tabs
InspectorTest.addResult("Number of breakpoint-added event listeners is " + listeners.length);
function dumpListener(listener)
{
if (!(listener.thisObject instanceof WebInspector.SourceFrame))
return;
var sourceFrame = listener.thisObject;
InspectorTest.addResult(" " + sourceFrame._uiSourceCode.name());
}
InspectorTest.addResult("Dumping SourceFrames listening for breakpoint-added event:");
listeners.map(dumpListener);
next();
}
}
]);
};
</script>
</head>
<body onload="runTest()">
<p>Tests that scripts panel does not create too many source frames.</p>
</body>
</html>