| 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 |
| 11 function test() | 11 function test() |
| 12 { | 12 { |
| 13 var fs = new InspectorTest.TestFileSystem("file:///var/www"); | 13 var fs = new InspectorTest.TestFileSystem("file:///var/www"); |
| 14 var fsEntry = InspectorTest.addFooJSFile(fs); | 14 var fsEntry = InspectorTest.addFooJSFile(fs); |
| 15 | 15 |
| 16 InspectorTest.runTestSuite([ | 16 InspectorTest.runTestSuite([ |
| 17 function addFileSystem(next) | 17 function addFileSystem(next) |
| 18 { | 18 { |
| 19 fs.reportCreated(next); | 19 fs.reportCreated(next); |
| 20 }, | 20 }, |
| 21 | 21 |
| 22 function setBreakpointInFileSystemUISourceCode(next) | 22 function setBreakpointInFileSystemUISourceCode(next) |
| 23 { | 23 { |
| 24 InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectType
s.FileSystem) | 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 dumpBreakpointSidebarPane(); |
| 32 next(); | 32 next(); |
| 33 } | 33 } |
| 34 }, | 34 }, |
| 35 | 35 |
| 36 function addFileMapping(next) | 36 function addFileMapping(next) |
| 37 { | 37 { |
| 38 InspectorTest.waitForBinding("foo.js").then(onBindingCreated); | 38 InspectorTest.waitForBinding("foo.js").then(onBindingCreated); |
| 39 WebInspector.fileSystemMapping.addFileMapping(fs.fileSystemPath, "ht
tp://127.0.0.1:8000", "/"); | 39 Workspace.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http:
//127.0.0.1:8000", "/"); |
| 40 | 40 |
| 41 function onBindingCreated(binding) | 41 function onBindingCreated(binding) |
| 42 { | 42 { |
| 43 dumpBreakpointSidebarPane(); | 43 dumpBreakpointSidebarPane(); |
| 44 next(); | 44 next(); |
| 45 } | 45 } |
| 46 }, | 46 }, |
| 47 | 47 |
| 48 function removeFileMapping(next) | 48 function removeFileMapping(next) |
| 49 { | 49 { |
| 50 WebInspector.persistence.addEventListener(WebInspector.Persistence.E
vents.BindingRemoved, onBindingRemoved); | 50 Persistence.persistence.addEventListener(Persistence.Persistence.Eve
nts.BindingRemoved, onBindingRemoved); |
| 51 WebInspector.fileSystemMapping.removeFileMapping(fs.fileSystemPath,
"http://127.0.0.1:8000", "/"); | 51 Workspace.fileSystemMapping.removeFileMapping(fs.fileSystemPath, "ht
tp://127.0.0.1:8000", "/"); |
| 52 | 52 |
| 53 function onBindingRemoved(event) | 53 function onBindingRemoved(event) |
| 54 { | 54 { |
| 55 var binding = event.data; | 55 var binding = event.data; |
| 56 if (binding.network.name() !== "foo.js") | 56 if (binding.network.name() !== "foo.js") |
| 57 return | 57 return |
| 58 WebInspector.persistence.removeEventListener(WebInspector.Persis
tence.Events.BindingRemoved, onBindingRemoved); | 58 Persistence.persistence.removeEventListener(Persistence.Persiste
nce.Events.BindingRemoved, onBindingRemoved); |
| 59 dumpBreakpointSidebarPane(); | 59 dumpBreakpointSidebarPane(); |
| 60 next(); | 60 next(); |
| 61 } | 61 } |
| 62 }, | 62 }, |
| 63 ]); | 63 ]); |
| 64 | 64 |
| 65 function dumpBreakpointSidebarPane() | 65 function dumpBreakpointSidebarPane() |
| 66 { | 66 { |
| 67 var sidebarPane = self.runtime.sharedInstance(WebInspector.JavaScriptBre
akpointsSidebarPane) | 67 var sidebarPane = self.runtime.sharedInstance(Sources.JavaScriptBreakpoi
ntsSidebarPane) |
| 68 var breakpoints = sidebarPane._items.keysArray(); | 68 var breakpoints = sidebarPane._items.keysArray(); |
| 69 for (var breakpoint of breakpoints) | 69 for (var breakpoint of breakpoints) |
| 70 InspectorTest.addResult(" " + breakpoint.uiSourceCode().url() +":
" + breakpoint.lineNumber()); | 70 InspectorTest.addResult(" " + breakpoint.uiSourceCode().url() +":
" + breakpoint.lineNumber()); |
| 71 } | 71 } |
| 72 }; | 72 }; |
| 73 </script> | 73 </script> |
| 74 </head> | 74 </head> |
| 75 <body onload="runTest()"> | 75 <body onload="runTest()"> |
| 76 <p>Verify that breakpoints are moved appropriately</p> | 76 <p>Verify that breakpoints are moved appropriately</p> |
| 77 </body> | 77 </body> |
| 78 </html> | 78 </html> |
| OLD | NEW |