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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-sync-content-nodejs.html

Issue 2537233003: DevTools: [Persistence] sync working copies of UISourceCodes (Closed)
Patch Set: address comments Created 4 years 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-sync-content-nodejs.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-sync-content-nodejs.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-sync-content-nodejs.html
index 0e07f82af448c5de808ef00e684c9aa8ef2bd543..53350bc4e08ab9c51b8418e8b3efdc384286cf06 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-sync-content-nodejs.html
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-sync-content-nodejs.html
@@ -39,43 +39,71 @@ function test()
fs.addFileMapping("http://127.0.0.1:8000", "/");
fs.reportCreated(function() { });
+ var binding;
InspectorTest.waitForBinding("nodejs.js").then(onBindingCreated);
- function onBindingCreated(binding)
+ function onBindingCreated(theBinding)
{
+ binding = theBinding;
InspectorTest.addResult("Binding created: " + binding);
- editNetworkUISourceCode(binding);
+ InspectorTest.runTestSuite(testSuite);
}
- function editNetworkUISourceCode(binding)
- {
- InspectorTest.addResult("\nRunning: Edit network uiSourceCode");
- nodeContent = nodeContent.replace("//TODO", "network();\n//TODO");
- InspectorTest.addSniffer(Persistence.Persistence.prototype, "_contentSyncedForTest", onSynced);
- binding.network.addRevision(nodeContent);
+ var testSuite = [
+ function addNetworkUISourceCodeRevision(next)
+ {
+ nodeContent = nodeContent.replace("//TODO", "network();\n//TODO");
+ InspectorTest.addSniffer(Persistence.Persistence.prototype, "_contentSyncedForTest", onSynced);
+ binding.network.addRevision(nodeContent);
+
+ function onSynced()
+ {
+ dumpBindingContent();
+ next();
+ }
+ },
- function onSynced()
+ function setNetworkUISourceCodeWorkingCopy(next)
{
- dumpBindingContent(binding);
- changeFileSystem(binding);
- }
- }
+ nodeContent = nodeContent.replace("//TODO", "workingCopy1();\n//TODO");
+ InspectorTest.addSniffer(Persistence.Persistence.prototype, "_contentSyncedForTest", onSynced);
+ binding.network.setWorkingCopy(nodeContent);
- function changeFileSystem(binding)
- {
- InspectorTest.addResult("\nRunning: Edit fileSystem uiSourceCode");
- fsContent = fsContent.replace("//TODO", "filesystem();\n//TODO");
- InspectorTest.addSniffer(Persistence.Persistence.prototype, "_contentSyncedForTest", onSynced);
- fsEntry.setContent(fsContent);
+ function onSynced()
+ {
+ dumpBindingContent();
+ next();
+ }
+ },
- function onSynced()
+ function changeFileSystemFile(next)
{
- dumpBindingContent(binding);
- InspectorTest.completeTest();
- }
- }
+ fsContent = fsContent.replace("//TODO", "filesystem();\n//TODO");
+ InspectorTest.addSniffer(Persistence.Persistence.prototype, "_contentSyncedForTest", onSynced);
+ fsEntry.setContent(fsContent);
+
+ function onSynced()
+ {
+ dumpBindingContent();
+ next();
+ }
+ },
+
+ function setFileSystemUISourceCodeWorkingCopy(next)
+ {
+ nodeContent = fsContent.replace("//TODO", "workingCopy2();\n//TODO");
+ InspectorTest.addSniffer(Persistence.Persistence.prototype, "_contentSyncedForTest", onSynced);
+ binding.fileSystem.setWorkingCopy(nodeContent);
+
+ function onSynced()
+ {
+ dumpBindingContent();
+ next();
+ }
+ },
+ ];
- function dumpBindingContent(binding)
+ function dumpBindingContent()
{
InspectorTest.addResult("Network:");
InspectorTest.addResult(indent(binding.network.workingCopy()));

Powered by Google App Engine
This is Rietveld 408576698