Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / tracing / timeline-network-resource.html
blob65e7b4223967e327a6de3ec0e77c682181729648
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/timeline-test.js"></script>
5 <script>
7 var scriptUrl = "timeline-network-resource.js";
9 function performActions(callback)
11 window.timelineNetworkResourceEvaluated = callback;
12 var script = document.createElement("script");
13 script.src = scriptUrl;
14 document.body.appendChild(script);
17 function test()
19 var requestId;
20 var scriptUrl = "timeline-network-resource.js";
22 var model = WebInspector.panels.timeline._model;
23 var presentationModel = InspectorTest.timelinePresentationModel();
25 InspectorTest.invokeAsyncWithTimeline("performActions", finish);
27 function finish()
29 var lastRecordStartTime;
30 function format(record)
32 if (record.type() === WebInspector.TimelineModel.RecordType.ResourceSendRequest)
33 printSend(record);
34 else if (record.type() === WebInspector.TimelineModel.RecordType.ResourceReceiveResponse)
35 printReceive(record);
36 else if (record.type() === WebInspector.TimelineModel.RecordType.ResourceFinish)
37 printFinish(record);
39 var presentationRecord = presentationModel.toPresentationRecord(record);
40 if (presentationRecord && record.thread() === WebInspector.TimelineModel.MainThreadName) {
41 var parentIsRoot = presentationRecord.presentationParent() && !presentationRecord.presentationParent().presentationParent();
42 if (parentIsRoot) {
43 if (lastRecordStartTime)
44 InspectorTest.assertGreaterOrEqual(record.startTime(), lastRecordStartTime, "Top level records order violation");
45 lastRecordStartTime = record.startTime();
49 model.forAllRecords(format);
50 InspectorTest.completeTest();
53 function printRecord(record)
55 InspectorTest.addResult("");
56 InspectorTest.printTimelineRecordProperties(record);
59 function printSend(record)
61 printRecord(record);
62 var data = record.traceEvent().args["data"];
63 requestId = data.requestId;
64 if (data.url === undefined)
65 InspectorTest.addResult("* No 'url' property in record");
66 else if (data.url.indexOf(scriptUrl) === -1)
67 InspectorTest.addResult("* Didn't find URL: " + scriptUrl);
70 function printReceive(record)
72 printRecord(record);
73 var data = record.traceEvent().args["data"];
74 if (requestId !== data.requestId)
75 InspectorTest.addResult("Didn't find matching requestId: " + requestId);
76 if (data.statusCode !== 0)
77 InspectorTest.addResult("Response received status: " + data.statusCode);
80 function printFinish(record)
82 printRecord(record);
83 var data = record.traceEvent().args["data"];
84 if (requestId !== data.requestId)
85 InspectorTest.addResult("Didn't find matching requestId: " + requestId);
86 if (data.didFail)
87 InspectorTest.addResult("Request failed.");
91 </script>
92 </head>
94 <body onload="runTest()">
95 <p>
96 Tests the Timeline API instrumentation of a network resource load
97 </p>
98 </body>
99 </html>