| 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/debugger-test.js"></script> | 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| 5 <script src="../../../http/tests/inspector/resources/compiled.js"></script> | 5 <script src="../../../http/tests/inspector/resources/compiled.js"></script> |
| 6 <script> | 6 <script> |
| 7 | 7 |
| 8 var test = function() | 8 var test = function() |
| 9 { | 9 { |
| 10 InspectorTest.startDebuggerTest(step1); | 10 InspectorTest.startDebuggerTest(step1); |
| 11 | 11 |
| 12 function step1() | 12 function step1() |
| 13 { | 13 { |
| 14 InspectorTest.showScriptSource("source1.js", step2); | 14 InspectorTest.showScriptSource("source1.js", step2); |
| 15 } | 15 } |
| 16 | 16 |
| 17 function step2(sourceFrame) | 17 function step2(sourceFrame) |
| 18 { | 18 { |
| 19 InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBreakpoint
.prototype, "_addResolvedLocation", didSetBreakpointInDebugger, true); | 19 InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.pro
totype, "_addResolvedLocation", didSetBreakpointInDebugger, true); |
| 20 | 20 |
| 21 InspectorTest.setBreakpoint(sourceFrame, 14, "", true); | 21 InspectorTest.setBreakpoint(sourceFrame, 14, "", true); |
| 22 InspectorTest.setBreakpoint(sourceFrame, 15, "", true); | 22 InspectorTest.setBreakpoint(sourceFrame, 15, "", true); |
| 23 | 23 |
| 24 var counter = 2; | 24 var counter = 2; |
| 25 | 25 |
| 26 function didSetBreakpointInDebugger() | 26 function didSetBreakpointInDebugger() |
| 27 { | 27 { |
| 28 counter--; | 28 counter--; |
| 29 if (counter) | 29 if (counter) |
| 30 return; | 30 return; |
| 31 //Both breakpoints are resolved before reload | 31 //Both breakpoints are resolved before reload |
| 32 InspectorTest.addSniffer(WebInspector.JavaScriptBreakpointsSidebarPa
ne.prototype, "didReceiveBreakpointLineForTest", onBreakpointsReady); | 32 InspectorTest.addSniffer(Sources.JavaScriptBreakpointsSidebarPane.pr
ototype, "didReceiveBreakpointLineForTest", onBreakpointsReady); |
| 33 } | 33 } |
| 34 | 34 |
| 35 function onBreakpointsReady() | 35 function onBreakpointsReady() |
| 36 { | 36 { |
| 37 InspectorTest.dumpBreakpointSidebarPane("Breakpoints before reload:"
); | 37 InspectorTest.dumpBreakpointSidebarPane("Breakpoints before reload:"
); |
| 38 waitForBreakpoints(); | 38 waitForBreakpoints(); |
| 39 InspectorTest.reloadPage(onPageReloaded); | 39 InspectorTest.reloadPage(onPageReloaded); |
| 40 } | 40 } |
| 41 | 41 |
| 42 function waitForBreakpoints() | 42 function waitForBreakpoints() |
| 43 { | 43 { |
| 44 var expectedBreakpointLocations = [[14, 0], [16, 4]]; | 44 var expectedBreakpointLocations = [[14, 0], [16, 4]]; |
| 45 var jsBreakpoints = self.runtime.sharedInstance(WebInspector.JavaScr
iptBreakpointsSidebarPane); | 45 var jsBreakpoints = self.runtime.sharedInstance(Sources.JavaScriptBr
eakpointsSidebarPane); |
| 46 jsBreakpoints.didReceiveBreakpointLineForTest = function(uiSourceCod
e, line, column) | 46 jsBreakpoints.didReceiveBreakpointLineForTest = function(uiSourceCod
e, line, column) |
| 47 { | 47 { |
| 48 if (WebInspector.CompilerScriptMapping.StubProjectID === uiSourc
eCode.project().id()) | 48 if (Bindings.CompilerScriptMapping.StubProjectID === uiSourceCod
e.project().id()) |
| 49 return; | 49 return; |
| 50 if (!uiSourceCode.url().endsWith("source1.js")) | 50 if (!uiSourceCode.url().endsWith("source1.js")) |
| 51 return; | 51 return; |
| 52 | 52 |
| 53 expectedBreakpointLocations = | 53 expectedBreakpointLocations = |
| 54 expectedBreakpointLocations.filter((location) => (location[0
] != line && location[1] != column)); | 54 expectedBreakpointLocations.filter((location) => (location[0
] != line && location[1] != column)); |
| 55 if (expectedBreakpointLocations.length) | 55 if (expectedBreakpointLocations.length) |
| 56 return; | 56 return; |
| 57 breakpointSourcesReceived = true; | 57 breakpointSourcesReceived = true; |
| 58 maybeCompleteTest(); | 58 maybeCompleteTest(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 82 </script> | 82 </script> |
| 83 </head> | 83 </head> |
| 84 | 84 |
| 85 <body onload="runTest()"> | 85 <body onload="runTest()"> |
| 86 <p> | 86 <p> |
| 87 Tests "reload" from within inspector window while on pause. | 87 Tests "reload" from within inspector window while on pause. |
| 88 </p> | 88 </p> |
| 89 | 89 |
| 90 </body> | 90 </body> |
| 91 </html> | 91 </html> |
| OLD | NEW |