Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: LayoutTests/inspector/console/console-timeline.html

Issue 709423002: DevTools: remove old Timeline front-end implementation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated LayoutTests/inspector/layers/layer-canvas-log.html Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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>
7
8 function startStopTimeline()
9 {
10 console.timeStamp("timestamp 0");
11 console.timeline("one");
12 console.timeStamp("timestamp 1");
13 console.timelineEnd("one");
14 console.timeStamp("timestamp 2");
15 }
16
17 function startStopMultiple()
18 {
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");
33 }
34
35 function startMultiple()
36 {
37 console.timeStamp("timestamp 0");
38 console.timeline("one");
39 console.timeStamp("timestamp 1");
40 console.timeline("two");
41 console.timeStamp("timestamp 2");
42 }
43
44 function stopTwo()
45 {
46 console.timeStamp("timestamp 3");
47 console.timelineEnd("two");
48 console.timeStamp("timestamp 4");
49 }
50
51 function stopOne()
52 {
53 console.timeStamp("timestamp 5");
54 console.timelineEnd("one");
55 console.timeStamp("timestamp 6 - FAIL");
56 }
57
58 function stopUnknown()
59 {
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");
67 }
68
69 function startTimeline()
70 {
71 console.timeStamp("timestamp 0");
72 console.timeline("one");
73 console.timeStamp("timestamp 1");
74 console.timeline("two");
75 console.timeStamp("timestamp 2");
76 }
77
78 function test()
79 {
80 WebInspector.TimelinePanel.show();
81 var panel = WebInspector.panels.timeline;
82 panel._model._currentTarget = WebInspector.targetManager.mainTarget();
83 panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordAdded, eventRecorded, this);
84
85 InspectorTest.runTestSuite([
86 function testStartStopTimeline(next)
87 {
88 InspectorTest.evaluateInPage("startStopTimeline()");
89 panel._model.addEventListener(WebInspector.TimelineModel.Events.Reco rdingStopped, allEventsReceived, this);
90
91 function allEventsReceived()
92 {
93 panel._model.removeEventListener(WebInspector.TimelineModel.Even ts.RecordingStopped, allEventsReceived, this);
94 next();
95 }
96 },
97
98 function testStartStopMultiple(next)
99 {
100 InspectorTest.evaluateInPage("startStopMultiple()");
101 panel._model.addEventListener(WebInspector.TimelineModel.Events.Reco rdingStopped, allEventsReceived, this);
102
103 function allEventsReceived()
104 {
105 panel._model.removeEventListener(WebInspector.TimelineModel.Even ts.RecordingStopped, allEventsReceived, this);
106 next();
107 }
108 },
109
110 function testStartMultipleStopInsideEvals(next)
111 {
112 panel._model.addEventListener(WebInspector.TimelineModel.Events.Reco rdingStopped, finish, this);
113
114 InspectorTest.evaluateInPage("startMultiple()", step2);
115
116 function step2()
117 {
118 InspectorTest.evaluateInPage("stopTwo()", step3);
119 }
120
121 function step3()
122 {
123 InspectorTest.evaluateInPage("stopOne()", function() {});
124 }
125
126 function finish()
127 {
128 panel._model.removeEventListener(WebInspector.TimelineModel.Even ts.RecordingStopped, finish, this);
129 next();
130 }
131 },
132
133 function testStopUnknown(next)
134 {
135 InspectorTest.evaluateInPage("stopUnknown()", next);
136 },
137
138 function testStartFromPanel(next)
139 {
140 panel._model.addEventListener(WebInspector.TimelineModel.Events.Reco rdingStarted, recordingStarted);
141 panel._model.addEventListener(WebInspector.TimelineModel.Events.Reco rdingStopped, finish, this);
142 panel._toggleTimelineButtonClicked();
143
144 function recordingStarted()
145 {
146 panel._model.removeEventListener(WebInspector.TimelineModel.Even ts.RecordingStarted, recordingStarted);
147 InspectorTest.evaluateInPage("startStopTimeline()", step2);
148 }
149
150 function step2()
151 {
152 panel._toggleTimelineButtonClicked();
153 }
154
155 function finish()
156 {
157 panel._model.removeEventListener(WebInspector.TimelineModel.Even ts.RecordingStopped, finish, this);
158 next();
159 }
160 },
161
162 function testStopFromPanel(next)
163 {
164 panel._model.addEventListener(WebInspector.TimelineModel.Events.Reco rdingStopped, finish, this);
165
166 InspectorTest.evaluateInPage("startTimeline()", step2);
167
168 function step2()
169 {
170 panel._toggleTimelineButtonClicked();
171 }
172
173 function finish()
174 {
175 panel._model.removeEventListener(WebInspector.TimelineModel.Even ts.RecordingStopped, finish, this);
176 next();
177 }
178 },
179
180 function testRacyStart(next)
181 {
182 panel._model.addEventListener(WebInspector.TimelineModel.Events.Reco rdingStarted, timelineStarted);
183 panel._model.addEventListener(WebInspector.TimelineModel.Events.Reco rdingStopped, finish, this);
184
185 InspectorTest.evaluateInPage("startTimeline()");
186 panel._toggleTimelineButtonClicked();
187
188 function timelineStarted()
189 {
190 panel._model.removeEventListener(WebInspector.TimelineModel.Even ts.RecordingStarted, timelineStarted);
191 panel._toggleTimelineButtonClicked();
192 }
193
194 function finish()
195 {
196 panel._model.removeEventListener(WebInspector.TimelineModel.Even ts.RecordingStopped, finish, this);
197 next();
198 }
199 },
200
201 function testRacyStart2(next)
202 {
203 panel._model.addEventListener(WebInspector.TimelineModel.Events.Reco rdingStarted, timelineStarted);
204 panel._model.addEventListener(WebInspector.TimelineModel.Events.Reco rdingStopped, finish, this);
205
206 panel._toggleTimelineButtonClicked();
207 InspectorTest.evaluateInPage("startTimeline()");
208
209 function timelineStarted()
210 {
211 panel._model.removeEventListener(WebInspector.TimelineModel.Even ts.RecordingStarted, timelineStarted);
212 // Fool listener order execution.
213 setTimeout(panel._toggleTimelineButtonClicked.bind(panel));
214 }
215
216 function finish()
217 {
218 panel._model.removeEventListener(WebInspector.TimelineModel.Even ts.RecordingStopped, finish, this);
219 next();
220 }
221 }
222 ]);
223
224 function eventRecorded(event)
225 {
226 function print(record)
227 {
228 if (record.type() === "TimeStamp")
229 InspectorTest.addResult(record.data().message);
230
231 for (var i = 0; i < record.children().length; ++i)
232 print(record.children()[i]);
233 }
234 print(event.data);
235 }
236 }
237
238 </script>
239 </head>
240
241 <body onload="runTest()">
242 <p>
243 Tests console.timeline and timelineEnd commands.
244 </p>
245
246 </body>
247 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698