OLD | NEW |
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 <script src="base.js"></script> | 9 <script src="base.js"></script> |
10 <script> | 10 <script> |
11 base.require('base.unittest'); | 11 base.require('base.unittest'); |
12 base.require('model'); | 12 base.require('model'); |
13 </script> | 13 </script> |
14 </head> | 14 </head> |
15 <body> | 15 <body> |
16 <script src="../unittest_data/full_trace_but_with_only_one_frame.js"></script> | 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> |
17 <script> | 18 <script> |
18 'use strict'; | 19 'use strict'; |
19 | 20 |
20 var Model = ccfv.Model; | 21 var Model = ccfv.Model; |
21 var Frame = ccfv.model.Frame; | 22 var Frame = ccfv.model.Frame; |
22 | 23 |
23 function testData1() { | 24 function testData1() { |
24 var model = new Model(); | 25 var model = new Model(); |
25 model.initFromTraceEvents(gFullTraceButWithOnlyOneFrame); | 26 model.initFromTraceEvents(gFullTraceButWithOnlyOneFrame); |
26 assertEquals(1, base.dictionaryValues(model.lthiHistories).length) | 27 assertEquals(1, base.dictionaryValues(model.lthiHistories).length) |
27 var lthiHistory = base.dictionaryValues(model.lthiHistories)[0]; | 28 var lthiHistory = base.dictionaryValues(model.lthiHistories)[0]; |
28 assertEquals(1, lthiHistory.lthiSnapshots.length); | 29 assertEquals(1, lthiHistory.lthiSnapshots.length); |
29 } | 30 } |
30 | 31 |
| 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); |
| 38 |
| 39 var lthi = lthiHistory.lthiSnapshots[0]; |
| 40 assertTrue(lthi.activeTree.allLayers.length > 0); |
| 41 } |
| 42 |
31 </script> | 43 </script> |
32 </body> | 44 </body> |
33 </html> | 45 </html> |
OLD | NEW |