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.
7 base.require('base.rect');
9 base.unittest.testSuite('base.rect', function() {
10 test('UVRectBasic', function() {
11 var container = base.Rect.fromXYWH(0, 0, 10, 10);
12 var inner = base.Rect.fromXYWH(1, 1, 8, 8);
13 var uv = inner.asUVRectInside(container);
14 assertRectEquals(uv, base.Rect.fromXYWH(0.1, 0.1, .8, .8));
15 assertEquals(container.size().width, 10);
16 assertEquals(container.size().height, 10);