| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../inspector-test.js"></script> | 3 <script src="../inspector-test.js"></script> |
| 4 <script src="../debugger-test.js"></script> | 4 <script src="../debugger-test.js"></script> |
| 5 <script src="../workspace-test.js"></script> | 5 <script src="../workspace-test.js"></script> |
| 6 <script src="../isolated-filesystem-test.js"></script> | 6 <script src="../isolated-filesystem-test.js"></script> |
| 7 <script src="./persistence-test.js"></script> | 7 <script src="./persistence-test.js"></script> |
| 8 <script src="./resources/foo.js"></script> | 8 <script src="./resources/foo.js"></script> |
| 9 <script> | 9 <script> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 function setBreakpointInFileSystemUISourceCode(next) | 22 function setBreakpointInFileSystemUISourceCode(next) |
| 23 { | 23 { |
| 24 InspectorTest.waitForUISourceCode("foo.js", Workspace.projectTypes.F
ileSystem) | 24 InspectorTest.waitForUISourceCode("foo.js", Workspace.projectTypes.F
ileSystem) |
| 25 .then(code => InspectorTest.showUISourceCodePromise(code)) | 25 .then(code => InspectorTest.showUISourceCodePromise(code)) |
| 26 .then(onSourceFrame); | 26 .then(onSourceFrame); |
| 27 | 27 |
| 28 function onSourceFrame(sourceFrame) | 28 function onSourceFrame(sourceFrame) |
| 29 { | 29 { |
| 30 InspectorTest.setBreakpoint(sourceFrame, 0, "", true); | 30 InspectorTest.setBreakpoint(sourceFrame, 0, "", true); |
| 31 dumpBreakpointSidebarPane(); | 31 InspectorTest.waitBreakpointSidebarPane().then(InspectorTest.dum
pBreakpointSidebarPane).then(next); |
| 32 next(); | |
| 33 } | 32 } |
| 34 }, | 33 }, |
| 35 | 34 |
| 36 function addFileMapping(next) | 35 function addFileMapping(next) |
| 37 { | 36 { |
| 38 InspectorTest.waitForBinding("foo.js").then(onBindingCreated); | 37 InspectorTest.waitForBinding("foo.js").then(onBindingCreated); |
| 39 Workspace.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http:
//127.0.0.1:8000", "/"); | 38 Workspace.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http:
//127.0.0.1:8000", "/"); |
| 40 | 39 |
| 41 function onBindingCreated(binding) | 40 function onBindingCreated(binding) |
| 42 { | 41 { |
| 43 dumpBreakpointSidebarPane(); | 42 InspectorTest.waitBreakpointSidebarPane().then(InspectorTest.dum
pBreakpointSidebarPane).then(next); |
| 44 next(); | |
| 45 } | 43 } |
| 46 }, | 44 }, |
| 47 | 45 |
| 48 function removeFileMapping(next) | 46 function removeFileMapping(next) |
| 49 { | 47 { |
| 50 Persistence.persistence.addEventListener(Persistence.Persistence.Eve
nts.BindingRemoved, onBindingRemoved); | 48 Persistence.persistence.addEventListener(Persistence.Persistence.Eve
nts.BindingRemoved, onBindingRemoved); |
| 51 Workspace.fileSystemMapping.removeFileMapping(fs.fileSystemPath, "ht
tp://127.0.0.1:8000", "/"); | 49 Workspace.fileSystemMapping.removeFileMapping(fs.fileSystemPath, "ht
tp://127.0.0.1:8000", "/"); |
| 52 | 50 |
| 53 function onBindingRemoved(event) | 51 function onBindingRemoved(event) |
| 54 { | 52 { |
| 55 var binding = event.data; | 53 var binding = event.data; |
| 56 if (binding.network.name() !== "foo.js") | 54 if (binding.network.name() !== "foo.js") |
| 57 return | 55 return |
| 58 Persistence.persistence.removeEventListener(Persistence.Persiste
nce.Events.BindingRemoved, onBindingRemoved); | 56 Persistence.persistence.removeEventListener(Persistence.Persiste
nce.Events.BindingRemoved, onBindingRemoved); |
| 59 dumpBreakpointSidebarPane(); | 57 InspectorTest.waitBreakpointSidebarPane().then(dumpBreakpointSid
ebarPane).then(next); |
| 60 next(); | |
| 61 } | 58 } |
| 62 }, | 59 }, |
| 63 ]); | 60 ]); |
| 64 | 61 |
| 65 function dumpBreakpointSidebarPane() | 62 function dumpBreakpointSidebarPane() |
| 66 { | 63 { |
| 67 var sidebarPane = self.runtime.sharedInstance(Sources.JavaScriptBreakpoi
ntsSidebarPane) | 64 var paneElement = self.runtime.sharedInstance(Sources.JavaScriptBreakpoi
ntsSidebarPane).contentElement; |
| 68 var breakpoints = sidebarPane._items.keysArray(); | 65 var empty = paneElement.querySelector('.gray-info-message'); |
| 69 for (var breakpoint of breakpoints) | 66 if (empty) |
| 70 InspectorTest.addResult(" " + breakpoint.uiSourceCode().url() +":
" + breakpoint.lineNumber()); | 67 return InspectorTest.textContentWithLineBreaks(empty); |
| 68 var entries = Array.from(paneElement.querySelectorAll('.breakpoint-entry
')); |
| 69 for (var entry of entries) { |
| 70 var uiLocation = entry[Sources.JavaScriptBreakpointsSidebarPane._loc
ationSymbol]; |
| 71 InspectorTest.addResult(" " + uiLocation.uiSourceCode.url() +":"
+ uiLocation.lineNumber); |
| 72 } |
| 71 } | 73 } |
| 72 }; | 74 }; |
| 73 </script> | 75 </script> |
| 74 </head> | 76 </head> |
| 75 <body onload="runTest()"> | 77 <body onload="runTest()"> |
| 76 <p>Verify that breakpoints are moved appropriately</p> | 78 <p>Verify that breakpoints are moved appropriately</p> |
| 77 </body> | 79 </body> |
| 78 </html> | 80 </html> |
| OLD | NEW |