blob: 142f145efa8e2c40926ce310582d7a8faf330c11 [file] [log] [blame]
<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()
{
var testMapping = InspectorTest.initializeTestMapping();
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");
InspectorTest.addFooJSFile(fs);
fs.reportCreated(function() { });
testMapping.addBinding("foo.js");
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>