OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <script src="../../http/tests/inspector/inspector-test.js"></script> | |
4 <script src="../../http/tests/inspector/timeline-test.js"></script> | |
5 <script> | |
6 | |
7 function test() | |
8 { | |
9 function performActions(callback) | |
10 { | |
11 var timerOne = setTimeout("1 + 1", 10); | |
12 var timerTwo = setInterval(intervalTimerWork, 20); | |
13 var iteration = 0; | |
14 | |
15 function intervalTimerWork() | |
16 { | |
17 if (++iteration < 2) | |
18 return; | |
19 clearInterval(timerTwo); | |
20 callback(); | |
21 } | |
22 } | |
23 | |
24 var source = performActions.toString(); | |
25 source += "\n//@ sourceURL=performActions.js"; | |
26 InspectorTest.evaluateInPage(source); | |
27 | |
28 InspectorTest.invokeAsyncWithTimeline("performActions", finish); | |
29 | |
30 var linkifier = new WebInspector.Linkifier(); | |
31 | |
32 var recordTypes = ["TimerInstall", "TimerRemove", "FunctionCall"]; | |
33 function formatter(record) | |
34 { | |
35 if (recordTypes.indexOf(record.type()) === -1) | |
36 return; | |
37 | |
38 var details = WebInspector.TimelineUIUtilsImpl.buildDetailsNode(record,
linkifier, false); | |
39 if (details) | |
40 InspectorTest.addResult("details.textContent for " + record.type() +
" event: '" + details.textContent + "'"); | |
41 } | |
42 | |
43 function finish() | |
44 { | |
45 InspectorTest.printTimelinePresentationRecords(null, formatter); | |
46 InspectorTest.completeTest(); | |
47 } | |
48 } | |
49 | |
50 if (!window.testRunner) | |
51 setTimeout(performActions, 2000); | |
52 | |
53 </script> | |
54 </head> | |
55 | |
56 <body onload="runTest()"> | |
57 <p> | |
58 Test that checks location resolving mechanics for TimerInstall TimerRemove and F
unctionCall events with scriptId. | |
59 </p><p> | |
60 It expects two FunctionCall for InjectedScript, two TimerInstall events, two Fun
ctionCall events and one TimerRemove event to be logged with performActions.js s
cript name and some line number. | |
61 </p> | |
62 </body> | |
63 </html> | |
OLD | NEW |