<script src="../../http/tests/inspector/timeline-test.js"></script>
<script>
-function performActions()
+function performActions(callback)
{
var image = new Image();
image.onload = bar;
function bar() {
var image = new Image();
- image.onload = function() { testRunner.evaluateInWebInspector(0, "window.step2()"); }
+ image.onload = function(event) { callback(); } // do not pass event argument to the callback.
image.src = "resources/anotherImage.png";
}
}
function test()
{
WebInspector.inspectorView.showPanel("timeline");
- WebInspector.panels.timeline._model._collectionEnabled = true;
+ WebInspector.inspectorView.panel("timeline")._model._currentTarget = WebInspector.targetManager.mainTarget();
+ InspectorTest.invokeAsyncWithTimeline("performActions", finish);
- TimelineAgent.start(step1);
-
- function step1()
- {
- InspectorTest.evaluateInPage("performActions()");
- }
-
- window.step2 = function()
- {
- TimelineAgent.stop(step3);
- }
-
- function step3()
+ function finish()
{
function dumpFormattedRecord(presentationRecord, prefix)
{
var record = presentationRecord.record();
prefix = prefix || "";
// Here and below: pretend coalesced record are just not there, as coalescation is time dependent and, hence, not stable.
+ var categoryName = WebInspector.panels.timeline._uiUtils.categoryForRecord(record).name;
+ if (categoryName !== "loading" && categoryName !== "scripting")
+ return;
if (!presentationRecord.coalesced() && record.type() !== "GCEvent")
InspectorTest.addResult(prefix + record.type());
// Ignore stray paint & rendering events for better stability.
- if (record.category().name !== "loading" && record.category().name !== "scripting")
- return;
if (presentationRecord.presentationChildren()) {
var childPrefix = prefix + (presentationRecord.coalesced() ? "" : " ");
for (var i = 0; i < presentationRecord.presentationChildren().length; ++i)
dumpFormattedRecord(presentationRecord.presentationChildren()[i], childPrefix);
}
}
- WebInspector.panels.timeline._model._collectionEnabled = false;
-
var records = WebInspector.panels.timeline._currentViews[0]._rootRecord().presentationChildren();
for (var i = 0; i < records.length; ++i)
dumpFormattedRecord(records[i]);