| <html> |
| <head> |
| <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| <script src="../../../http/tests/inspector/timeline-test.js"></script> |
| <script> |
| function display() |
| { |
| var callback; |
| var promise = new Promise((fulfill) => callback = fulfill); |
| if (window.testRunner) |
| testRunner.setCanOpenWindows(true); |
| var popup = window.open("resources/hello.html"); |
| popup.onload = function() |
| { |
| requestAnimationFrame(testRunner.capturePixelsAsyncThen.bind(testRunner, callback)); |
| } |
| return promise; |
| } |
| |
| function test() |
| { |
| UI.panels.timeline._disableCaptureJSProfileSetting.set(true); |
| InspectorTest.startTimeline(function() { InspectorTest.reloadPage(pageReloaded); }); |
| |
| function pageReloaded() |
| { |
| InspectorTest.callFunctionInPageAsync("display").then(displayDone); |
| } |
| |
| function displayDone() |
| { |
| InspectorTest.stopTimeline(InspectorTest.safeWrap(finish)) |
| } |
| |
| function finish() |
| { |
| InspectorTest.addResult("Model records:"); |
| InspectorTest.printTimelineRecords("MarkDOMContent"); |
| InspectorTest.printTimelineRecords("MarkLoad"); |
| InspectorTest.addResult("Timestamp records:"); |
| InspectorTest.printTimestampRecords("MarkDOMContent"); |
| InspectorTest.printTimestampRecords("MarkLoad"); |
| InspectorTest.printTimestampRecords("MarkFirstPaint"); |
| |
| var eventDividers = InspectorTest.timelineModel().eventDividers(); |
| for (var i = 1; i < eventDividers.length; ++i) |
| InspectorTest.assertGreaterOrEqual(eventDividers[i].startTime, eventDividers[i - 1].startTime, "Event divider timestamps should be monotonically non-decreasing"); |
| |
| InspectorTest.completeTest(); |
| } |
| } |
| |
| </script> |
| </head> |
| |
| <body onload="runTest()"> |
| <p> |
| Tests the load event. |
| </p> |
| |
| </body> |
| </html> |