| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <!-- | |
| 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 | |
| 5 found in the LICENSE file. | |
| 6 --> | |
| 7 <link rel="import" href="/tracing/base/bbox2.html"> | |
| 8 <script> | |
| 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 | |
| 11 // found in the LICENSE file. | |
| 12 | |
| 13 'use strict'; | |
| 14 | |
| 15 tr.b.unittest.testSuite(function() { | |
| 16 test('addVec2', function() { | |
| 17 var bbox = new tr.b.BBox2(); | |
| 18 var x = vec2.create(); | |
| 19 vec2.set(x, 10, 10); | |
| 20 bbox.addVec2(x); | |
| 21 assert.equal(bbox.minVec2[0], 10); | |
| 22 assert.equal(bbox.minVec2[1], 10); | |
| 23 assert.equal(bbox.maxVec2[0], 10); | |
| 24 assert.equal(bbox.maxVec2[1], 10); | |
| 25 | |
| 26 // Mutate x. | |
| 27 vec2.set(x, 11, 11); | |
| 28 | |
| 29 // Bbox shouldn't have changed. | |
| 30 assert.equal(bbox.minVec2[0], 10); | |
| 31 assert.equal(bbox.minVec2[1], 10); | |
| 32 assert.equal(bbox.maxVec2[0], 10); | |
| 33 assert.equal(bbox.maxVec2[1], 10); | |
| 34 }); | |
| 35 }); | |
| 36 </script> | |
| OLD | NEW |