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 src="./resources/foo.js"></script> |
| 9 <script> |
| 10 |
| 11 function test() |
| 12 { |
| 13 var sourcesNavigator = new WebInspector.SourcesNavigatorView(); |
| 14 sourcesNavigator.show(WebInspector.inspectorView.element); |
| 15 var fs = new InspectorTest.TestFileSystem("file:///var/www"); |
| 16 var fsEntry = fs.root.mkdir("inspector").mkdir("persistence").mkdir("resourc
es").addFile("foo.js", "window.foo = ()=>'foo';"); |
| 17 |
| 18 InspectorTest.runTestSuite([ |
| 19 function addFileSystem(next) |
| 20 { |
| 21 fs.reportCreated(next); |
| 22 }, |
| 23 |
| 24 function waitForUISourceCodes(next) |
| 25 { |
| 26 var promises = [ |
| 27 InspectorTest.waitForUISourceCode("foo.js", WebInspector.project
Types.Network), |
| 28 InspectorTest.waitForUISourceCode("foo.js", WebInspector.project
Types.FileSystem) |
| 29 ]; |
| 30 Promise.all(promises).then(onUISourceCodesAdded); |
| 31 |
| 32 function onUISourceCodesAdded() |
| 33 { |
| 34 InspectorTest.dumpNavigatorView(sourcesNavigator); |
| 35 next(); |
| 36 } |
| 37 }, |
| 38 |
| 39 function addFileMapping(next) |
| 40 { |
| 41 InspectorTest.waitForBinding("foo.js", onBindingCreated); |
| 42 WebInspector.fileSystemMapping.addFileSystem(fs.fileSystemPath); |
| 43 WebInspector.fileSystemMapping.addFileMapping(fs.fileSystemPath, "ht
tp://127.0.0.1:8000", "/"); |
| 44 |
| 45 function onBindingCreated(binding) |
| 46 { |
| 47 InspectorTest.dumpNavigatorView(sourcesNavigator); |
| 48 next(); |
| 49 } |
| 50 }, |
| 51 |
| 52 function removeFileMapping(next) |
| 53 { |
| 54 WebInspector.persistence.addEventListener(WebInspector.Persistence.E
vents.BindingRemoved, onBindingRemoved); |
| 55 WebInspector.fileSystemMapping.removeFileMapping(fs.fileSystemPath,
"http://127.0.0.1:8000", "/"); |
| 56 |
| 57 function onBindingRemoved(event) |
| 58 { |
| 59 var binding = event.data; |
| 60 if (binding.network.name() !== "foo.js") |
| 61 return |
| 62 WebInspector.persistence.removeEventListener(WebInspector.Persis
tence.Events.BindingRemoved, onBindingRemoved); |
| 63 InspectorTest.dumpNavigatorView(sourcesNavigator); |
| 64 next(); |
| 65 } |
| 66 }, |
| 67 ]); |
| 68 }; |
| 69 </script> |
| 70 </head> |
| 71 <body onload="runTest()"> |
| 72 <p>Verify that navigator view removes mapped UISourceCodes.</p> |
| 73 </body> |
| 74 </html> |
OLD | NEW |