Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / trace_viewer / cc / picture_test.html
1 <!DOCTYPE html>
2 <!--
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.
6 -->
7
8 <link rel="import" href="/cc.html">
9 <link rel="import" href="/cc/picture.html">
10 <link rel="import" href="/tracing/importer/trace_event_importer.html">
11 <link rel="import" href="/tracing/trace_model.html">
12
13 <script src="/cc/layer_tree_host_impl_test_data.js"></script>
14
15 <script>
16 'use strict';
17
18 tvcm.unittest.testSuite(function() {
19   test('basic', function() {
20     var m = new tracing.TraceModel(g_catLTHIEvents);
21     var p = tvcm.dictionaryValues(m.processes)[0];
22
23     var instance = p.objects.getAllInstancesNamed('cc::Picture')[0];
24     var snapshot = instance.snapshots[0];
25
26     assertTrue(snapshot instanceof cc.PictureSnapshot);
27     instance.wasDeleted(150);
28   });
29
30   test('getOps', function() {
31     var m = new tracing.TraceModel(g_catLTHIEvents);
32     var p = tvcm.dictionaryValues(m.processes)[0];
33
34     var instance = p.objects.getAllInstancesNamed('cc::Picture')[0];
35     var snapshot = instance.snapshots[0];
36
37     var ops = snapshot.getOps();
38     if (!ops)
39       return;
40     assertEquals(142, ops.length);
41
42     var op0 = ops[0];
43     assertEquals('Save', op0.cmd_string);
44     assertTrue(op0.info instanceof Array);
45   });
46 });
47 </script>