Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / third_party / tvcm / src / tvcm / rect_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('tvcm.rect');
8
9 tvcm.unittest.testSuite('tvcm.rect_test', function() {
10   test('UVRectBasic', function() {
11     var container = tvcm.Rect.fromXYWH(0, 0, 10, 10);
12     var inner = tvcm.Rect.fromXYWH(1, 1, 8, 8);
13     var uv = inner.asUVRectInside(container);
14     assertRectEquals(uv, tvcm.Rect.fromXYWH(0.1, 0.1, .8, .8));
15     assertEquals(container.size().width, 10);
16     assertEquals(container.size().height, 10);
17   });
18 });