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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector-unit/view-location.js

Issue 2867133002: DevTools: Let the drawer tabs be reordered (Closed)
Patch Set: showView Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector-unit/view-location-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/inspector-unit/view-location.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/view-location.js b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/view-location.js
new file mode 100644
index 0000000000000000000000000000000000000000..ddce77fcb3098d58601ac946617bb0da531bd7a3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/view-location.js
@@ -0,0 +1,54 @@
+runtime._registerModule({
+ name: "mock-module",
+ extensions: ['first', 'second', 'third', 'fourth'].map(title => {
+ return {
+ "type": "view",
+ "location": "mock-location",
+ "id": title,
+ "title": title,
+ "persistence": "closeable",
+ "factoryName": "UI.Widget"
+ }
+ }),
+ scripts: []
+});
+
+var tabbedLocation;
+var viewManager;
+createTabbedLocation();
+dumpTabs();
+TestRunner.addResult('Appending three views')
+viewManager.showView('first');
+viewManager.showView('second');
+viewManager.showView('third');
+dumpTabs();
+createTabbedLocation();
+dumpTabs();
+TestRunner.addResult('Re-order tabs');
+tabbedLocation.tabbedPane()._insertBefore(tabbedLocation.tabbedPane()._tabsById.get("third"), 0);
+dumpTabs();
+createTabbedLocation();
+dumpTabs();
+viewManager.showView('fourth');
+dumpTabs();
+createTabbedLocation();
+dumpTabs();
+TestRunner.addResult('Closing second tab');
+tabbedLocation.tabbedPane().closeTab('second');
+dumpTabs();
+createTabbedLocation();
+dumpTabs();
+TestRunner.completeTest();
+
+function createTabbedLocation() {
+ TestRunner.addResult('Creating new TabbedLocation');
+ if (tabbedLocation)
+ tabbedLocation.tabbedPane().detach(true);
+ viewManager = new UI.ViewManager();
+ tabbedLocation = viewManager.createTabbedLocation(undefined, 'mock-location', true, true);
+ tabbedLocation.widget().show(UI.inspectorView.element);
+}
+
+function dumpTabs() {
+ TestRunner.addResult(JSON.stringify(tabbedLocation.tabbedPane().tabIds()));
+}
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector-unit/view-location-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698