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

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

Issue 299443016: DevTools: Decouple debugger model from UI entities (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merge DebuggerScriptMapping into DebuggerWorkspaceBinding Created 6 years, 5 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: LayoutTests/http/tests/inspector/debugger-test.js
diff --git a/LayoutTests/http/tests/inspector/debugger-test.js b/LayoutTests/http/tests/inspector/debugger-test.js
index 758dbb69c9dfac66baabba1bdda0729e1dacc500..19db525ac39f0a754ba56ba4aaa3ecc5c5d2202c 100644
--- a/LayoutTests/http/tests/inspector/debugger-test.js
+++ b/LayoutTests/http/tests/inspector/debugger-test.js
@@ -416,20 +416,23 @@ InspectorTest.queryScripts = function(filter)
return scripts;
};
-InspectorTest.createScriptMock = function(url, startLine, startColumn, isContentScript, source)
+InspectorTest.createScriptMock = function(url, startLine, startColumn, isContentScript, source, target, preRegisterCallback)
{
+ target = target || WebInspector.targetManager.mainTarget();
var scriptId = ++InspectorTest._lastScriptId;
var lineCount = source.lineEndings().length;
var endLine = startLine + lineCount - 1;
var endColumn = lineCount === 1 ? startColumn + source.length : source.length - source.lineEndings()[lineCount - 2];
var hasSourceURL = !!source.match(/\/\/#\ssourceURL=\s*(\S*?)\s*$/m) || !!source.match(/\/\/@\ssourceURL=\s*(\S*?)\s*$/m);
- var script = new WebInspector.Script(WebInspector.targetManager.mainTarget(), scriptId, url, startLine, startColumn, endLine, endColumn, isContentScript, null, hasSourceURL);
+ var script = new WebInspector.Script(target, scriptId, url, startLine, startColumn, endLine, endColumn, isContentScript, null, hasSourceURL);
script.requestContent = function(callback)
{
var trimmedSource = WebInspector.Script._trimSourceURLComment(source);
callback(trimmedSource, false, "text/javascript");
};
- WebInspector.debuggerModel._registerScript(script);
+ if (preRegisterCallback)
+ preRegisterCallback(script);
+ target.debuggerModel._registerScript(script);
return script;
};

Powered by Google App Engine
This is Rietveld 408576698