blob: 6211391b4d851454203f6f705fdd480ce950a89c [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();
var fs = new InspectorTest.TestFileSystem("file:///var/www");
var fsEntry = InspectorTest.addFooJSFile(fs);
fs.reportCreated(function() { });
testMapping.addBinding("foo.js");
InspectorTest.waitForBinding("foo.js").then(onBindingCreated);
function onBindingCreated(binding)
{
InspectorTest.addResult("Binding created: " + binding);
dumpEditorTabs("Opened tabs before opening any UISourceCodes:");
InspectorTest.addResult("request open uiSourceCode: " + binding.fileSystem.url());
UI.panels.sources.showUISourceCode(binding.network, 0, 0);
dumpEditorTabs("Opened tabs after opening UISourceCode:");
InspectorTest.completeTest();
}
function dumpEditorTabs(title)
{
var editorContainer = UI.panels.sources._sourcesView._editorContainer;
var openedUISourceCodes = editorContainer._tabIds.keysArray();
openedUISourceCodes.sort((a, b) => a.url().compareTo(b.url()));
InspectorTest.addResult(title);
for (code of openedUISourceCodes)
InspectorTest.addResult(" " + code.url());
}
};
</script>
</head>
<body onload="runTest()">
<p>Verify that for a fileSystem UISourceCode with persistence binding TabbedEditorContainer opens filesystem UISourceCode.</p>
</body>
</html>