| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../http/tests/inspector/console-test.js"></script> | 4 <script src="../http/tests/inspector/console-test.js"></script> |
| 5 <script src="../http/tests/inspector/workspace-test.js"></script> | |
| 6 <script src="../http/tests/inspector/debugger-test.js"></script> | 5 <script src="../http/tests/inspector/debugger-test.js"></script> |
| 7 <script src="resources/example-fileset-for-test.js"></script> | 6 <script src="resources/example-fileset-for-test.js"></script> |
| 8 <script src="editor/editor-test.js"></script> | 7 <script src="editor/editor-test.js"></script> |
| 9 <script> | 8 <script> |
| 10 function test() | 9 function test() |
| 11 { | 10 { |
| 12 var panel = UI.panels.sources; | 11 var panel = UI.panels.sources; |
| 13 var sourcesView = panel._sourcesView; | 12 var sourcesView = panel._sourcesView; |
| 14 var historyManager = sourcesView._historyManager; | 13 var historyManager = sourcesView._historyManager; |
| 15 var editorContainer = sourcesView._editorContainer; | 14 var editorContainer = sourcesView._editorContainer; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 dumpSelection("Rolled back 4 times"); | 133 dumpSelection("Rolled back 4 times"); |
| 135 editor.editRange(new Common.TextRange(9, 0, 11, 0), ""); | 134 editor.editRange(new Common.TextRange(9, 0, 11, 0), ""); |
| 136 dumpSelection("Removed lines from 9 to 11"); | 135 dumpSelection("Removed lines from 9 to 11"); |
| 137 rollover(); | 136 rollover(); |
| 138 dumpSelection("Rolled over"); | 137 dumpSelection("Rolled over"); |
| 139 next(); | 138 next(); |
| 140 }, | 139 }, |
| 141 | 140 |
| 142 function testCrossFileJump(next) | 141 function testCrossFileJump(next) |
| 143 { | 142 { |
| 144 InspectorTest.showScriptSource("workspace-test.js", onContentLoaded)
; | 143 InspectorTest.showScriptSource("editor-test.js", onContentLoaded); |
| 145 function onContentLoaded() | 144 function onContentLoaded() |
| 146 { | 145 { |
| 147 var editor = panel.visibleView.textEditor; | 146 var editor = panel.visibleView.textEditor; |
| 148 dumpSelection("Opened workspace-test.js"); | 147 dumpSelection("Opened editor-test.js"); |
| 149 clickAndDump(editor, [10, 11], [1, 1]); | 148 clickAndDump(editor, [10, 11], [1, 1]); |
| 150 for (var i = 0; i < 4; ++i) { | 149 for (var i = 0; i < 4; ++i) { |
| 151 rollback(); | 150 rollback(); |
| 152 dumpSelection("Rolled back"); | 151 dumpSelection("Rolled back"); |
| 153 } | 152 } |
| 154 for (var i = 0; i < 4; ++i) { | 153 for (var i = 0; i < 4; ++i) { |
| 155 rollover(); | 154 rollover(); |
| 156 dumpSelection("Rolled over"); | 155 dumpSelection("Rolled over"); |
| 157 } | 156 } |
| 158 next(); | 157 next(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 rollback(); | 209 rollback(); |
| 211 dumpSelection("Rolled back"); | 210 dumpSelection("Rolled back"); |
| 212 rollover(); | 211 rollover(); |
| 213 dumpSelection("Rolled over"); | 212 dumpSelection("Rolled over"); |
| 214 next(); | 213 next(); |
| 215 }, | 214 }, |
| 216 | 215 |
| 217 function testShowAnchorLocation(next) | 216 function testShowAnchorLocation(next) |
| 218 { | 217 { |
| 219 dumpSelection("Before switching to other panel"); | 218 dumpSelection("Before switching to other panel"); |
| 220 InspectorTest.waitForScriptSource("workspace-test.js", onScriptSourc
e); | 219 InspectorTest.waitForScriptSource("editor-test.js", onScriptSource); |
| 221 function onScriptSource(uiSourceCode) | 220 function onScriptSource(uiSourceCode) |
| 222 { | 221 { |
| 223 var linkifier = new Components.Linkifier(); | 222 var linkifier = new Components.Linkifier(); |
| 224 var anchorURI = uiSourceCode.url(); | 223 var anchorURI = uiSourceCode.url(); |
| 225 var anchor = linkifier.linkifyScriptLocation(SDK.targetManager.m
ainTarget(), null, anchorURI, 10, 1); | 224 var anchor = linkifier.linkifyScriptLocation(SDK.targetManager.m
ainTarget(), null, anchorURI, 10, 1); |
| 226 var info = Components.Linkifier._linkInfo(anchor); | 225 var info = Components.Linkifier._linkInfo(anchor); |
| 227 Common.Revealer.revealPromise(info.uiLocation).then(function() { | 226 Common.Revealer.revealPromise(info.uiLocation).then(function() { |
| 228 InspectorTest.addResult("Selection: " + panel.visibleView.te
xtEditor.selection().toString()); | 227 InspectorTest.addResult("Selection: " + panel.visibleView.te
xtEditor.selection().toString()); |
| 229 dumpSelection("Showed anchor in " + anchorURI.split("/").pop
() + " with line 333 column 3"); | 228 dumpSelection("Showed anchor in " + anchorURI.split("/").pop
() + " with line 333 column 3"); |
| 230 rollback(); | 229 rollback(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 258 } | 257 } |
| 259 } | 258 } |
| 260 ]); | 259 ]); |
| 261 }; | 260 }; |
| 262 </script> | 261 </script> |
| 263 </head> | 262 </head> |
| 264 <body onload="runTest()"> | 263 <body onload="runTest()"> |
| 265 <p>Tests that jumping to previous location works as intended.</p> | 264 <p>Tests that jumping to previous location works as intended.</p> |
| 266 </body> | 265 </body> |
| 267 </html> | 266 </html> |
| OLD | NEW |