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

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: Runtime module for test 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..54d5a8b62ae3b5641132784f869bdac5479c63c3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/view-location.js
@@ -0,0 +1,58 @@
+class ClosableView extends UI.SimpleView {
+ isCloseable() {
+ return true;
+ }
+}
+
+runtime._registerModule({
+ name: "mock-module",
+ extensions: ['first', 'second', 'third', 'fourth'].map(title => {
+ return {
+ "type": "view",
+ "location": "mock-location",
+ "id": title,
+ "title": title,
+ "persistence": "closeable",
dgozman 2017/05/26 19:17:08 Do you need both this and isCloseable method? In f
einbinder 2017/05/26 21:12:38 I did but now I don't.
+ "factoryName": "ClosableView"
+ }
+ }),
+ scripts: []
+});
+
+var tabbedLocation;
+createTabbedLocation();
+dumpTabs();
+TestRunner.addResult('Appending three views')
+tabbedLocation.appendView(new ClosableView('first'));
dgozman 2017/05/26 19:17:08 Why manually? Doesn't this clash with ones from ex
einbinder 2017/05/26 21:12:38 It doesn't clash, but your code is much cleaner.
+tabbedLocation.appendView(new ClosableView('second'));
+tabbedLocation.appendView(new ClosableView('third'));
+dumpTabs();
+createTabbedLocation();
+dumpTabs();
+TestRunner.addResult('Re-order tabs');
+tabbedLocation.tabbedPane()._insertBefore(tabbedLocation.tabbedPane()._tabsById.get("third"), 0);
+dumpTabs();
+createTabbedLocation();
+dumpTabs();
+tabbedLocation.appendView(new ClosableView('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);
+ tabbedLocation = (new UI.ViewManager()).createTabbedLocation(undefined, 'mock-location', true, true);
dgozman 2017/05/26 19:17:08 Why not UI.viewManager?
einbinder 2017/05/26 21:12:39 UI.viewManager has stale extensions. Also it shoul
+ 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