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

Unified Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-model.html

Issue 1609973002: DevTools: promisify ContentProvider.requestContent and all its clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 11 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/inspector/sources/debugger-ui/script-snippet-model.html
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-model.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-model.html
index be4686bb3c28d60e25aed074e8987129e0856d31..1786ee9810e18a71d65b8967d0a1c2df62f23111 100644
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-model.html
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-model.html
@@ -89,22 +89,32 @@ function test()
}
resetSnippetsSettings();
-
+
WebInspector.scriptSnippetModel.project().createFile("", null, "", step2.bind(this));
-
+
function step2(uiSourceCode)
{
uiSourceCode1 = uiSourceCode;
-
- uiSourceCode1.requestContent(contentCallback);
- uiSourceCode1.addRevision("<snippet content>");
- InspectorTest.addResult("Snippet content set.");
- delete uiSourceCode1._content;
- delete uiSourceCode1._contentLoaded;
- uiSourceCode1.requestContent(contentCallback);
- InspectorTest.addResult("Snippet1 created.");
- WebInspector.scriptSnippetModel.project().createFile("", null, "", step3.bind(this));
+ uiSourceCode1.requestContent().then(contentCallback)
+ .then(contentDumped1);
+
+ function contentDumped1()
+ {
+ uiSourceCode1.addRevision("<snippet content>");
+ InspectorTest.addResult("Snippet content set.");
+ delete uiSourceCode1._content;
+ delete uiSourceCode1._contentLoaded;
+ uiSourceCode1.requestContent()
+ .then(contentCallback)
+ .then(contentDumped2)
+ }
+
+ function contentDumped2()
+ {
+ InspectorTest.addResult("Snippet1 created.");
+ WebInspector.scriptSnippetModel.project().createFile("", null, "", step3.bind(this));
+ }
}
function step3(uiSourceCode)
@@ -119,12 +129,16 @@ function test()
renameSnippetAndCheckWorkspace(uiSourceCode2, "foo");
delete uiSourceCode1._content;
delete uiSourceCode1._contentLoaded;
- uiSourceCode1.requestContent(contentCallback);
-
- WebInspector.scriptSnippetModel.project().deleteFile(uiSourceCode1.url());
- WebInspector.scriptSnippetModel.project().deleteFile(uiSourceCode2.url());
+ uiSourceCode1.requestContent()
+ .then(contentCallback)
+ .then(onContentDumped);
- WebInspector.scriptSnippetModel.project().createFile("", null, "", step4.bind(this));
+ function onContentDumped()
+ {
+ WebInspector.scriptSnippetModel.project().deleteFile(uiSourceCode1.url());
+ WebInspector.scriptSnippetModel.project().deleteFile(uiSourceCode2.url());
+ WebInspector.scriptSnippetModel.project().createFile("", null, "", step4.bind(this));
+ }
}
function step4(uiSourceCode)

Powered by Google App Engine
This is Rietveld 408576698