blob: f26c3d8ef34569c384eeeb44b5d758449c928905 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
<!DOCTYPE HTML>
<html>
<!--
Copyright (c) 2012 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<head>
<script src="base.js"></script>
<script>
base.require('base.unittest');
base.require('model');
</script>
</head>
<body>
<script src="../unittest_data/full_trace_but_with_only_one_frame.js"></script>
<script src="../unittest_data/one_frame_with_layers.js"></script>
<script>
'use strict';
var Model = ccfv.Model;
var Frame = ccfv.model.Frame;
function testData1() {
var model = new Model();
model.initFromTraceEvents(gFullTraceButWithOnlyOneFrame);
assertEquals(1, base.dictionaryValues(model.lthiHistories).length)
var lthiHistory = base.dictionaryValues(model.lthiHistories)[0];
assertEquals(1, lthiHistory.lthiSnapshots.length);
}
function testLayer() {
var model = new Model();
model.initFromFrameData(gOneFrameWithLayers);
assertEquals(1, base.dictionaryValues(model.lthiHistories).length)
var lthiHistory = base.dictionaryValues(model.lthiHistories)[0];
assertEquals(1, lthiHistory.lthiSnapshots.length);
var lthi = lthiHistory.lthiSnapshots[0];
assertTrue(lthi.activeTree.allLayers.length > 0);
}
</script>
</body>
</html>
|