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 | 7 |
8 <link rel="import" href="/tracing/base/range.html"> | 8 <link rel="import" href="/tracing/base/math/range.html"> |
9 | 9 |
10 <script> | 10 <script> |
11 'use strict'; | 11 'use strict'; |
12 | 12 |
13 tr.b.unittest.testSuite(function() { | 13 tr.b.unittest.testSuite(function() { |
14 var Range = tr.b.Range; | 14 var Range = tr.b.math.Range; |
15 | 15 |
16 test('addValue', function() { | 16 test('addValue', function() { |
17 var range = new Range(); | 17 var range = new Range(); |
18 assert.isTrue(range.isEmpty); | 18 assert.isTrue(range.isEmpty); |
19 range.addValue(1); | 19 range.addValue(1); |
20 assert.isFalse(range.isEmpty); | 20 assert.isFalse(range.isEmpty); |
21 assert.equal(1, range.min); | 21 assert.equal(1, range.min); |
22 assert.equal(1, range.max); | 22 assert.equal(1, range.max); |
23 | 23 |
24 range.addValue(2); | 24 range.addValue(2); |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 var r = Range.fromExplicitRange(5, 5); | 456 var r = Range.fromExplicitRange(5, 5); |
457 var array = [{start: 1}, | 457 var array = [{start: 1}, |
458 {start: 2}, | 458 {start: 2}, |
459 {start: 3}, | 459 {start: 3}, |
460 {start: 4}]; | 460 {start: 4}]; |
461 assert.deepEqual([], r.filterArray( | 461 assert.deepEqual([], r.filterArray( |
462 array, function(value) {return value.start;})); | 462 array, function(value) {return value.start;})); |
463 }); | 463 }); |
464 }); | 464 }); |
465 </script> | 465 </script> |
OLD | NEW |