| OLD | NEW |
| 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/bbox2.html"> | 7 <link rel="import" href="/tracing/base/math/bbox2.html"> |
| 8 <script> | 8 <script> |
| 9 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 9 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 10 // Use of this source code is governed by a BSD-style license that can be | 10 // Use of this source code is governed by a BSD-style license that can be |
| 11 // found in the LICENSE file. | 11 // found in the LICENSE file. |
| 12 | 12 |
| 13 'use strict'; | 13 'use strict'; |
| 14 | 14 |
| 15 tr.b.unittest.testSuite(function() { | 15 tr.b.unittest.testSuite(function() { |
| 16 test('addVec2', function() { | 16 test('addVec2', function() { |
| 17 var bbox = new tr.b.BBox2(); | 17 var bbox = new tr.b.math.BBox2(); |
| 18 var x = vec2.create(); | 18 var x = vec2.create(); |
| 19 vec2.set(x, 10, 10); | 19 vec2.set(x, 10, 10); |
| 20 bbox.addVec2(x); | 20 bbox.addVec2(x); |
| 21 assert.equal(bbox.minVec2[0], 10); | 21 assert.equal(bbox.minVec2[0], 10); |
| 22 assert.equal(bbox.minVec2[1], 10); | 22 assert.equal(bbox.minVec2[1], 10); |
| 23 assert.equal(bbox.maxVec2[0], 10); | 23 assert.equal(bbox.maxVec2[0], 10); |
| 24 assert.equal(bbox.maxVec2[1], 10); | 24 assert.equal(bbox.maxVec2[1], 10); |
| 25 | 25 |
| 26 // Mutate x. | 26 // Mutate x. |
| 27 vec2.set(x, 11, 11); | 27 vec2.set(x, 11, 11); |
| 28 | 28 |
| 29 // Bbox shouldn't have changed. | 29 // Bbox shouldn't have changed. |
| 30 assert.equal(bbox.minVec2[0], 10); | 30 assert.equal(bbox.minVec2[0], 10); |
| 31 assert.equal(bbox.minVec2[1], 10); | 31 assert.equal(bbox.minVec2[1], 10); |
| 32 assert.equal(bbox.maxVec2[0], 10); | 32 assert.equal(bbox.maxVec2[0], 10); |
| 33 assert.equal(bbox.maxVec2[1], 10); | 33 assert.equal(bbox.maxVec2[1], 10); |
| 34 }); | 34 }); |
| 35 }); | 35 }); |
| 36 </script> | 36 </script> |
| OLD | NEW |