1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
8 tvcm.require('cc.picture');
9 tvcm.require('tracing.importer.trace_event_importer');
10 tvcm.require('tracing.trace_model');
11 tvcm.requireRawScript('cc/layer_tree_host_impl_test_data.js');
13 tvcm.unittest.testSuite('cc.picture_test', function() {
14 test('basic', function() {
15 var m = new tracing.TraceModel(g_catLTHIEvents);
16 var p = tvcm.dictionaryValues(m.processes)[0];
18 var instance = p.objects.getAllInstancesNamed('cc::Picture')[0];
19 var snapshot = instance.snapshots[0];
21 assertTrue(snapshot instanceof cc.PictureSnapshot);
22 instance.wasDeleted(150);
25 test('getOps', function() {
26 var m = new tracing.TraceModel(g_catLTHIEvents);
27 var p = tvcm.dictionaryValues(m.processes)[0];
29 var instance = p.objects.getAllInstancesNamed('cc::Picture')[0];
30 var snapshot = instance.snapshots[0];
32 var ops = snapshot.getOps();
35 assertEquals(140, ops.length);
38 assertEquals('Save', op0.cmd_string);
39 assertTrue(op0.info instanceof Array);