Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / src / gpu / state_test.js
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.
4
5 'use strict';
6
7 tvcm.require('gpu');
8 tvcm.require('gpu.state');
9 tvcm.require('tracing.importer.trace_event_importer');
10 tvcm.require('tracing.trace_model');
11 tvcm.requireRawScript('gpu/state_test_data.js');
12
13 tvcm.unittest.testSuite('gpu.state_test', function() {
14   test('basic', function() {
15     var m = new tracing.TraceModel(g_gpu_state_trace);
16     var p = tvcm.dictionaryValues(m.processes)[0];
17
18     var instance = p.objects.getAllInstancesNamed('gpu::State')[0];
19     var snapshot = instance.snapshots[0];
20
21     assertTrue(snapshot instanceof gpu.StateSnapshot);
22     assertEquals(typeof(snapshot.screenshot), 'string');
23     instance.wasDeleted(150);
24   });
25 });