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

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 testcase 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-merge-editor-tabs-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..1c91eba75ed231fc60caa9071b134db97f7eb10b 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,38 @@ 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(onFileSystemSourceCode)
+ .then(onFileSystemTab);
+
+ function onFileSystemSourceCode(code)
+ {
+ code.setWorkingCopy("\n\nwindow.foo = ()=>'foo2';");
+ return InspectorTest.showUISourceCodePromise(code);
+ }
+
+ function onFileSystemTab(sourceFrame)
+ {
+ fileSystemSourceFrame = sourceFrame;
+ fileSystemSourceFrame.setSelection(new WebInspector.TextRange(2, 0, 2, 5));
+ fileSystemSourceFrame.scrollToLine(2);
+ dumpSourceFrame(fileSystemSourceFrame);
dumpEditorTabs();
next();
}
@@ -41,9 +62,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 +82,7 @@ function test()
return
WebInspector.persistence.removeEventListener(WebInspector.Persistence.Events.BindingRemoved, onBindingRemoved);
dumpEditorTabs();
+ dumpSourceFrame(networkSourceFrame);
next();
}
},
@@ -74,6 +97,14 @@ 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());
+ InspectorTest.addResult(" isDirty: " + sourceFrame.uiSourceCode().isDirty());
+ }
};
</script>
</head>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-merge-editor-tabs-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698