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, startTimeline); | |
27 | |
28 function startTimeline() | |
29 { | |
30 InspectorTest.invokeAsyncWithTimeline("performActions", finish); | |
31 } | |
32 | |
33 var linkifier = new WebInspector.Linkifier(); | |
34 | |
35 var recordTypes = new Set(["TimerInstall", "TimerRemove", "FunctionCall"]); | |
36 function formatter(event) | |
37 { | |
38 if (!recordTypes.has(event.name)) | |
39 return; | |
40 | |
41 var detailsText = WebInspector.TimelineUIUtils.buildDetailsTextForTraceE
vent(event, InspectorTest.timelineModel().target()); | |
42 InspectorTest.addResult("detailsTextContent for " + event.name + " event
: '" + detailsText + "'"); | |
43 | |
44 var details = WebInspector.TimelineUIUtils.buildDetailsNodeForTraceEvent
(event, InspectorTest.timelineModel().target(), linkifier); | |
45 if (!details) | |
46 return; | |
47 InspectorTest.addResult("details.textContent for " + event.name + " even
t: '" + details.textContent.replace(/VM[\d]+/, "VM") + "'"); | |
48 } | |
49 | |
50 function finish() | |
51 { | |
52 InspectorTest.walkTimelineEventTree(formatter); | |
53 InspectorTest.completeTest(); | |
54 } | |
55 } | |
56 | |
57 if (!window.testRunner) | |
58 setTimeout(performActions, 2000); | |
59 | |
60 </script> | |
61 </head> | |
62 | |
63 <body onload="runTest()"> | |
64 <p> | |
65 Test that checks location resolving mechanics for TimerInstall TimerRemove and F
unctionCall events with scriptId. | |
66 </p><p> | |
67 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. | |
68 </p> | |
69 </body> | |
70 </html> | |
OLD | NEW |