3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/debugger-test.js"></script>
5 <script src=
"../../../http/tests/inspector/network-test.js"></script>
6 <script src=
"../../../http/tests/inspector/resources-test.js"></script>
10 function addErrorToConsole()
12 console
.error("test error message");
15 function methodForBreakpoint()
22 WebInspector
.ResourcesPanel
.show();
23 InspectorTest
.runDebuggerTestSuite([
24 function testSetBreakpoint(next
)
26 InspectorTest
.showScriptSource("source-frame.html", didShowScriptSource
);
28 function didShowScriptSource(sourceFrame
)
30 InspectorTest
.addResult("Script source was shown.");
31 InspectorTest
.addSniffer(WebInspector
.JavaScriptSourceFrame
.prototype, "_addBreakpointDecoration", didAddBreakpoint
);
32 InspectorTest
.setBreakpoint(sourceFrame
, 14, "", true);
35 function didAddBreakpoint(lineNumber
)
37 InspectorTest
.addResult("Breakpoint added to source frame at line " + lineNumber
);
42 function testConsoleMessage(next
)
44 InspectorTest
.showScriptSource("source-frame.html", didShowScriptSource
);
47 function didShowScriptSource(sourceFrame
)
49 InspectorTest
.addResult("Script source was shown.");
50 shownSourceFrame
= sourceFrame
;
51 InspectorTest
.addSniffer(WebInspector
.SourceFrame
.prototype, "addMessageToSource", didAddMessage
);
52 InspectorTest
.addSniffer(WebInspector
.SourceFrame
.prototype, "clearMessages", clearMessages
);
53 InspectorTest
.evaluateInPage("addErrorToConsole()");
56 function didAddMessage(message
)
58 if (this !== shownSourceFrame
)
60 InspectorTest
.addResult("Message added to source frame: " + message
.messageText());
61 InspectorTest
.consoleModel
.requestClearMessages();
64 function clearMessages()
66 if (this !== shownSourceFrame
)
68 InspectorTest
.addResult("Messages cleared in source frame.");
73 function testShowResource(next
)
75 WebInspector
.NetworkPanel
.show();
77 InspectorTest
.addSniffer(WebInspector
.SourceFrame
.prototype, "show", didShowSourceFrame
);
79 InspectorTest
.resourceTreeModel
.forAllResources(visit
);
80 function visit(resource
)
82 if (resource
.url
.indexOf("debugger-test.js") !== -1) {
83 WebInspector
.panels
.resources
.showResource(resource
, 1);
88 function didShowSourceFrame()
100 <body onload=
"runTest()">
101 <p>Tests that it's possible to set breakpoint in source frame, and that
102 source frame displays breakpoints and console errors.