OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * Test fixture for the MeasurementSystem. | 6 * Test fixture for the MeasurementSystem. |
7 * @constructor | 7 * @constructor |
8 * @extends {testing.Test} | 8 * @extends {testing.Test} |
9 */ | 9 */ |
10 function MeasurementSystemUnitTest() { | 10 function MeasurementSystemUnitTest() { |
11 testing.Test.call(this); | 11 testing.Test.call(this); |
12 } | 12 } |
13 | 13 |
14 MeasurementSystemUnitTest.prototype = { | 14 MeasurementSystemUnitTest.prototype = { |
15 __proto__: testing.Test.prototype, | 15 __proto__: testing.Test.prototype, |
16 | 16 |
17 extraLibraries: [ | 17 extraLibraries: [ |
18 '../../shared/js/cr.js', | 18 '../../../../../ui/webui/resources/js/cr.js', |
19 '../print_preview_utils.js', | 19 '../print_preview_utils.js', |
20 'measurement_system.js' | 20 'measurement_system.js' |
21 ] | 21 ] |
22 }; | 22 }; |
23 | 23 |
24 TEST_F('MeasurementSystemUnitTest', 'parseNumberFormat', function() { | 24 TEST_F('MeasurementSystemUnitTest', 'parseNumberFormat', function() { |
25 assertTrue(areArraysEqual( | 25 assertTrue(areArraysEqual( |
26 ['.', ','], | 26 ['.', ','], |
27 print_preview.MeasurementSystem.parseNumberFormat('123.456,78'))); | 27 print_preview.MeasurementSystem.parseNumberFormat('123.456,78'))); |
28 assertTrue(areArraysEqual( | 28 assertTrue(areArraysEqual( |
(...skipping 30 matching lines...) Expand all Loading... |
59 assertTrue(areArraysEqual( | 59 assertTrue(areArraysEqual( |
60 [',', '.'], | 60 [',', '.'], |
61 print_preview.MeasurementSystem.parseNumberFormat(''))); | 61 print_preview.MeasurementSystem.parseNumberFormat(''))); |
62 assertTrue(areArraysEqual( | 62 assertTrue(areArraysEqual( |
63 [',', '.'], | 63 [',', '.'], |
64 print_preview.MeasurementSystem.parseNumberFormat('1'))); | 64 print_preview.MeasurementSystem.parseNumberFormat('1'))); |
65 assertTrue(areArraysEqual( | 65 assertTrue(areArraysEqual( |
66 [',', '.'], | 66 [',', '.'], |
67 print_preview.MeasurementSystem.parseNumberFormat('12'))); | 67 print_preview.MeasurementSystem.parseNumberFormat('12'))); |
68 }); | 68 }); |
OLD | NEW |