function test()
{
InspectorTest.startDebuggerTest(waitForScripts);
-
+ var panel = WebInspector.inspectorView.panel("sources");
+ var scriptFormatter = InspectorTest.scriptFormatter();
var linkifier;
var link;
var script;
var scripts = WebInspector.debuggerModel.scripts;
for (var scriptId in scripts) {
var scriptCandidate = scripts[scriptId];
- if (scriptCandidate.sourceURL === WebInspector.inspectedPageURL && scriptCandidate.lineOffset === 4) {
+ if (scriptCandidate.sourceURL === WebInspector.resourceTreeModel.inspectedPageURL() && scriptCandidate.lineOffset === 4) {
script = scriptCandidate;
break;
}
}
- uiSourceCode = WebInspector.workspace.uiSourceCodeForOriginURL(WebInspector.inspectedPageURL);
+ uiSourceCode = WebInspector.workspace.uiSourceCodeForOriginURL(WebInspector.resourceTreeModel.inspectedPageURL());
var linkifyMe = "at triggerError (http://localhost/show/:22:11)";
var fragment = WebInspector.linkifyStringAsFragment(linkifyMe);
var anchor = fragment.querySelector('a');
linkifier = new WebInspector.Linkifier();
var count1 = liveLocationsCount();
- link = linkifier.linkifyLocation(WebInspector.inspectedPageURL, 8, 0, "dummy-class");
+ link = linkifier.linkifyLocation(WebInspector.targetManager.activeTarget(), WebInspector.resourceTreeModel.inspectedPageURL(), 8, 0, "dummy-class");
var count2 = liveLocationsCount();
InspectorTest.addResult("listeners added on raw source code: " + (count2 - count1));
InspectorTest.addResult("original location: " + link.textContent);
-
- InspectorTest.addSniffer(linkifier._formatter, "formatLiveAnchor", linkUpdated);
- uiSourceCode.setFormatted(true);
+ InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted);
+ scriptFormatter._toggleFormatScriptSource();
}
- function linkUpdated()
+ function uiSourceCodeScriptFormatted()
{
InspectorTest.addResult("pretty printed location: " + link.textContent);
- InspectorTest.addSniffer(linkifier._formatter, "formatLiveAnchor", linkReverted);
- uiSourceCode.setFormatted(false);
- }
-
- function linkReverted()
- {
+ scriptFormatter._discardFormattedUISourceCodeScript(panel.visibleView.uiSourceCode());
InspectorTest.addResult("reverted location: " + link.textContent);
var count1 = liveLocationsCount();