| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 script = scriptCandidate; | 50 script = scriptCandidate; |
| 51 break; | 51 break; |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 | 54 |
| 55 uiSourceCode = Workspace.workspace.uiSourceCodeForURL(InspectorTest.main
Target.inspectedURL()); | 55 uiSourceCode = Workspace.workspace.uiSourceCodeForURL(InspectorTest.main
Target.inspectedURL()); |
| 56 var linkifyMe = "at triggerError (http://localhost/show/:22:11)"; | 56 var linkifyMe = "at triggerError (http://localhost/show/:22:11)"; |
| 57 var fragment = Components.linkifyStringAsFragment(linkifyMe); | 57 var fragment = Components.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 var info = Components.Linkifier._linkInfo(anchor); |
| 61 InspectorTest.addResult("The columnNumber is " + anchor.columnNumber + "
with type " + (typeof anchor.columnNumber)); | 61 InspectorTest.addResult("The lineNumber is " + (info && info.lineNumber)
); |
| 62 InspectorTest.addResult("The columnNumber is " + (info && info.columnNum
ber)); |
| 62 | 63 |
| 63 linkifier = new Components.Linkifier(); | 64 linkifier = new Components.Linkifier(); |
| 64 var count1 = liveLocationsCount(); | 65 var count1 = liveLocationsCount(); |
| 65 link = linkifier.linkifyScriptLocation(SDK.targetManager.mainTarget(), n
ull, InspectorTest.mainTarget.inspectedURL(), 8, 0, "dummy-class"); | 66 link = linkifier.linkifyScriptLocation(SDK.targetManager.mainTarget(), n
ull, InspectorTest.mainTarget.inspectedURL(), 8, 0, "dummy-class"); |
| 66 var count2 = liveLocationsCount(); | 67 var count2 = liveLocationsCount(); |
| 67 | 68 |
| 68 InspectorTest.addResult("listeners added on raw source code: " + (count2
- count1)); | 69 InspectorTest.addResult("listeners added on raw source code: " + (count2
- count1)); |
| 69 InspectorTest.addResult("original location: " + link.textContent); | 70 InspectorTest.addResult("original location: " + link.textContent); |
| 70 InspectorTest.addSniffer(Sources.ScriptFormatterEditorAction.prototype,
"_updateButton", uiSourceCodeScriptFormatted); | 71 InspectorTest.addSniffer(Sources.ScriptFormatterEditorAction.prototype,
"_updateButton", uiSourceCodeScriptFormatted); |
| 71 scriptFormatter._toggleFormatScriptSource(); | 72 scriptFormatter._toggleFormatScriptSource(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 95 </script> | 96 </script> |
| 96 </head> | 97 </head> |
| 97 | 98 |
| 98 <body onload="onload()"> | 99 <body onload="onload()"> |
| 99 <p> | 100 <p> |
| 100 Tests that Linkifier works correctly. | 101 Tests that Linkifier works correctly. |
| 101 <p> | 102 <p> |
| 102 | 103 |
| 103 </body> | 104 </body> |
| 104 </html> | 105 </html> |
| OLD | NEW |