3 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../http/tests/inspector/timeline-test.js"></script>
7 function performActions(callback
)
11 window
._imageLoaded
= true;
12 if (window
._scriptEvaluated
)
16 function scriptEvaluated()
18 window
._scriptEvaluated
= true;
19 if (window
._imageLoaded
)
23 var image
= new Image();
24 image
.onload
= onImageLoad
;
25 image
.src
= "resources/anImage.png";
26 var script
= document
.createElement("script");
27 script
.src
= "timeline-network-resource.js";
28 document
.body
.appendChild(script
);
30 window
.timelineNetworkResourceEvaluated
= scriptEvaluated
;
35 InspectorTest
.invokeAsyncWithTimeline("performActions", done
);
39 InspectorTest
.addResult("Script evaluated.");
40 var record
= InspectorTest
.findFirstTimelineRecord("ResourceReceivedData");
42 var data
= record
.traceEvent().args
["data"];
43 if (data
&& typeof data
.encodedDataLength
=== "number")
44 InspectorTest
.addResult("Resource received data has length, test passed.");
46 InspectorTest
.completeTest();
53 <body onload=
"runTest()">
55 Tests the Timeline API instrumentation of a network resource received data