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 var scriptUrl = "timeline-network-resource.js"; | 7 var scriptUrl = "timeline-network-resource.js"; |
8 | 8 |
9 function performActions() | 9 function performActions(callback) |
10 { | 10 { |
11 window.timelineNetworkResourceEvaluated = callback; | |
yurys
2014/07/17 10:42:24
Add a comment that it is called from timeline-netw
| |
11 var script = document.createElement("script"); | 12 var script = document.createElement("script"); |
12 script.src = scriptUrl; | 13 script.src = scriptUrl; |
13 document.body.appendChild(script); | 14 document.body.appendChild(script); |
14 } | 15 } |
15 | 16 |
16 function test() | 17 function test() |
17 { | 18 { |
18 var requestId; | 19 var requestId; |
19 var scriptUrl = "timeline-network-resource.js"; | 20 var scriptUrl = "timeline-network-resource.js"; |
20 | 21 |
21 var model = WebInspector.panels.timeline._model; | 22 var model = WebInspector.panels.timeline._model; |
22 var presentationModel = InspectorTest.timelinePresentationModel(); | 23 var presentationModel = InspectorTest.timelinePresentationModel(); |
23 | 24 |
24 InspectorTest.startTimeline(step1); | 25 InspectorTest.invokeAsyncWithTimeline("performActions", finish); |
25 | 26 |
26 function step1() | 27 function finish() |
27 { | |
28 InspectorTest.evaluateInPage("performActions()"); | |
29 } | |
30 | |
31 // It will be called from timeline-network-resource.js script by evaluateInW ebInspector call. | |
32 InspectorTest.scriptEvaluated = function() | |
33 { | |
34 InspectorTest.stopTimeline(step3); | |
35 } | |
36 | |
37 function step3() | |
38 { | 28 { |
39 var lastRecordStartTime; | 29 var lastRecordStartTime; |
40 function format(record) | 30 function format(record) |
41 { | 31 { |
42 if (record.type() === WebInspector.TimelineModel.RecordType.Resource SendRequest) | 32 if (record.type() === WebInspector.TimelineModel.RecordType.Resource SendRequest) |
43 printSend(record._record); | 33 printSend(record._record); |
44 else if (record.type() === WebInspector.TimelineModel.RecordType.Res ourceReceiveResponse) | 34 else if (record.type() === WebInspector.TimelineModel.RecordType.Res ourceReceiveResponse) |
45 printReceive(record._record); | 35 printReceive(record._record); |
46 else if (record.type() === WebInspector.TimelineModel.RecordType.Res ourceFinish) | 36 else if (record.type() === WebInspector.TimelineModel.RecordType.Res ourceFinish) |
47 printFinish(record._record); | 37 printFinish(record._record); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 | 83 |
94 </script> | 84 </script> |
95 </head> | 85 </head> |
96 | 86 |
97 <body onload="runTest()"> | 87 <body onload="runTest()"> |
98 <p> | 88 <p> |
99 Tests the Timeline API instrumentation of a network resource load | 89 Tests the Timeline API instrumentation of a network resource load |
100 </p> | 90 </p> |
101 </body> | 91 </body> |
102 </html> | 92 </html> |
OLD | NEW |