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

Side by Side Diff: chrome/browser/resources/tracing/timeline_model_test.html

Issue 8359025: Tons of timeline tweaks (Closed)
Patch Set: Disable eliding due to perf issues Created 9 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <!-- 3 <!--
4 Copyright (c) 2010 The Chromium Authors. All rights reserved. 4 Copyright (c) 2010 The Chromium Authors. All rights reserved.
5 Use of this source code is governed by a BSD-style license that can be 5 Use of this source code is governed by a BSD-style license that can be
6 found in the LICENSE file. 6 found in the LICENSE file.
7 --> 7 -->
8 <head> 8 <head>
9 <title></title> 9 <title></title>
10 <script src="http://closure-library.googlecode.com/svn/trunk/closure/goog/base.j s"></script> 10 <script src="http://closure-library.googlecode.com/svn/trunk/closure/goog/base.j s"></script>
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 function testUserTime() { 268 function testUserTime() {
269 var events = [ 269 var events = [
270 {name: 'thread_name', args: {name: 'Thread 1'}, 270 {name: 'thread_name', args: {name: 'Thread 1'},
271 pid: 1, ts: 0, tid: 1, ph: 'M'}, 271 pid: 1, ts: 0, tid: 1, ph: 'M'},
272 {name: 'a', args: {}, pid: 1, ts: 1, uts: 70, cat: 'foo', tid: 1, ph: 'B'}, 272 {name: 'a', args: {}, pid: 1, ts: 1, uts: 70, cat: 'foo', tid: 1, ph: 'B'},
273 {name: 'a', args: {}, pid: 1, ts: 2, uts: 77, cat: 'foo', tid: 1, ph: 'E'}, 273 {name: 'a', args: {}, pid: 1, ts: 2, uts: 77, cat: 'foo', tid: 1, ph: 'E'},
274 {name: 'a', args: {}, pid: 1, ts: 2 , uts: 80, cat: 'foo', tid: 1, ph: 'I'}, 274 {name: 'a', args: {}, pid: 1, ts: 2 , uts: 80, cat: 'foo', tid: 1, ph: 'I'},
275 ]; 275 ];
276 var m = new tracing.TimelineModel(events); 276 var m = new tracing.TimelineModel(events);
277 var subRow = m.processes[1].threads[1].subRows[0]; 277 var subRow = m.processes[1].threads[1].subRows[0];
278 assertEquals(subRow[0].startInUserTime, 70); 278 assertEquals(subRow[0].startInUserTime, 0.07);
279 assertEquals(subRow[0].durationInUserTime, 7); 279 assertEquals(subRow[0].durationInUserTime, 0.007);
280 assertEquals(subRow[1].startInUserTime, 80); 280 assertEquals(subRow[1].startInUserTime, 0.08);
281 assertEquals(subRow[1].durationInUserTime, 0); 281 assertEquals(subRow[1].durationInUserTime, 0);
282 } 282 }
283 283
284 284
285 function testImmediateParsing() { 285 function testImmediateParsing() {
286 var events = [ 286 var events = [
287 // Need to include immediates inside a task so the timeline 287 // Need to include immediates inside a task so the timeline
288 // recentering/zeroing doesn't clobber their timestamp. 288 // recentering/zeroing doesn't clobber their timestamp.
289 {name: 'a', args: {}, pid: 1, ts: 1, cat: 'foo', tid: 1, ph: 'B'}, 289 {name: 'a', args: {}, pid: 1, ts: 1, cat: 'foo', tid: 1, ph: 'B'},
290 {name: 'immediate', args: {}, pid: 1, ts: 2, cat: 'foo', tid: 1, ph: 'I'}, 290 {name: 'immediate', args: {}, pid: 1, ts: 2, cat: 'foo', tid: 1, ph: 'I'},
(...skipping 15 matching lines...) Expand all
306 assertEquals((2 - 1) / 1000, immed.start); 306 assertEquals((2 - 1) / 1000, immed.start);
307 assertEquals(0, immed.duration); 307 assertEquals(0, immed.duration);
308 assertEquals(0, immed.subSlices.length); 308 assertEquals(0, immed.subSlices.length);
309 309
310 subRow = t.subRows[1]; 310 subRow = t.subRows[1];
311 assertEquals(immed, subRow[0]); 311 assertEquals(immed, subRow[0]);
312 } 312 }
313 </script> 313 </script>
314 </body> 314 </body>
315 </html> 315 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698