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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-tabbed-editor-tabs-order.html

Issue 2460513003: DevTools: [Persistence] tabs should not change order during reload (Closed)
Patch Set: fix test Created 4 years, 2 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
Index: third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-tabbed-editor-tabs-order.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-tabbed-editor-tabs-order.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-tabbed-editor-tabs-order.html
new file mode 100644
index 0000000000000000000000000000000000000000..0ae49dcbed4a7e756a6e56d72f7ea74b1c8615f1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-tabbed-editor-tabs-order.html
@@ -0,0 +1,90 @@
+<html>
+<head>
+<script src="../inspector-test.js"></script>
+<script src="../debugger-test.js"></script>
+<script src="../workspace-test.js"></script>
+<script src="../isolated-filesystem-test.js"></script>
+<script src="./persistence-test.js"></script>
+<script src="./resources/foo.js"></script>
+<script src="./resources/bar.js"></script>
+<script src="./resources/baz.js"></script>
+<script>
+
+function test()
+{
+ var fs = new InspectorTest.TestFileSystem("file:///var/www");
+ var folder = fs.root.mkdir("inspector").mkdir("persistence").mkdir("resources");
+ folder.addFile("foo.js", "\n\nwindow.foo = ()=>'foo';");
+ folder.addFile("bar.js", "window.bar = () => \"bar\";");
+ folder.addFile("baz.js", "window.baz = () => \"baz\";");
+ fs.addFileMapping("http://127.0.0.1:8000", "/");
+ fs.reportCreated(function() { });
+
+ InspectorTest.runTestSuite([
+ function waitForBindings(next)
+ {
+ Promise.all([
+ InspectorTest.waitForBinding("foo.js"),
+ InspectorTest.waitForBinding("bar.js"),
+ InspectorTest.waitForBinding("baz.js")
+ ]).then(next);
+ },
+
+ function openNetworkFiles(next)
+ {
+ Promise.all([
+ InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectTypes.Network),
+ InspectorTest.waitForUISourceCode("bar.js", WebInspector.projectTypes.Network),
+ InspectorTest.waitForUISourceCode("baz.js", WebInspector.projectTypes.Network)
+ ]).then(onUISourceCodes);
+
+ function onUISourceCodes(uiSourceCodes)
+ {
+ for (var uiSourceCode of uiSourceCodes)
+ InspectorTest.showUISourceCode(uiSourceCode, function() { });
+ dumpTabs("initial tabs:");
+ next();
+ }
+ },
+
+ function reloadPage(next)
+ {
+ InspectorTest.hardReloadPage(onReloaded);
+
+ function onReloaded()
+ {
+ Promise.all([
+ InspectorTest.waitForBinding("foo.js"),
+ InspectorTest.waitForBinding("bar.js"),
+ InspectorTest.waitForBinding("baz.js")
+ ]).then(onBindingsRecreated);
+ }
+
+ function onBindingsRecreated(bindings)
+ {
+ dumpTabs("Tabs after reload:");
+ next();
+ }
+ },
+ ]);
+
+ function dumpTabs(title)
+ {
+ var tabbedPane = WebInspector.panels.sources._sourcesView._editorContainer._tabbedPane;
+ var tabs = tabbedPane._tabs;
+ InspectorTest.addResult(title);
+ for (var i = 0; i < tabs.length; ++i) {
+ var text = (i + 1) + ": ";
+ text += tabs[i].title;
+ if (tabs[i] === tabbedPane._currentTab)
+ text += " [selected]";
+ InspectorTest.addResult(" " + text);
+ }
+ }
+};
+</script>
+</head>
+<body onload="runTest()">
+<p>Verify that tabbed editor doesn't shuffle tabs when bindings are dropped and then re-added during reload.</p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698