Upstream version 9.37.197.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / trace_viewer / tracing / analysis / default_object_view_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('tracing.analysis.default_object_view');
8 tvcm.require('tracing.selection');
9 tvcm.require('tracing.trace_model.object_instance');
10
11 tvcm.unittest.testSuite('tracing.analysis.default_object_view_test', function() { // @suppress longLineCheck
12   test('instantiate_snapshotView', function() {
13     var i10 = new tracing.trace_model.ObjectInstance(
14         {}, '0x1000', 'cat', 'name', 10);
15     var s10 = i10.addSnapshot(10, {foo: 1});
16     i10.updateBounds();
17
18     var view = new tracing.analysis.DefaultObjectSnapshotView();
19     view.objectSnapshot = s10;
20     this.addHTMLOutput(view);
21   });
22
23   test('instantiate_instanceView', function() {
24     var i10 = new tracing.trace_model.ObjectInstance(
25         {}, '0x1000', 'cat', 'name', 10);
26     var s10 = i10.addSnapshot(10, {foo: 1});
27     var s20 = i10.addSnapshot(20, {foo: 2});
28     i10.updateBounds();
29
30     var view = new tracing.analysis.DefaultObjectInstanceView();
31     view.objectInstance = i10;
32     this.addHTMLOutput(view);
33   });
34 });