Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / tracing / console-timeline.html
bloba30115f1ef1df6d54a836063121a6e480078a5dd
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/console-test.js"></script>
5 <script src="../../http/tests/inspector/timeline-test.js"></script>
6 <script>
8 function startStopTimeline()
10 console.timeStamp("timestamp 0");
11 console.timeline("one");
12 console.timeStamp("timestamp 1");
13 console.timelineEnd("one");
14 console.timeStamp("timestamp 2");
17 function startStopMultiple()
19 console.timeStamp("timestamp 0");
20 console.timeline("one");
21 console.timeStamp("timestamp 1");
22 console.timeline("one");
23 console.timeline("two");
24 console.timeline("two");
25 console.timelineEnd("two");
26 console.timeStamp("timestamp 2");
27 console.timelineEnd("one");
28 console.timeStamp("timestamp 3");
29 console.timelineEnd("two");
30 console.timeStamp("timestamp 4");
31 console.timelineEnd("one");
32 console.timeStamp("timestamp 5");
35 function startMultiple()
37 console.timeStamp("timestamp 0");
38 console.timeline("one");
39 console.timeStamp("timestamp 1");
40 console.timeline("two");
41 console.timeStamp("timestamp 2");
44 function stopTwo()
46 console.timeStamp("timestamp 3");
47 console.timelineEnd("two");
48 console.timeStamp("timestamp 4");
51 function stopOne()
53 console.timeStamp("timestamp 5");
54 console.timelineEnd("one");
55 console.timeStamp("timestamp 6 - FAIL");
58 function stopUnknown()
60 console.timeStamp("timestamp 0");
61 console.timeline("one");
62 console.timeStamp("timestamp 1");
63 console.timelineEnd("two");
64 console.timeStamp("timestamp 2");
65 console.timelineEnd("one");
66 console.timeStamp("timestamp 3");
69 function startTimeline()
71 console.timeStamp("timestamp 0");
72 console.timeline("one");
73 console.timeStamp("timestamp 1");
74 console.timeline("two");
75 console.timeStamp("timestamp 2");
78 function test()
80 var panel = WebInspector.panels.timeline;
81 panel._model._currentTarget = WebInspector.targetManager.mainTarget();
83 InspectorTest.runTestSuite([
84 function testStartStopTimeline(next)
86 InspectorTest.evaluateWithTimeline("startStopTimeline()", allEventsReceived);
88 function allEventsReceived()
90 printTimelineAndTimestampEvents();
91 next();
95 function testStartStopMultiple(next)
97 InspectorTest.evaluateWithTimeline("startStopMultiple()", allEventsReceived);
99 function allEventsReceived()
101 printTimelineAndTimestampEvents();
102 next();
106 function testStartMultipleStopInsideEvals(next)
108 InspectorTest.startTimeline(step1);
110 function step1()
112 InspectorTest.evaluateInPage("startMultiple()", step2);
115 function step2()
117 InspectorTest.evaluateInPage("stopTwo()", step3);
120 function step3()
122 InspectorTest.evaluateInPage("stopOne()", step4);
125 function step4()
127 InspectorTest.stopTimeline(finish);
130 function finish()
132 printTimelineAndTimestampEvents();
133 next();
137 function testStopUnknown(next)
139 InspectorTest.evaluateWithTimeline("stopUnknown()", allEventsReceived);
141 function allEventsReceived()
143 printTimelineAndTimestampEvents();
144 next();
148 function testStartFromPanel(next)
150 panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStarted, recordingStarted);
151 panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish);
152 panel._toggleTimelineButtonClicked();
154 function recordingStarted()
156 panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStarted, recordingStarted);
157 InspectorTest.evaluateInPage("startStopTimeline()", step2);
160 function step2()
162 panel._toggleTimelineButtonClicked();
165 function finish()
167 printTimelineAndTimestampEvents();
168 panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish);
169 next();
173 function testStopFromPanel(next)
175 panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish);
177 InspectorTest.startTimeline(step1);
179 function step1()
181 InspectorTest.evaluateInPage("startTimeline()", step2);
184 function step2()
186 panel._toggleTimelineButtonClicked();
189 function finish()
191 printTimelineAndTimestampEvents();
192 panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish);
193 next();
197 function testRacyStart(next)
199 panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStarted, recordingStarted);
200 panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish);
201 panel._toggleTimelineButtonClicked();
203 function recordingStarted()
205 panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStarted, recordingStarted);
206 InspectorTest.evaluateInPage("startTimeline()", didEvaluate);
209 function didEvaluate()
211 panel._toggleTimelineButtonClicked();
214 function finish()
216 printTimelineAndTimestampEvents();
217 panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish);
218 next();
222 function testRacyStart2(next)
224 panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStarted, recordingStarted);
225 panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish);
227 panel._toggleTimelineButtonClicked();
229 function recordingStarted()
231 panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStarted, recordingStarted);
232 InspectorTest.evaluateInPage("startTimeline()", didEvaluate);
235 function didEvaluate()
237 // Fool listener order execution.
238 setTimeout(panel._toggleTimelineButtonClicked.bind(panel));
241 function finish()
243 panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish);
244 printTimelineAndTimestampEvents();
245 next();
250 function printTimelineAndTimestampEvents() {
251 panel._tracingModel.sortedProcesses().forEach(function(process)
253 process.sortedThreads().forEach(function(thread)
255 thread.events().forEach(function(event)
257 if (event.hasCategory(WebInspector.TracingModel.ConsoleEventCategory))
258 InspectorTest.addResult(event.name);
259 else if (event.name === WebInspector.TimelineModel.RecordType.TimeStamp)
260 InspectorTest.addResult(event.args["data"]["message"]);
267 </script>
268 </head>
270 <body onload="runTest()">
272 Tests console.timeline and timelineEnd commands.
273 </p>
275 </body>
276 </html>