{
if (quiet !== undefined)
InspectorTest._quiet = quiet;
- WebInspector.showPanel("sources");
+ WebInspector.inspectorView.showPanel("sources");
if (WebInspector.debuggerModel.debuggerEnabled())
startTest();
function step2()
{
- InspectorTest.runTestFunctionAndWaitUntilPaused(didPaused);
+ InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
}
var step = 0;
var callStacksOutput = [];
- function didPaused(callFrames, reason, breakpointIds, asyncStackTrace)
+ function didPause(callFrames, reason, breakpointIds, asyncStackTrace)
{
++step;
callStacksOutput.push(InspectorTest.captureStackTraceIntoString(callFrames, asyncStackTrace) + "\n");
if (step < totalDebuggerStatements) {
- InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(InspectorTest, didPaused));
+ InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(InspectorTest, didPause));
} else {
InspectorTest.addResult("Captured call stacks in no particular order:");
callStacksOutput.sort();
InspectorTest.resumeExecution = function(callback)
{
if (WebInspector.panels.sources.paused)
- WebInspector.panels.sources._togglePause();
+ WebInspector.panels.sources.togglePause();
InspectorTest.waitUntilResumed(callback);
};
{
for (var i = 0; i < callFrames.length; i++) {
var frame = callFrames[i];
- var script = WebInspector.debuggerModel.scriptForId(frame.location.scriptId);
+ var script = WebInspector.debuggerModel.scriptForId(frame.location().scriptId);
var url;
var lineNumber;
if (script) {
url = WebInspector.displayNameForURL(script.sourceURL);
- lineNumber = frame.location.lineNumber + 1;
+ lineNumber = frame.location().lineNumber + 1;
} else {
url = "(internal script)";
lineNumber = "(line number)";
}
var s = " " + i + ") " + frame.functionName + " (" + url + (options.dropLineNumbers ? "" : ":" + lineNumber) + ")";
results.push(s);
- if (options.printReturnValue && frame.returnValue)
- results.push(" <return>: " + frame.returnValue.description);
+ if (options.printReturnValue && frame.returnValue())
+ results.push(" <return>: " + frame.returnValue().description);
}
}
while (asyncStackTrace) {
results.push(" [" + (asyncStackTrace.description || "Async Call") + "]");
- printCallFrames(asyncStackTrace.callFrames);
+ printCallFrames(WebInspector.DebuggerModel.CallFrame.fromPayloadArray(WebInspector.targetManager.activeTarget(), asyncStackTrace.callFrames));
if (asyncStackTrace.callFrames.peekLast().functionName === "testFunction")
break;
asyncStackTrace = asyncStackTrace.asyncStackTrace;
{
if (!InspectorTest._quiet)
InspectorTest.addResult("Script execution paused.");
- InspectorTest._pausedScriptArguments = [callFrames, reason, breakpointIds, asyncStackTrace];
+ InspectorTest._pausedScriptArguments = [WebInspector.DebuggerModel.CallFrame.fromPayloadArray(WebInspector.targetManager.activeTarget(), callFrames), reason, breakpointIds, asyncStackTrace];
if (InspectorTest._waitUntilPausedCallback) {
var callback = InspectorTest._waitUntilPausedCallback;
delete InspectorTest._waitUntilPausedCallback;
InspectorTest.showUISourceCode = function(uiSourceCode, callback)
{
- var panel = WebInspector.showPanel("sources");
+ var panel = WebInspector.inspectorView.showPanel("sources");
panel.showUISourceCode(uiSourceCode);
var sourceFrame = panel.visibleView;
if (sourceFrame.loaded)
InspectorTest.waitForScriptSource = function(scriptName, callback)
{
- var panel = WebInspector.showPanel("sources");
+ var panel = WebInspector.inspectorView.showPanel("sources");
var uiSourceCodes = panel._workspace.uiSourceCodes();
for (var i = 0; i < uiSourceCodes.length; ++i) {
if (uiSourceCodes[i].name() === scriptName) {
}
}
- InspectorTest.addSniffer(WebInspector.SourcesPanel.prototype, "_addUISourceCode", InspectorTest.waitForScriptSource.bind(InspectorTest, scriptName, callback));
+ InspectorTest.addSniffer(WebInspector.SourcesView.prototype, "_addUISourceCode", InspectorTest.waitForScriptSource.bind(InspectorTest, scriptName, callback));
};
-InspectorTest.dumpScriptsNavigator = function(navigator, prefix)
+InspectorTest.dumpNavigatorView = function(navigatorView, id, prefix)
{
- prefix = prefix || "";
- InspectorTest.addResult(prefix + "Dumping ScriptsNavigator 'Scripts' tab:");
- dumpNavigatorTreeOutline(prefix, navigator._sourcesView._scriptsTree);
- InspectorTest.addResult(prefix + "Dumping ScriptsNavigator 'Content scripts' tab:");
- dumpNavigatorTreeOutline(prefix, navigator._contentScriptsView._scriptsTree);
+ InspectorTest.addResult(prefix + "Dumping ScriptsNavigator " + id + " tab:");
+ dumpNavigatorTreeOutline(prefix, navigatorView._scriptsTree);
function dumpNavigatorTreeElement(prefix, treeElement)
{
for (var i = 0; i < treeOutline.children.length; ++i)
dumpNavigatorTreeElement(prefix + " ", treeOutline.children[i]);
}
- InspectorTest.addResult("");
};
InspectorTest.setBreakpoint = function(sourceFrame, lineNumber, condition, enabled)
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(scriptId, url, startLine, startColumn, endLine, endColumn, isContentScript, null, hasSourceURL);
+ var script = new WebInspector.Script(WebInspector.targetManager.activeTarget(), scriptId, url, startLine, startColumn, endLine, endColumn, isContentScript, null, hasSourceURL);
script.requestContent = function(callback)
{
var trimmedSource = WebInspector.Script._trimSourceURLComment(source);
InspectorTest.assertEquals(columnNumber, location.columnNumber, "Incorrect columnNumber, expected '" + columnNumber + "', but got '" + location.columnNumber + "'");
};
+InspectorTest.scriptFormatter = function()
+{
+ var editorActions = WebInspector.moduleManager.instances(WebInspector.SourcesView.EditorAction);
+ for (var i = 0; i < editorActions.length; ++i) {
+ if (editorActions[i] instanceof WebInspector.ScriptFormatterEditorAction)
+ return editorActions[i];
+ }
+};
+
};