3 <script src=
"../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../http/tests/inspector/debugger-test.js"></script>
10 InspectorTest
.startDebuggerTest(waitForScripts
);
12 function waitForScripts()
14 InspectorTest
.showScriptSource("linkifier.html", debuggerTest
);
17 function debuggerTest()
19 var url
= InspectorTest
.resourceTreeModel
.inspectedPageURL();
20 var target
= WebInspector
.targetManager
.mainTarget();
21 var scripts
= InspectorTest
.debuggerModel
.scripts
;
22 for (var scriptId
in scripts
) {
23 var scriptCandidate
= scripts
[scriptId
];
24 if (scriptCandidate
.sourceURL
=== url
) {
25 script
= scriptCandidate
;
30 dumpLiveLocationsCount();
32 var linkifier
= new WebInspector
.Linkifier();
33 InspectorTest
.addResult("Created linkifier");
34 dumpLiveLocationsCount();
36 var linkA
= linkifier
.linkifyScriptLocation(target
, null, url
, 10);
37 InspectorTest
.addResult("Linkified script location A");
38 dumpLiveLocationsCount();
40 var linkB
= linkifier
.linkifyScriptLocation(target
, null, url
, 15);
41 InspectorTest
.addResult("Linkified script location B");
42 dumpLiveLocationsCount();
44 linkifier
.disposeAnchor(target
, linkA
);
45 InspectorTest
.addResult("Disposed link A");
46 dumpLiveLocationsCount();
49 InspectorTest
.addResult("Reseted linkifier");
50 dumpLiveLocationsCount();
53 InspectorTest
.addResult("Disposed linkifier");
54 dumpLiveLocationsCount();
56 InspectorTest
.completeTest();
59 function dumpLiveLocationsCount()
61 InspectorTest
.addResult("Live locations count: " + WebInspector
.debuggerWorkspaceBinding
._ensureInfoForScript(script
)._locations
.size
);
62 InspectorTest
.addResult("");
69 <body onload=
"runTest()">
71 Tests that Linkifier works correctly.