3 Copyright (c) 2013 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file.
8 <link rel="import" href="/tracing/test_utils.html">
9 <link rel="import" href="/tracing/trace_model.html">
14 tv.unittest.testSuite(function() { // @suppress longLineCheck
15 var Process = tracing.trace_model.Process;
16 var Thread = tracing.trace_model.Thread;
17 var AsyncSlice = tracing.trace_model.AsyncSlice;
18 var AsyncSliceGroup = tracing.trace_model.AsyncSliceGroup;
19 var newAsyncSlice = tracing.test_utils.newAsyncSlice;
21 test('asyncSliceGroupBounds_Empty', function() {
23 var g = new AsyncSliceGroup(thread);
25 assertTrue(g.bounds.isEmpty);
28 test('asyncSliceGroupBounds_Basic', function() {
29 var model = new tracing.TraceModel();
30 var p1 = new Process(model, 1);
31 var t1 = new Thread(p1, 1);
32 var g = new AsyncSliceGroup(t1);
33 g.push(newAsyncSlice(0, 1, t1, t1));
34 g.push(newAsyncSlice(1, 1.5, t1, t1));
35 assertEquals(2, g.length);
37 assertEquals(0, g.bounds.min);
38 assertEquals(2.5, g.bounds.max);