| 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; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 TimelineAgent.stop(step3); | 34 TimelineAgent.stop(step3); |
| 35 } | 35 } |
| 36 | 36 |
| 37 function step3() | 37 function step3() |
| 38 { | 38 { |
| 39 function dumpFormattedRecord(presentationRecord, prefix) | 39 function dumpFormattedRecord(presentationRecord, prefix) |
| 40 { | 40 { |
| 41 var record = presentationRecord.record(); | 41 var record = presentationRecord.record(); |
| 42 prefix = prefix || ""; | 42 prefix = prefix || ""; |
| 43 // Here and below: pretend coalesced record are just not there, as c
oalescation is time dependent and, hence, not stable. | 43 // Here and below: pretend coalesced record are just not there, as c
oalescation is time dependent and, hence, not stable. |
| 44 var categoryName = WebInspector.panels.timeline._uiUtils.categoryFor
Record(record).name; |
| 45 if (categoryName !== "loading" && categoryName !== "scripting") |
| 46 return; |
| 44 if (!presentationRecord.coalesced() && record.type() !== "GCEvent") | 47 if (!presentationRecord.coalesced() && record.type() !== "GCEvent") |
| 45 InspectorTest.addResult(prefix + record.type()); | 48 InspectorTest.addResult(prefix + record.type()); |
| 46 // Ignore stray paint & rendering events for better stability. | 49 // Ignore stray paint & rendering events for better stability. |
| 47 var categoryName = WebInspector.panels.timeline._uiUtils.categoryFor
Record(record).name; | |
| 48 if (categoryName !== "loading" && categoryName !== "scripting") | |
| 49 return; | |
| 50 if (presentationRecord.presentationChildren()) { | 50 if (presentationRecord.presentationChildren()) { |
| 51 var childPrefix = prefix + (presentationRecord.coalesced() ? ""
: " "); | 51 var childPrefix = prefix + (presentationRecord.coalesced() ? ""
: " "); |
| 52 for (var i = 0; i < presentationRecord.presentationChildren().le
ngth; ++i) | 52 for (var i = 0; i < presentationRecord.presentationChildren().le
ngth; ++i) |
| 53 dumpFormattedRecord(presentationRecord.presentationChildren(
)[i], childPrefix); | 53 dumpFormattedRecord(presentationRecord.presentationChildren(
)[i], childPrefix); |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 WebInspector.panels.timeline._model._collectionEnabled = false; | 56 WebInspector.panels.timeline._model._collectionEnabled = false; |
| 57 | 57 |
| 58 var records = WebInspector.panels.timeline._currentViews[0]._rootRecord(
).presentationChildren(); | 58 var records = WebInspector.panels.timeline._currentViews[0]._rootRecord(
).presentationChildren(); |
| 59 for (var i = 0; i < records.length; ++i) | 59 for (var i = 0; i < records.length; ++i) |
| 60 dumpFormattedRecord(records[i]); | 60 dumpFormattedRecord(records[i]); |
| 61 InspectorTest.completeTest(); | 61 InspectorTest.completeTest(); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 if (!window.testRunner) | 65 if (!window.testRunner) |
| 66 setTimeout(performActions, 3000); | 66 setTimeout(performActions, 3000); |
| 67 | 67 |
| 68 </script> | 68 </script> |
| 69 </head> | 69 </head> |
| 70 | 70 |
| 71 <body onload="runTest()"> | 71 <body onload="runTest()"> |
| 72 <p> | 72 <p> |
| 73 Tests the Timeline API instrumentation of a SendRequest, ReceiveResponse etc. | 73 Tests the Timeline API instrumentation of a SendRequest, ReceiveResponse etc. |
| 74 </p> | 74 </p> |
| 75 | 75 |
| 76 </body> | 76 </body> |
| 77 </html> | 77 </html> |
| OLD | NEW |