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 async function test() | 10 async function test() |
11 { | 11 { |
| 12 var testMapping = InspectorTest.initializeTestMapping(); |
12 var fs = new InspectorTest.TestFileSystem('file:///var/www'); | 13 var fs = new InspectorTest.TestFileSystem('file:///var/www'); |
13 var fsEntry = InspectorTest.addFooJSFile(fs); | 14 var fsEntry = InspectorTest.addFooJSFile(fs); |
14 fs.root.addFile('bar.js', "window.bar = ()=>'bar';"); | 15 fs.root.addFile('bar.js', "window.bar = ()=>'bar';"); |
15 await fs.reportCreatedPromise(); | 16 await fs.reportCreatedPromise(); |
16 | 17 |
17 var fsSourceCode = await InspectorTest.waitForUISourceCode('foo.js', Workspa
ce.projectTypes.FileSystem); | 18 var fsSourceCode = await InspectorTest.waitForUISourceCode('foo.js', Workspa
ce.projectTypes.FileSystem); |
18 var networkSourceCode = await InspectorTest.waitForUISourceCode('foo.js', Wo
rkspace.projectTypes.Network); | 19 var networkSourceCode = await InspectorTest.waitForUISourceCode('foo.js', Wo
rkspace.projectTypes.Network); |
19 var barSourceCode = await InspectorTest.waitForUISourceCode('bar.js'); | 20 var barSourceCode = await InspectorTest.waitForUISourceCode('bar.js'); |
20 UI.panels.sources.showUISourceCode(barSourceCode, 0, 0); | 21 UI.panels.sources.showUISourceCode(barSourceCode, 0, 0); |
21 UI.panels.sources.showUISourceCode(networkSourceCode, 0, 0); | 22 UI.panels.sources.showUISourceCode(networkSourceCode, 0, 0); |
22 // Open and select file system tab. Selection should stay here. | 23 // Open and select file system tab. Selection should stay here. |
23 UI.panels.sources.showUISourceCode(fsSourceCode, 0, 0); | 24 UI.panels.sources.showUISourceCode(fsSourceCode, 0, 0); |
24 | 25 |
25 dumpTabs('Opened tabs before persistence binding:'); | 26 dumpTabs('Opened tabs before persistence binding:'); |
26 Workspace.fileSystemMapping.addFileMapping(fs.fileSystemPath, 'http://127.0.
0.1:8000', '/'); | 27 testMapping.addBinding('foo.js'); |
27 await InspectorTest.waitForBinding('foo.js'); | 28 await InspectorTest.waitForBinding('foo.js'); |
28 dumpTabs('\nOpened tabs after persistence binding:'); | 29 dumpTabs('\nOpened tabs after persistence binding:'); |
29 InspectorTest.completeTest(); | 30 InspectorTest.completeTest(); |
30 | 31 |
31 function dumpTabs(title) | 32 function dumpTabs(title) |
32 { | 33 { |
33 var tabbedPane = UI.panels.sources._sourcesView._editorContainer._tabbed
Pane; | 34 var tabbedPane = UI.panels.sources._sourcesView._editorContainer._tabbed
Pane; |
34 var tabs = tabbedPane._tabs; | 35 var tabs = tabbedPane._tabs; |
35 InspectorTest.addResult(title); | 36 InspectorTest.addResult(title); |
36 for (var i = 0; i < tabs.length; ++i) { | 37 for (var i = 0; i < tabs.length; ++i) { |
37 var text = (i + 1) + ': '; | 38 var text = (i + 1) + ': '; |
38 text += tabs[i].title; | 39 text += tabs[i].title; |
39 if (tabs[i] === tabbedPane._currentTab) | 40 if (tabs[i] === tabbedPane._currentTab) |
40 text += ' [selected]'; | 41 text += ' [selected]'; |
41 InspectorTest.addResult(' ' + text); | 42 InspectorTest.addResult(' ' + text); |
42 } | 43 } |
43 } | 44 } |
44 }; | 45 }; |
45 </script> | 46 </script> |
46 </head> | 47 </head> |
47 <body onload='runTest()'> | 48 <body onload='runTest()'> |
48 <p>Verify that tab keeps selected as the persistence binding comes in.</p> | 49 <p>Verify that tab keeps selected as the persistence binding comes in.</p> |
49 </body> | 50 </body> |
50 </html> | 51 </html> |
OLD | NEW |