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/timeline-test.js"></script> | 4 <script src="../../http/tests/inspector/timeline-test.js"></script> |
5 <script> | 5 <script> |
6 | 6 |
7 function test() | 7 function test() |
8 { | 8 { |
9 function performActions() | 9 function performActions(callback) |
10 { | 10 { |
11 var timerOne = setTimeout("1 + 1", 10); | 11 var timerOne = setTimeout("1 + 1", 10); |
12 var timerTwo = setInterval(intervalTimerWork, 20); | 12 var timerTwo = setInterval(intervalTimerWork, 20); |
13 var iteration = 0; | 13 var iteration = 0; |
14 | 14 |
15 function intervalTimerWork() | 15 function intervalTimerWork() |
16 { | 16 { |
17 if (++iteration < 2) | 17 if (++iteration < 2) |
18 return; | 18 return; |
19 clearInterval(timerTwo); | 19 clearInterval(timerTwo); |
| 20 callback(); |
20 } | 21 } |
21 } | 22 } |
22 | 23 |
23 InspectorTest.startTimeline(function() { | 24 var source = performActions.toString(); |
24 var source = performActions.toString(); | 25 source += "\n//@ sourceURL=performActions.js"; |
25 source += "\n" + | 26 InspectorTest.evaluateInPage(source); |
26 "performActions();\n" + | |
27 "//@ sourceURL=performActions.js"; | |
28 InspectorTest.evaluateInPage(source); | |
29 }); | |
30 | 27 |
31 InspectorTest.waitForRecordType("TimerRemove", finish); | 28 InspectorTest.invokeAsyncWithTimeline("performActions", finish); |
32 | 29 |
33 var linkifier = new WebInspector.Linkifier(); | 30 var linkifier = new WebInspector.Linkifier(); |
34 | 31 |
35 var recordTypes = ["TimerInstall", "TimerRemove", "FunctionCall"]; | 32 var recordTypes = ["TimerInstall", "TimerRemove", "FunctionCall"]; |
36 function formatter(record) | 33 function formatter(record) |
37 { | 34 { |
38 if (recordTypes.indexOf(record.type()) === -1) | 35 if (recordTypes.indexOf(record.type()) === -1) |
39 return; | 36 return; |
40 | 37 |
41 var details = WebInspector.TimelineUIUtilsImpl.buildDetailsNode(record,
linkifier, false); | 38 var details = WebInspector.TimelineUIUtilsImpl.buildDetailsNode(record,
linkifier, false); |
(...skipping 15 matching lines...) Expand all Loading... |
57 </head> | 54 </head> |
58 | 55 |
59 <body onload="runTest()"> | 56 <body onload="runTest()"> |
60 <p> | 57 <p> |
61 Test that checks location resolving mechanics for TimerInstall TimerRemove and F
unctionCall events with scriptId. | 58 Test that checks location resolving mechanics for TimerInstall TimerRemove and F
unctionCall events with scriptId. |
62 </p><p> | 59 </p><p> |
63 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. | 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. |
64 </p> | 61 </p> |
65 </body> | 62 </body> |
66 </html> | 63 </html> |
OLD | NEW |