OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 * @constructor | 6 * @constructor |
7 * @implements {SwitchAccessInterface} | 7 * @implements {SwitchAccessInterface} |
8 */ | 8 */ |
9 function FakeSwitchAccess() { | 9 function FakeSwitchAccess() { |
10 this.moveToNextCount = 0; | 10 this.moveToNextCount = 0; |
11 this.switchAccessPrefs = {}; | 11 this.getNumberPref = function(key) { |
12 this.switchAccessPrefs.getNumberPref = function(key) { | |
13 if (key === 'autoScanTime') | 12 if (key === 'autoScanTime') |
14 return 1; | 13 return 1; |
15 }; | 14 }; |
16 this.switchAccessPrefs.getBooleanPref = function(key) { | 15 this.getBooleanPref = function(key) { |
17 if (key === 'enableAutoScan') | 16 if (key === 'enableAutoScan') |
18 return false; | 17 return false; |
19 }; | 18 }; |
20 }; | 19 }; |
21 | 20 |
22 FakeSwitchAccess.prototype = { | 21 FakeSwitchAccess.prototype = { |
23 /** @override */ | 22 /** @override */ |
24 moveToNode: function(doNext) { | 23 moveToNode: function(doNext) { |
25 if (doNext) | 24 if (doNext) |
26 this.moveToNextCount += 1; | 25 this.moveToNextCount += 1; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 assertTrue(autoScanManager.isRunning()); | 166 assertTrue(autoScanManager.isRunning()); |
168 assertEquals(2, autoScanManager.scanTime_); | 167 assertEquals(2, autoScanManager.scanTime_); |
169 assertEquals(2, window.intervalDelay); | 168 assertEquals(2, window.intervalDelay); |
170 | 169 |
171 autoScanManager.setScanTime(5); | 170 autoScanManager.setScanTime(5); |
172 assertTrue(autoScanManager.isRunning()); | 171 assertTrue(autoScanManager.isRunning()); |
173 assertEquals(5, autoScanManager.scanTime_); | 172 assertEquals(5, autoScanManager.scanTime_); |
174 assertEquals(5, window.intervalDelay); | 173 assertEquals(5, window.intervalDelay); |
175 testDone(); | 174 testDone(); |
176 }); | 175 }); |
OLD | NEW |