| Index: third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-switch-editor-tab.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-switch-editor-tab.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-switch-editor-tab.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..12bc769c4d88526bc3698678c9159b6253d209c9
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-switch-editor-tab.html
|
| @@ -0,0 +1,57 @@
|
| +<html>
|
| +<head>
|
| +<script src="../inspector-test.js"></script>
|
| +<script src="../debugger-test.js"></script>
|
| +<script src="../isolated-filesystem-test.js"></script>
|
| +<script src="./persistence-test.js"></script>
|
| +<script src="./resources/foo.js"></script>
|
| +<script>
|
| +
|
| +function test()
|
| +{
|
| + InspectorTest.runTestSuite([
|
| + function openNetworkTab(next)
|
| + {
|
| + InspectorTest.waitForUISourceCode("foo.js", Workspace.projectTypes.Network)
|
| + .then(sourceCode => InspectorTest.showUISourceCodePromise(sourceCode))
|
| + .then(onSourceFrame);
|
| +
|
| + function onSourceFrame(sourceFrame)
|
| + {
|
| + dumpEditorTabs();
|
| + next();
|
| + }
|
| + },
|
| +
|
| + function addMapping(next)
|
| + {
|
| + var fs = new InspectorTest.TestFileSystem("file:///var/www");
|
| + fs.addFileMapping("http://127.0.0.1:8000", "/");
|
| + InspectorTest.addFooJSFile(fs);
|
| + fs.reportCreated(function() { });
|
| + InspectorTest.waitForBinding("foo.js").then(onBindingCreated);
|
| +
|
| + function onBindingCreated()
|
| + {
|
| + dumpEditorTabs();
|
| + next();
|
| + }
|
| + },
|
| + ]);
|
| +
|
| + function dumpEditorTabs()
|
| + {
|
| + var editorContainer = UI.panels.sources._sourcesView._editorContainer;
|
| + var openedUISourceCodes = editorContainer._tabIds.keysArray();
|
| + openedUISourceCodes.sort((a, b) => a.url().compareTo(b.url()));
|
| + InspectorTest.addResult("Opened tabs: ");
|
| + for (code of openedUISourceCodes)
|
| + InspectorTest.addResult(" " + code.url());
|
| + }
|
| +};
|
| +</script>
|
| +</head>
|
| +<body onload="runTest()">
|
| +<p>Verify that a network file tab gets substituted with filesystem tab when persistence binding comes.</p>
|
| +</body>
|
| +</html>
|
|
|