Upstream version 9.37.197.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / trace_viewer / tracing / timeline_display_transform_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.timeline_display_transform');
8
9 tvcm.unittest.testSuite('tracing.timeline_display_transform_test', function() {
10   var TimelineDisplayTransform = tracing.TimelineDisplayTransform;
11
12   test('basics', function() {
13     var a = new TimelineDisplayTransform();
14     a.panX = 0;
15     a.panY = 0;
16     a.scaleX = 1;
17
18     var b = new TimelineDisplayTransform();
19     b.panX = 10;
20     b.panY = 0;
21     b.scaleX = 1;
22
23     assertFalse(a.equals(b));
24     assertFalse(a.almostEquals(b));
25
26     var c = b.clone();
27     assertTrue(b.equals(c));
28     assertTrue(b.almostEquals(c));
29
30     c.set(a);
31     assertTrue(a.equals(c));
32     assertTrue(a.almostEquals(c));
33   });
34 });