• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
7base.require('base.rect');
8
9base.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);
17  });
18});
19