| 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/debugger-test.js"></script> | 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| 5 <script>// It is important that script starts on line 5 (zero-based 4) | 5 <script>// It is important that script starts on line 5 (zero-based 4) |
| 6 | 6 |
| 7 function nonFormattedFunction() { var i = 2 + 2; var a = 4; return a + i; } | 7 function nonFormattedFunction() { var i = 2 + 2; var a = 4; return a + i; } |
| 8 | 8 |
| 9 function dummyScript() | 9 function dummyScript() |
| 10 { | 10 { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 InspectorTest.startDebuggerTest(waitForScripts); | 36 InspectorTest.startDebuggerTest(waitForScripts); |
| 37 } | 37 } |
| 38 | 38 |
| 39 function waitForScripts() | 39 function waitForScripts() |
| 40 { | 40 { |
| 41 InspectorTest.showScriptSource("linkifier.html", debuggerTest); | 41 InspectorTest.showScriptSource("linkifier.html", debuggerTest); |
| 42 } | 42 } |
| 43 | 43 |
| 44 function debuggerTest() | 44 function debuggerTest() |
| 45 { | 45 { |
| 46 var scripts = WebInspector.debuggerModel.scripts; | 46 var scripts = InspectorTest.debuggerModel.scripts; |
| 47 for (var scriptId in scripts) { | 47 for (var scriptId in scripts) { |
| 48 var scriptCandidate = scripts[scriptId]; | 48 var scriptCandidate = scripts[scriptId]; |
| 49 if (scriptCandidate.sourceURL === WebInspector.resourceTreeModel.ins
pectedPageURL() && scriptCandidate.lineOffset === 4) { | 49 if (scriptCandidate.sourceURL === InspectorTest.resourceTreeModel.in
spectedPageURL() && scriptCandidate.lineOffset === 4) { |
| 50 script = scriptCandidate; | 50 script = scriptCandidate; |
| 51 break; | 51 break; |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 | 54 |
| 55 uiSourceCode = WebInspector.workspace.uiSourceCodeForOriginURL(WebInspec
tor.resourceTreeModel.inspectedPageURL()); | 55 uiSourceCode = WebInspector.workspace.uiSourceCodeForOriginURL(Inspector
Test.resourceTreeModel.inspectedPageURL()); |
| 56 var linkifyMe = "at triggerError (http://localhost/show/:22:11)"; | 56 var linkifyMe = "at triggerError (http://localhost/show/:22:11)"; |
| 57 var fragment = WebInspector.linkifyStringAsFragment(linkifyMe); | 57 var fragment = WebInspector.linkifyStringAsFragment(linkifyMe); |
| 58 var anchor = fragment.querySelector('a'); | 58 var anchor = fragment.querySelector('a'); |
| 59 InspectorTest.addResult("The string \"" + linkifyMe + " \" linkifies to
url: " + anchor.href); | 59 InspectorTest.addResult("The string \"" + linkifyMe + " \" linkifies to
url: " + anchor.href); |
| 60 InspectorTest.addResult("The lineNumber is " + anchor.lineNumber + " wit
h type " + (typeof anchor.lineNumber)); | 60 InspectorTest.addResult("The lineNumber is " + anchor.lineNumber + " wit
h type " + (typeof anchor.lineNumber)); |
| 61 InspectorTest.addResult("The columnNumber is " + anchor.columnNumber + "
with type " + (typeof anchor.columnNumber)); | 61 InspectorTest.addResult("The columnNumber is " + anchor.columnNumber + "
with type " + (typeof anchor.columnNumber)); |
| 62 | 62 |
| 63 linkifier = new WebInspector.Linkifier(); | 63 linkifier = new WebInspector.Linkifier(); |
| 64 var count1 = liveLocationsCount(); | 64 var count1 = liveLocationsCount(); |
| 65 link = linkifier.linkifyScriptLocation(WebInspector.targetManager.mainTa
rget(), null, WebInspector.resourceTreeModel.inspectedPageURL(), 8, 0, "dummy-cl
ass"); | 65 link = linkifier.linkifyScriptLocation(WebInspector.targetManager.mainTa
rget(), null, InspectorTest.resourceTreeModel.inspectedPageURL(), 8, 0, "dummy-c
lass"); |
| 66 var count2 = liveLocationsCount(); | 66 var count2 = liveLocationsCount(); |
| 67 | 67 |
| 68 InspectorTest.addResult("listeners added on raw source code: " + (count2
- count1)); | 68 InspectorTest.addResult("listeners added on raw source code: " + (count2
- count1)); |
| 69 InspectorTest.addResult("original location: " + link.textContent); | 69 InspectorTest.addResult("original location: " + link.textContent); |
| 70 InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.protot
ype, "_updateButton", uiSourceCodeScriptFormatted); | 70 InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.protot
ype, "_updateButton", uiSourceCodeScriptFormatted); |
| 71 scriptFormatter._toggleFormatScriptSource(); | 71 scriptFormatter._toggleFormatScriptSource(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 function uiSourceCodeScriptFormatted() | 74 function uiSourceCodeScriptFormatted() |
| 75 { | 75 { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 95 </script> | 95 </script> |
| 96 </head> | 96 </head> |
| 97 | 97 |
| 98 <body onload="onload()"> | 98 <body onload="onload()"> |
| 99 <p> | 99 <p> |
| 100 Tests that Linkifier works correctly. | 100 Tests that Linkifier works correctly. |
| 101 <p> | 101 <p> |
| 102 | 102 |
| 103 </body> | 103 </body> |
| 104 </html> | 104 </html> |
| OLD | NEW |