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
6 found in the LICENSE file.
9 <script src=
"base.js"></script>
11 base
.require('base.unittest');
12 base
.require('model');
16 <script src=
"../unittest_data/full_trace_but_with_only_one_frame.js"></script>
17 <script src=
"../unittest_data/one_frame_with_layers.js"></script>
21 var Model
= ccfv
.Model
;
22 var Frame
= ccfv
.model
.Frame
;
24 function testData1() {
25 var model
= new Model();
26 model
.initFromTraceEvents(gFullTraceButWithOnlyOneFrame
);
27 assertEquals(1, base
.dictionaryValues(model
.lthiHistories
).length
)
28 var lthiHistory
= base
.dictionaryValues(model
.lthiHistories
)[0];
29 assertEquals(1, lthiHistory
.lthiSnapshots
.length
);
32 function testLayer() {
33 var model
= new Model();
34 model
.initFromFrameData(gOneFrameWithLayers
);
35 assertEquals(1, base
.dictionaryValues(model
.lthiHistories
).length
)
36 var lthiHistory
= base
.dictionaryValues(model
.lthiHistories
)[0];
37 assertEquals(1, lthiHistory
.lthiSnapshots
.length
);
39 var lthi
= lthiHistory
.lthiSnapshots
[0];
40 assertTrue(lthi
.activeTree
.allLayers
.length
> 0);