Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / sources / debugger / linkifier.html
index c2f848f..1209cfd 100644 (file)
@@ -14,7 +14,8 @@ function dummyScript()
 function test()
 {
     InspectorTest.startDebuggerTest(waitForScripts);
-
+    var panel = WebInspector.inspectorView.panel("sources");
+    var scriptFormatter = InspectorTest.scriptFormatter();
     var linkifier;
     var link;
     var script;
@@ -30,13 +31,13 @@ function test()
         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');
@@ -46,25 +47,19 @@ function test()
 
         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();