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

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

Issue 9706010: about:tracing support for TRACE_ASYNC_START/FINISH events. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 9 months 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) 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
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698