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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/debugger-test.js

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/http/tests/inspector/debugger-test.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/debugger-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/debugger-test.js
index b3c24ba73f99ef79329324252365c935214d8fbd..f7a82f692a390377577a27bf8f461ee481c859af 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/debugger-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/debugger-test.js
@@ -367,7 +367,12 @@ InspectorTest.showUISourceCode = function(uiSourceCode, callback)
InspectorTest.showScriptSource = function(scriptName, callback)
{
- InspectorTest.waitForScriptSource(scriptName, function(uiSourceCode) { InspectorTest.showUISourceCode(uiSourceCode, callback); });
+ InspectorTest.waitForScriptSource(scriptName, onScriptSource);
+
+ function onScriptSource(uiSourceCode)
+ {
+ InspectorTest.showUISourceCode(uiSourceCode, callback);
+ }
};
InspectorTest.waitForScriptSource = function(scriptName, callback)
@@ -508,10 +513,10 @@ InspectorTest.createScriptMock = function(url, startLine, startColumn, isContent
var endColumn = lineCount === 1 ? startColumn + source.length : source.length - source.lineEndings()[lineCount - 2];
var hasSourceURL = !!source.match(/\/\/#\ssourceURL=\s*(\S*?)\s*$/m);
var script = new WebInspector.Script(debuggerModel, scriptId, url, startLine, startColumn, endLine, endColumn, 0, isContentScript, false, false, undefined, hasSourceURL);
- script.requestContent = function(callback)
+ script.requestContent = function()
{
var trimmedSource = WebInspector.Script._trimSourceURLComment(source);
- callback(trimmedSource, false, "text/javascript");
+ return Promise.resolve(trimmedSource);
};
if (preRegisterCallback)
preRegisterCallback(script);

Powered by Google App Engine
This is Rietveld 408576698