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

Unified 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: try again 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/tracing/trace_event_importer.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/tracing/trace_event_importer_test.html
diff --git a/chrome/browser/resources/tracing/trace_event_importer_test.html b/chrome/browser/resources/tracing/trace_event_importer_test.html
index 8086cd94454ebbcdf9f08f90f90e0b85462e40f2..5bbe449cebb6f8e658f205e246871d6fa2076390 100644
--- a/chrome/browser/resources/tracing/trace_event_importer_test.html
+++ b/chrome/browser/resources/tracing/trace_event_importer_test.html
@@ -23,7 +23,7 @@ found in the LICENSE file.
function testCanImportEmpty() {
self.assertFalse(tracing.TraceEventImporter.canImport([]));
- self.assertFalse(tracing.TraceEventImporter.canImport(""));
+ self.assertFalse(tracing.TraceEventImporter.canImport(''));
}
function testBasicSingleThreadNonnestedParsing() {
@@ -559,6 +559,33 @@ function testImportStringWithMissingCloseSquareBracketAndNewline() {
assertEquals(1, m.numProcesses);
}
+function testStartFinishOneSliceOneThread() {
+ var events = [
+ // Time is intentionally out of order.
+ {name: 'a', args: {}, pid: 52, ts: 560, cat: 'foo', tid: 53,
+ ph: 'F', id: 72},
+ {name: 'a', args: {}, pid: 52, ts: 524, cat: 'foo', tid: 53,
+ ph: 'S', id: 72, args: {foo: 'bar'}}
+ ];
+
+ var m = new tracing.TimelineModel(events);
+ var t = m.processes[52].threads[53];
+ assertNotUndefined(t);
+ assertEquals(1, t.asyncSlices.slices.length);
+ assertEquals('a', t.asyncSlices.slices[0].title);
+ assertEquals(72, t.asyncSlices.slices[0].id);
+ assertEquals('bar', t.asyncSlices.slices[0].args.foo);
+ assertEquals(0, t.asyncSlices.slices[0].start);
+ assertAlmostEquals((60 - 24) / 1000, t.asyncSlices.slices[0].duration);
+ assertEquals(t, t.asyncSlices.slices[0].startThread);
+ assertEquals(t, t.asyncSlices.slices[0].endThread);
+}
+
+// TODO(nduca): one slice, two threads
+// TODO(nduca): one slice, two pids
+// TODO(nduca): one slice that doesnt end
+// TODO(nduca): one slice that is missing a start
+
</script>
</body>
</html>
« no previous file with comments | « chrome/browser/resources/tracing/trace_event_importer.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698