| 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); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 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 //Both breakpoints are resolved before reload | 30 //Both breakpoints are resolved before reload |
| 31 InspectorTest.dumpBreakpointSidebarPane("Breakpoints before relo
ad:"); | 31 InspectorTest.dumpBreakpointSidebarPane("Breakpoints before relo
ad:"); |
| 32 InspectorTest.addSniffer(WebInspector.CompilerScriptMapping.prot
otype, "_sourceMapLoaded", onSourceMapLoaded); | 32 waitForBreakpoints(); |
| 33 InspectorTest.reloadPage(onPageReloaded); | 33 InspectorTest.reloadPage(onPageReloaded); |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 |
| 37 function waitForBreakpoints() |
| 38 { |
| 39 var breakpointAddCounter = 2; |
| 40 var jsBreakpoints = WebInspector.panels.sources.sidebarPanes.jsBreak
points; |
| 41 jsBreakpoints.didReceiveBreakpointLineForTest = function(uiSourceCod
e) |
| 42 { |
| 43 if (WebInspector.CompilerScriptMapping.StubProjectID === uiSourc
eCode.project().id()) |
| 44 return; |
| 45 --breakpointAddCounter; |
| 46 if (breakpointAddCounter) |
| 47 return; |
| 48 breakpointSourcesReceived = true; |
| 49 maybeCompleteTest(); |
| 50 } |
| 51 } |
| 52 |
| 36 } | 53 } |
| 37 | 54 |
| 38 var sourceMapLoaded = false; | 55 var breakpointSourcesReceived = false; |
| 39 var pageReloaded = false; | 56 var pageReloaded = false; |
| 40 | 57 |
| 41 function onPageReloaded() | 58 function onPageReloaded() |
| 42 { | 59 { |
| 43 pageReloaded = true; | 60 pageReloaded = true; |
| 44 maybeCompleteTest(); | 61 maybeCompleteTest(); |
| 45 } | 62 } |
| 46 | 63 |
| 47 function onSourceMapLoaded() | |
| 48 { | |
| 49 sourceMapLoaded = true; | |
| 50 maybeCompleteTest(); | |
| 51 } | |
| 52 | |
| 53 function maybeCompleteTest() | 64 function maybeCompleteTest() |
| 54 { | 65 { |
| 55 if (!pageReloaded || !sourceMapLoaded) | 66 if (!pageReloaded || !breakpointSourcesReceived) |
| 56 return; | 67 return; |
| 57 InspectorTest.dumpBreakpointSidebarPane("Breakpoints after reload:"); | 68 InspectorTest.dumpBreakpointSidebarPane("Breakpoints after reload:"); |
| 58 InspectorTest.completeDebuggerTest(); | 69 InspectorTest.completeDebuggerTest(); |
| 59 } | 70 } |
| 60 } | 71 } |
| 61 | 72 |
| 62 </script> | 73 </script> |
| 63 </head> | 74 </head> |
| 64 | 75 |
| 65 <body onload="runTest()"> | 76 <body onload="runTest()"> |
| 66 <p> | 77 <p> |
| 67 Tests "reload" from within inspector window while on pause. | 78 Tests "reload" from within inspector window while on pause. |
| 68 </p> | 79 </p> |
| 69 | 80 |
| 70 </body> | 81 </body> |
| 71 </html> | 82 </html> |
| OLD | NEW |