Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(767)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-tabbed-editor-keeps-selected-tab.html

Issue 2740053002: DevTools: keep selected tab as persistence binding comes in (Closed)
Patch Set: thoughtful code Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src='../inspector-test.js'></script>
4 <script src='../debugger-test.js'></script>
5 <script src='../isolated-filesystem-test.js'></script>
6 <script src='./persistence-test.js'></script>
7 <script src='./resources/foo.js'></script>
8 <script>
9
10 async function test()
11 {
12 var fs = new InspectorTest.TestFileSystem('file:///var/www');
13 var fsEntry = InspectorTest.addFooJSFile(fs);
14 fs.root.addFile('bar.js', "window.bar = ()=>'bar';");
15 await fs.reportCreatedPromise();
16
17 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 barSourceCode = await InspectorTest.waitForUISourceCode('bar.js');
20 UI.panels.sources.showUISourceCode(barSourceCode, 0, 0);
21 UI.panels.sources.showUISourceCode(networkSourceCode, 0, 0);
22 // Open and select file system tab. Selection should stay here.
23 UI.panels.sources.showUISourceCode(fsSourceCode, 0, 0);
24
25 dumpTabs('Opened tabs before persistence binding:');
26 Workspace.fileSystemMapping.addFileMapping(fs.fileSystemPath, 'http://127.0. 0.1:8000', '/');
27 await InspectorTest.waitForBinding('foo.js');
28 dumpTabs('\nOpened tabs after persistence binding:');
29 InspectorTest.completeTest();
30
31 function dumpTabs(title)
32 {
33 var tabbedPane = UI.panels.sources._sourcesView._editorContainer._tabbed Pane;
34 var tabs = tabbedPane._tabs;
35 InspectorTest.addResult(title);
36 for (var i = 0; i < tabs.length; ++i) {
37 var text = (i + 1) + ': ';
38 text += tabs[i].title;
39 if (tabs[i] === tabbedPane._currentTab)
40 text += ' [selected]';
41 InspectorTest.addResult(' ' + text);
42 }
43 }
44 };
45 </script>
46 </head>
47 <body onload='runTest()'>
48 <p>Verify that tab keeps selected as the persistence binding comes in.</p>
49 </body>
50 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698