OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <!-- | 3 <!-- |
4 Copyright (c) 2012 The Chromium Authors. All rights reserved. | 4 Copyright (c) 2012 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>TraceEventImporter tests</title> | 9 <title>TraceEventImporter tests</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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
552 | 552 |
553 var tmp = JSON.stringify(events); | 553 var tmp = JSON.stringify(events); |
554 assertEquals(']', tmp[tmp.length - 1]); | 554 assertEquals(']', tmp[tmp.length - 1]); |
555 | 555 |
556 // Drop off the trailing ] and add a newline | 556 // Drop off the trailing ] and add a newline |
557 var dropped = tmp.substring(0, tmp.length - 1); | 557 var dropped = tmp.substring(0, tmp.length - 1); |
558 var m = new tracing.TimelineModel(dropped + '\n'); | 558 var m = new tracing.TimelineModel(dropped + '\n'); |
559 assertEquals(1, m.numProcesses); | 559 assertEquals(1, m.numProcesses); |
560 } | 560 } |
561 | 561 |
562 function testStartFinishOneSliceOneThread() { | |
563 var events = [ | |
564 // Time is intentionally out of order. | |
565 {name: 'a', args: {}, pid: 52, ts: 560, cat: 'foo', tid: 53, ph: 'F', id: 72 }, | |
566 {name: 'a', args: {}, pid: 52, ts: 524, cat: 'foo', tid: 53, ph: 'S', id: 72 , args: {foo: "bar"}} | |
567 ]; | |
568 | |
569 var m = new tracing.TimelineModel(events); | |
570 var t = m.processes[52].threads[53]; | |
571 assertNotUndefined(t); | |
572 assertEquals(1, t.asyncSlices.slices.length); | |
573 assertEquals('a', t.asyncSlices.slices[0].title); | |
574 assertEquals(72, t.asyncSlices.slices[0].id); | |
575 assertEquals("bar", t.asyncSlices.slices[0].args.foo); | |
576 assertEquals(0, t.asyncSlices.slices[0].start); | |
577 assertAlmostEquals((60 - 24) / 1000, t.asyncSlices.slices[0].duration); | |
578 assertEquals(t, t.asyncSlices.slices[0].startThread); | |
579 assertEquals(t, t.asyncSlices.slices[0].endThread); | |
580 } | |
581 //oneslicetwothreads | |
jbates
2012/03/15 00:17:15
mark these TODO?
| |
582 //oneslicetwopids | |
583 //oneslicethatdoesntend | |
584 //missingstart | |
585 //twoslicesoutoforderinfile | |
586 | |
562 </script> | 587 </script> |
563 </body> | 588 </body> |
564 </html> | 589 </html> |
OLD | NEW |