OLD | NEW |
(Empty) | |
| 1 runtime._registerModule({ |
| 2 name: "mock-module", |
| 3 extensions: ['first', 'second', 'third', 'fourth'].map(title => { |
| 4 return { |
| 5 "type": "view", |
| 6 "location": "mock-location", |
| 7 "id": title, |
| 8 "title": title, |
| 9 "persistence": "closeable", |
| 10 "factoryName": "UI.Widget" |
| 11 } |
| 12 }), |
| 13 scripts: [] |
| 14 }); |
| 15 |
| 16 var tabbedLocation; |
| 17 var viewManager; |
| 18 createTabbedLocation(); |
| 19 dumpTabs(); |
| 20 TestRunner.addResult('Appending three views') |
| 21 viewManager.showView('first'); |
| 22 viewManager.showView('second'); |
| 23 viewManager.showView('third'); |
| 24 dumpTabs(); |
| 25 createTabbedLocation(); |
| 26 dumpTabs(); |
| 27 TestRunner.addResult('Re-order tabs'); |
| 28 tabbedLocation.tabbedPane()._insertBefore(tabbedLocation.tabbedPane()._tabsById.
get("third"), 0); |
| 29 dumpTabs(); |
| 30 createTabbedLocation(); |
| 31 dumpTabs(); |
| 32 viewManager.showView('fourth'); |
| 33 dumpTabs(); |
| 34 createTabbedLocation(); |
| 35 dumpTabs(); |
| 36 TestRunner.addResult('Closing second tab'); |
| 37 tabbedLocation.tabbedPane().closeTab('second'); |
| 38 dumpTabs(); |
| 39 createTabbedLocation(); |
| 40 dumpTabs(); |
| 41 TestRunner.completeTest(); |
| 42 |
| 43 function createTabbedLocation() { |
| 44 TestRunner.addResult('Creating new TabbedLocation'); |
| 45 if (tabbedLocation) |
| 46 tabbedLocation.tabbedPane().detach(true); |
| 47 viewManager = new UI.ViewManager(); |
| 48 tabbedLocation = viewManager.createTabbedLocation(undefined, 'mock-location',
true, true); |
| 49 tabbedLocation.widget().show(UI.inspectorView.element); |
| 50 } |
| 51 |
| 52 function dumpTabs() { |
| 53 TestRunner.addResult(JSON.stringify(tabbedLocation.tabbedPane().tabIds())); |
| 54 } |
OLD | NEW |