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

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

Issue 2435043003: DevTools: restore selection and scrollposition between network and filesystem (Closed)
Patch Set: add test + fix scroll event 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-merge-editor-tabs.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-merge-editor-tabs.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-merge-editor-tabs.html
index 424eaf35e061cdbc3910ab28500b37b9ec51cf98..0a95ddefd8f034e93a9e3418979d45912075bda3 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-merge-editor-tabs.html
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-merge-editor-tabs.html
@@ -12,6 +12,7 @@ function test()
{
var fs = new InspectorTest.TestFileSystem("file:///var/www");
var fsEntry = InspectorTest.addFooJSFile(fs);
+ var networkSourceFrame, fileSystemSourceFrame;
InspectorTest.runTestSuite([
function addFileSystem(next)
@@ -19,18 +20,32 @@ function test()
fs.reportCreated(next);
},
- function openEditorTabs(next)
+ function openNetworkTab(next)
{
- var promises = [
- InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectTypes.Network)
- .then(code => InspectorTest.showUISourceCode(code)),
- InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectTypes.FileSystem)
- .then(code => InspectorTest.showUISourceCode(code))
- ];
- Promise.all(promises).then(onTabsOpened);
+ InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectTypes.Network)
+ .then(code => InspectorTest.showUISourceCodePromise(code))
+ .then(onNetworkTab);
- function onTabsOpened()
+ function onNetworkTab(sourceFrame)
{
+ networkSourceFrame = sourceFrame;
+ dumpSourceFrame(networkSourceFrame);
+ next();
+ }
+ },
+
+ function openFileSystemTab(next)
+ {
+ InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectTypes.FileSystem)
+ .then(code => InspectorTest.showUISourceCodePromise(code))
+ .then(onFileSystemTab);
+
+ function onFileSystemTab(sourceFrame)
+ {
+ fileSystemSourceFrame = sourceFrame;
+ fileSystemSourceFrame.setSelection(new WebInspector.TextRange(2, 0, 2, 5));
+ fileSystemSourceFrame.scrollToLine(2);
+ dumpSourceFrame(fileSystemSourceFrame);
dumpEditorTabs();
next();
}
@@ -41,9 +56,10 @@ function test()
InspectorTest.waitForBinding("foo.js").then(onBindingCreated);
WebInspector.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/");
- function onBindingCreated(binding)
+ function onBindingCreated()
{
dumpEditorTabs();
+ dumpSourceFrame(networkSourceFrame);
next();
}
},
@@ -60,6 +76,7 @@ function test()
return
WebInspector.persistence.removeEventListener(WebInspector.Persistence.Events.BindingRemoved, onBindingRemoved);
dumpEditorTabs();
+ dumpSourceFrame(networkSourceFrame);
next();
}
},
@@ -74,6 +91,13 @@ function test()
for (code of openedUISourceCodes)
InspectorTest.addResult(" " + code.url());
}
+
+ function dumpSourceFrame(sourceFrame)
+ {
+ InspectorTest.addResult("SourceFrame: " + sourceFrame._url);
+ InspectorTest.addResult(" selection: " + sourceFrame.selection());
+ InspectorTest.addResult(" firstVisibleLine: " + sourceFrame.textEditor.firstVisibleLine());
+ }
};
</script>
</head>

Powered by Google App Engine
This is Rietveld 408576698