Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / jump-to-previous-editing-location.html
index 5ac5021..a6b7be1 100644 (file)
@@ -1,6 +1,7 @@
 <html>
 <head>
 <script src="../http/tests/inspector/inspector-test.js"></script>
+<script src="../http/tests/inspector/console-test.js"></script>
 <script src="../http/tests/inspector/workspace-test.js"></script>
 <script src="../http/tests/inspector/debugger-test.js"></script>
 <script src="resources/example-fileset-for-test.js"></script>
@@ -8,17 +9,19 @@
 <script>
 function test()
 {
-    WebInspector.showPanel("sources");
     var panel = WebInspector.panels.sources;
+    var sourcesView = panel._sourcesView;
+    var historyManager = sourcesView._historyManager;
+    var editorContainer = sourcesView._editorContainer;
 
     function rollback()
     {
-        panel._historyManager.rollback();
+        historyManager.rollback();
     }
 
     function rollover()
     {
-        panel._historyManager.rollover();
+        historyManager.rollover();
     }
 
     function dumpSelection(editor, label)
@@ -158,8 +161,8 @@ function test()
 
         function testCloseCrossFile(next)
         {
-            var selectedTab = panel._editorContainer._tabbedPane.selectedTabId;
-            panel._editorContainer._tabbedPane.closeTab(selectedTab);
+            var selectedTab = editorContainer._tabbedPane.selectedTabId;
+            editorContainer._tabbedPane.closeTab(selectedTab);
             dumpSelection(panel.visibleView.textEditor, "Close active tab");
             for (var i = 0; i < 1; ++i) {
                 rollback();
@@ -218,17 +221,17 @@ function test()
             function onScriptSource(uiSourceCode)
             {
                 var linkifier = new WebInspector.Linkifier();
-                WebInspector.showPanel("timeline");
                 var anchorURI = uiSourceCode.url;
-                var anchor = linkifier.linkifyLocation(anchorURI, 10, 1);
-                WebInspector.Revealer.reveal(anchor.__uiLocation);
-                InspectorTest.addResult("Selection: " + panel.visibleView.textEditor.selection().toString());
-                dumpSelection(panel.visibleView.textEditor, "Showed anchor in " + anchorURI.split("/").pop() + " with line 333 column 3");
-                rollback();
-                dumpSelection(panel.visibleView.textEditor, "Rolled back");
-                rollover();
-                dumpSelection(panel.visibleView.textEditor, "Rolled over");
-                next();
+                var anchor = linkifier.linkifyScriptLocation(WebInspector.targetManager.mainTarget(), null, anchorURI, 10, 1);
+                WebInspector.Revealer.revealPromise(anchor.__uiLocation).then(function() {
+                    InspectorTest.addResult("Selection: " + panel.visibleView.textEditor.selection().toString());
+                    dumpSelection(panel.visibleView.textEditor, "Showed anchor in " + anchorURI.split("/").pop() + " with line 333 column 3");
+                    rollback();
+                    dumpSelection(panel.visibleView.textEditor, "Rolled back");
+                    rollover();
+                    dumpSelection(panel.visibleView.textEditor, "Rolled over");
+                    next();
+                });
             }
         },
 
@@ -244,7 +247,7 @@ function test()
                     panel.showUISourceCode(uiSourceCode, jumps[i]);
                     dumpSelection(panel.visibleView.textEditor, "jump to line " + jumps[i]);
                 }
-                panel.highlightPosition(40, 10);
+                panel.showUISourceCode(uiSourceCode, 40, 10);
                 dumpSelection(panel.visibleView.textEditor, "highlight line 40");
                 for (var i = 0; i < jumps.length + 1; ++i) {
                     rollback();