Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Side by Side Diff: tracing/tracing/base/math/rect_test.html

Issue 2771723003: [tracing] Move math utilities from base into their own subdirectory (attempt 2) (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tracing/tracing/base/math/rect.html ('k') | tracing/tracing/base/math/running_statistics.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright (c) 2014 The Chromium Authors. All rights reserved. 3 Copyright (c) 2014 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 <link rel="import" href="/tracing/base/rect.html"> 7 <link rel="import" href="/tracing/base/math/rect.html">
8 <script> 8 <script>
9 'use strict'; 9 'use strict';
10 10
11 tr.b.unittest.testSuite(function() { 11 tr.b.unittest.testSuite(function() {
12 test('UVRectBasic', function() { 12 test('UVRectBasic', function() {
13 function assertRectEquals(a, b, opt_message) { 13 function assertRectEquals(a, b, opt_message) {
14 var ok = true; 14 var ok = true;
15 if (a.x === b.x && a.y === b.y && 15 if (a.x === b.x && a.y === b.y &&
16 a.width === b.width && a.height === b.height) { 16 a.width === b.width && a.height === b.height) {
17 return; 17 return;
18 } 18 }
19 var message = opt_message || 'Expected "' + a.toString() + 19 var message = opt_message || 'Expected "' + a.toString() +
20 '", got "' + b.toString() + '"'; 20 '", got "' + b.toString() + '"';
21 assert.fail(a, b, message); 21 assert.fail(a, b, message);
22 } 22 }
23 var container = tr.b.Rect.fromXYWH(0, 0, 10, 10); 23 var container = tr.b.math.Rect.fromXYWH(0, 0, 10, 10);
24 var inner = tr.b.Rect.fromXYWH(1, 1, 8, 8); 24 var inner = tr.b.math.Rect.fromXYWH(1, 1, 8, 8);
25 var uv = inner.asUVRectInside(container); 25 var uv = inner.asUVRectInside(container);
26 assertRectEquals(uv, tr.b.Rect.fromXYWH(0.1, 0.1, .8, .8)); 26 assertRectEquals(uv, tr.b.math.Rect.fromXYWH(0.1, 0.1, .8, .8));
27 assert.equal(10, container.size().width); 27 assert.equal(10, container.size().width);
28 assert.equal(10, container.size().height); 28 assert.equal(10, container.size().height);
29 }); 29 });
30 }); 30 });
31 </script> 31 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/base/math/rect.html ('k') | tracing/tracing/base/math/running_statistics.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698