| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 var scriptCandidate = scripts[scriptId]; | 48 var scriptCandidate = scripts[scriptId]; |
| 49 if (scriptCandidate.sourceURL === InspectorTest.mainTarget.inspected
URL() && scriptCandidate.lineOffset === 4) { | 49 if (scriptCandidate.sourceURL === InspectorTest.mainTarget.inspected
URL() && scriptCandidate.lineOffset === 4) { |
| 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('.devtools-link'); |
| 59 InspectorTest.addResult("The string \"" + linkifyMe + " \" linkifies to
url: " + anchor.href); | |
| 60 var info = Components.Linkifier._linkInfo(anchor); | 59 var info = Components.Linkifier._linkInfo(anchor); |
| 60 InspectorTest.addResult("The string \"" + linkifyMe + " \" linkifies to
url: " + (info && info.url)); |
| 61 InspectorTest.addResult("The lineNumber is " + (info && info.lineNumber)
); | 61 InspectorTest.addResult("The lineNumber is " + (info && info.lineNumber)
); |
| 62 InspectorTest.addResult("The columnNumber is " + (info && info.columnNum
ber)); | 62 InspectorTest.addResult("The columnNumber is " + (info && info.columnNum
ber)); |
| 63 | 63 |
| 64 linkifier = new Components.Linkifier(); | 64 linkifier = new Components.Linkifier(); |
| 65 var count1 = liveLocationsCount(); | 65 var count1 = liveLocationsCount(); |
| 66 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"); |
| 67 var count2 = liveLocationsCount(); | 67 var count2 = liveLocationsCount(); |
| 68 | 68 |
| 69 InspectorTest.addResult("listeners added on raw source code: " + (count2
- count1)); | 69 InspectorTest.addResult("listeners added on raw source code: " + (count2
- count1)); |
| 70 InspectorTest.addResult("original location: " + link.textContent); | 70 InspectorTest.addResult("original location: " + link.textContent); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 96 </script> | 96 </script> |
| 97 </head> | 97 </head> |
| 98 | 98 |
| 99 <body onload="onload()"> | 99 <body onload="onload()"> |
| 100 <p> | 100 <p> |
| 101 Tests that Linkifier works correctly. | 101 Tests that Linkifier works correctly. |
| 102 <p> | 102 <p> |
| 103 | 103 |
| 104 </body> | 104 </body> |
| 105 </html> | 105 </html> |
| OLD | NEW |