| 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 performActions() | 7 function performActions() |
| 8 { | 8 { |
| 9 var image = new Image(); | 9 var image = new Image(); |
| 10 image.onload = bar; | 10 image.onload = bar; |
| 11 image.src = "resources/anImage.png"; | 11 image.src = "resources/anImage.png"; |
| 12 | 12 |
| 13 function bar() { | 13 function bar() { |
| 14 var image = new Image(); | 14 var image = new Image(); |
| 15 image.onload = function() { testRunner.evaluateInWebInspector(0, "window
.step2()"); } | 15 image.onload = function() { testRunner.evaluateInWebInspector(0, "window
.step2()"); } |
| 16 image.src = "resources/anotherImage.png"; | 16 image.src = "resources/anotherImage.png"; |
| 17 } | 17 } |
| 18 } | 18 } |
| 19 | 19 |
| 20 function test() | 20 function test() |
| 21 { | 21 { |
| 22 WebInspector.inspectorView.showPanel("timeline"); | 22 WebInspector.inspectorView.showPanel("timeline"); |
| 23 WebInspector.panels.timeline._model._collectionEnabled = true; | 23 WebInspector.inspectorView.panel("timeline")._model._collectionEnabled = tru
e; |
| 24 | 24 |
| 25 TimelineAgent.start(step1); | 25 TimelineAgent.start(step1); |
| 26 | 26 |
| 27 function step1() | 27 function step1() |
| 28 { | 28 { |
| 29 InspectorTest.evaluateInPage("performActions()"); | 29 InspectorTest.evaluateInPage("performActions()"); |
| 30 } | 30 } |
| 31 | 31 |
| 32 window.step2 = function() | 32 window.step2 = function() |
| 33 { | 33 { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 45 InspectorTest.addResult(prefix + record.type()); | 45 InspectorTest.addResult(prefix + record.type()); |
| 46 // Ignore stray paint & rendering events for better stability. | 46 // Ignore stray paint & rendering events for better stability. |
| 47 if (record.category().name !== "loading" && record.category().name !
== "scripting") | 47 if (record.category().name !== "loading" && record.category().name !
== "scripting") |
| 48 return; | 48 return; |
| 49 if (presentationRecord.presentationChildren()) { | 49 if (presentationRecord.presentationChildren()) { |
| 50 var childPrefix = prefix + (presentationRecord.coalesced() ? ""
: " "); | 50 var childPrefix = prefix + (presentationRecord.coalesced() ? ""
: " "); |
| 51 for (var i = 0; i < presentationRecord.presentationChildren().le
ngth; ++i) | 51 for (var i = 0; i < presentationRecord.presentationChildren().le
ngth; ++i) |
| 52 dumpFormattedRecord(presentationRecord.presentationChildren(
)[i], childPrefix); | 52 dumpFormattedRecord(presentationRecord.presentationChildren(
)[i], childPrefix); |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 WebInspector.panels.timeline._model._collectionEnabled = false; | 55 WebInspector.inspectorView.panel("timeline")._model._collectionEnabled =
false; |
| 56 | 56 |
| 57 var records = WebInspector.panels.timeline._currentViews[0]._rootRecord(
).presentationChildren(); | 57 var records = WebInspector.inspectorView.panel("timeline")._currentViews
[0]._rootRecord().presentationChildren(); |
| 58 for (var i = 0; i < records.length; ++i) | 58 for (var i = 0; i < records.length; ++i) |
| 59 dumpFormattedRecord(records[i]); | 59 dumpFormattedRecord(records[i]); |
| 60 InspectorTest.completeTest(); | 60 InspectorTest.completeTest(); |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 | 63 |
| 64 if (!window.testRunner) | 64 if (!window.testRunner) |
| 65 setTimeout(performActions, 3000); | 65 setTimeout(performActions, 3000); |
| 66 | 66 |
| 67 </script> | 67 </script> |
| 68 </head> | 68 </head> |
| 69 | 69 |
| 70 <body onload="runTest()"> | 70 <body onload="runTest()"> |
| 71 <p> | 71 <p> |
| 72 Tests the Timeline API instrumentation of a SendRequest, ReceiveResponse etc. | 72 Tests the Timeline API instrumentation of a SendRequest, ReceiveResponse etc. |
| 73 </p> | 73 </p> |
| 74 | 74 |
| 75 </body> | 75 </body> |
| 76 </html> | 76 </html> |
| OLD | NEW |