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="../isolated-filesystem-test.js"></script> | 5 <script src="../isolated-filesystem-test.js"></script> |
6 <script src="./persistence-test.js"></script> | 6 <script src="./persistence-test.js"></script> |
7 <script src="./resources/foo.js"></script> | 7 <script src="./resources/foo.js"></script> |
8 <script> | 8 <script> |
9 | 9 |
10 function test() | 10 function test() |
11 { | 11 { |
| 12 var testMapping = InspectorTest.initializeTestMapping(); |
12 InspectorTest.runTestSuite([ | 13 InspectorTest.runTestSuite([ |
13 function openNetworkTab(next) | 14 function openNetworkTab(next) |
14 { | 15 { |
15 InspectorTest.waitForUISourceCode("foo.js", Workspace.projectTypes.N
etwork) | 16 InspectorTest.waitForUISourceCode("foo.js", Workspace.projectTypes.N
etwork) |
16 .then(sourceCode => InspectorTest.showUISourceCodePromise(source
Code)) | 17 .then(sourceCode => InspectorTest.showUISourceCodePromise(source
Code)) |
17 .then(onSourceFrame); | 18 .then(onSourceFrame); |
18 | 19 |
19 function onSourceFrame(sourceFrame) | 20 function onSourceFrame(sourceFrame) |
20 { | 21 { |
21 dumpEditorTabs(); | 22 dumpEditorTabs(); |
22 next(); | 23 next(); |
23 } | 24 } |
24 }, | 25 }, |
25 | 26 |
26 function addMapping(next) | 27 function addMapping(next) |
27 { | 28 { |
28 var fs = new InspectorTest.TestFileSystem("file:///var/www"); | 29 var fs = new InspectorTest.TestFileSystem("file:///var/www"); |
29 fs.addFileMapping("http://127.0.0.1:8000", "/"); | |
30 InspectorTest.addFooJSFile(fs); | 30 InspectorTest.addFooJSFile(fs); |
31 fs.reportCreated(function() { }); | 31 fs.reportCreated(function() { }); |
| 32 testMapping.addBinding("foo.js"); |
32 InspectorTest.waitForBinding("foo.js").then(onBindingCreated); | 33 InspectorTest.waitForBinding("foo.js").then(onBindingCreated); |
33 | 34 |
34 function onBindingCreated() | 35 function onBindingCreated() |
35 { | 36 { |
36 dumpEditorTabs(); | 37 dumpEditorTabs(); |
37 next(); | 38 next(); |
38 } | 39 } |
39 }, | 40 }, |
40 ]); | 41 ]); |
41 | 42 |
42 function dumpEditorTabs() | 43 function dumpEditorTabs() |
43 { | 44 { |
44 var editorContainer = UI.panels.sources._sourcesView._editorContainer; | 45 var editorContainer = UI.panels.sources._sourcesView._editorContainer; |
45 var openedUISourceCodes = editorContainer._tabIds.keysArray(); | 46 var openedUISourceCodes = editorContainer._tabIds.keysArray(); |
46 openedUISourceCodes.sort((a, b) => a.url().compareTo(b.url())); | 47 openedUISourceCodes.sort((a, b) => a.url().compareTo(b.url())); |
47 InspectorTest.addResult("Opened tabs: "); | 48 InspectorTest.addResult("Opened tabs: "); |
48 for (code of openedUISourceCodes) | 49 for (code of openedUISourceCodes) |
49 InspectorTest.addResult(" " + code.url()); | 50 InspectorTest.addResult(" " + code.url()); |
50 } | 51 } |
51 }; | 52 }; |
52 </script> | 53 </script> |
53 </head> | 54 </head> |
54 <body onload="runTest()"> | 55 <body onload="runTest()"> |
55 <p>Verify that a network file tab gets substituted with filesystem tab when pers
istence binding comes.</p> | 56 <p>Verify that a network file tab gets substituted with filesystem tab when pers
istence binding comes.</p> |
56 </body> | 57 </body> |
57 </html> | 58 </html> |
OLD | NEW |