Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../../http/tests/inspector/console-test.js"></script> | 4 <script src="../../../http/tests/inspector/console-test.js"></script> |
| 5 <script src="../../../http/tests/inspector/debugger-test.js"></script> | 5 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| 6 <script src="../../../http/tests/inspector/network-test.js"></script> | 6 <script src="../../../http/tests/inspector/network-test.js"></script> |
| 7 <script src="../../../http/tests/inspector/resources-test.js"></script> | 7 <script src="../../../http/tests/inspector/resources-test.js"></script> |
| 8 <script> | 8 <script> |
| 9 function addErrorToConsole() | 9 function addErrorToConsole() |
| 10 { | 10 { |
| 11 console.error("test error message"); | 11 console.error("test error message"); |
| 12 } | 12 } |
| 13 | 13 |
| 14 function methodForBreakpoint() | 14 function methodForBreakpoint() |
| 15 { | 15 { |
| 16 alert("Hello world"); | 16 alert("Hello world"); |
| 17 } | 17 } |
| 18 | 18 |
| 19 function test() | 19 function test() |
| 20 { | 20 { |
| 21 UI.viewManager.showView("resources"); | 21 UI.viewManager.showView("resources"); |
| 22 InspectorTest.runDebuggerTestSuite([ | 22 InspectorTest.runDebuggerTestSuite([ |
| 23 function testSetBreakpoint(next) | 23 function testSetBreakpoint(next) |
| 24 { | 24 { |
| 25 InspectorTest.showScriptSource("source-frame.html", didShowScriptSou rce); | 25 InspectorTest.showScriptSource("source-frame.html", didShowScriptSou rce); |
| 26 | 26 |
| 27 function didShowScriptSource(sourceFrame) | 27 function didShowScriptSource(sourceFrame) |
| 28 { | 28 { |
| 29 InspectorTest.addResult("Script source was shown."); | 29 InspectorTest.addResult("Script source was shown."); |
| 30 InspectorTest.addSniffer(Sources.JavaScriptSourceFrame.prototype , "_addBreakpointDecoration", didAddBreakpoint); | 30 InspectorTest.waitJavaScriptSourceFrameBreakpoints(sourceFrame). then(didAddBreakpoint); |
| 31 InspectorTest.setBreakpoint(sourceFrame, 14, "", true); | 31 InspectorTest.setBreakpoint(sourceFrame, 14, "", true); |
| 32 } | 32 } |
| 33 | 33 |
| 34 function didAddBreakpoint(lineNumber) | 34 function didAddBreakpoint(lineNumber) |
|
lushnikov
2016/11/18 21:44:46
you don't use lineNumber
kozy
2016/11/19 00:46:09
removed, more robust test was added.
| |
| 35 { | 35 { |
| 36 InspectorTest.addResult("Breakpoint added to source frame at lin e " + lineNumber); | 36 InspectorTest.addResult("Breakpoint added to source frame"); |
| 37 next(); | 37 next(); |
| 38 } | 38 } |
| 39 }, | 39 }, |
| 40 | 40 |
| 41 function testConsoleMessage(next) | 41 function testConsoleMessage(next) |
| 42 { | 42 { |
| 43 InspectorTest.showScriptSource("source-frame.html", didShowScriptSou rce); | 43 InspectorTest.showScriptSource("source-frame.html", didShowScriptSou rce); |
| 44 | 44 |
| 45 var shownSourceFrame; | 45 var shownSourceFrame; |
| 46 function didShowScriptSource(sourceFrame) | 46 function didShowScriptSource(sourceFrame) |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 | 95 |
| 96 </head> | 96 </head> |
| 97 | 97 |
| 98 <body onload="runTest()"> | 98 <body onload="runTest()"> |
| 99 <p>Tests that it's possible to set breakpoint in source frame, and that | 99 <p>Tests that it's possible to set breakpoint in source frame, and that |
| 100 source frame displays breakpoints and console errors. | 100 source frame displays breakpoints and console errors. |
| 101 </p> | 101 </p> |
| 102 | 102 |
| 103 </body> | 103 </body> |
| 104 </html> | 104 </html> |
| OLD | NEW |