OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src='../inspector-test.js'></script> |
| 4 <script src='../debugger-test.js'></script> |
| 5 <script src='../workspace-test.js'></script> |
| 6 <script src='../isolated-filesystem-test.js'></script> |
| 7 <script src='./persistence-test.js'></script> |
| 8 <script> |
| 9 |
| 10 function addFooJS() { |
| 11 var script = document.createElement('script'); |
| 12 script.src = './resources/foo.js'; |
| 13 document.body.appendChild(script); |
| 14 } |
| 15 |
| 16 function test() |
| 17 { |
| 18 var fs = new InspectorTest.TestFileSystem('file:///var/www'); |
| 19 fs.addFileMapping('http://127.0.0.1:8000', '/'); |
| 20 InspectorTest.addFooJSFile(fs); |
| 21 |
| 22 InspectorTest.runTestSuite([ |
| 23 function addFileSystem(next) |
| 24 { |
| 25 fs.reportCreated(next); |
| 26 }, |
| 27 |
| 28 function addNetworkFooJS(next) |
| 29 { |
| 30 InspectorTest.evaluateInPage('addFooJS()'); |
| 31 InspectorTest.waitForBinding('foo.js').then(next); |
| 32 }, |
| 33 |
| 34 function setBreakpointInNetworkUISourceCode(next) |
| 35 { |
| 36 InspectorTest.waitForUISourceCode('foo.js', Workspace.projectTypes.N
etwork) |
| 37 .then(sourceCode => InspectorTest.showUISourceCodePromise(source
Code)) |
| 38 .then(onSourceFrame); |
| 39 |
| 40 function onSourceFrame(sourceFrame) |
| 41 { |
| 42 InspectorTest.setBreakpoint(sourceFrame, 0, '', true); |
| 43 InspectorTest.waitBreakpointSidebarPane().then(dumpBreakpointSid
ebarPane).then(next); |
| 44 } |
| 45 }, |
| 46 |
| 47 function reloadPageAndDumpBreakpoints(next) |
| 48 { |
| 49 Promise.all([ |
| 50 InspectorTest.waitBreakpointSidebarPane(), |
| 51 InspectorTest.reloadPagePromise() |
| 52 ]).then(dumpBreakpointSidebarPane).then(next); |
| 53 }, |
| 54 ]); |
| 55 |
| 56 function dumpBreakpointSidebarPane() |
| 57 { |
| 58 var paneElement = self.runtime.sharedInstance(Sources.JavaScriptBreakpoi
ntsSidebarPane).contentElement; |
| 59 var empty = paneElement.querySelector('.gray-info-message'); |
| 60 if (empty) |
| 61 return InspectorTest.textContentWithLineBreaks(empty); |
| 62 var entries = Array.from(paneElement.querySelectorAll('.breakpoint-entry
')); |
| 63 for (var entry of entries) { |
| 64 var uiLocation = entry[Sources.JavaScriptBreakpointsSidebarPane._loc
ationSymbol]; |
| 65 InspectorTest.addResult(" " + uiLocation.uiSourceCode.url() +":"
+ uiLocation.lineNumber); |
| 66 } |
| 67 } |
| 68 }; |
| 69 </script> |
| 70 </head> |
| 71 <body onload='runTest()'> |
| 72 <p>Verify that breakpoints are moved appropriately in case of page reload.</p> |
| 73 </body> |
| 74 </html> |
OLD | NEW |