Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Unified Diff: chrome/browser/resources/chromeos/switch_access/auto_scan_manager.js

Issue 2793073002: Added unit tests for auto_scan_manager. Created switch access test target. (Closed)
Patch Set: Responded to comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/switch_access/auto_scan_manager.js
diff --git a/chrome/browser/resources/chromeos/switch_access/auto_scan_manager.js b/chrome/browser/resources/chromeos/switch_access/auto_scan_manager.js
index f709547f620a5107b822ddc1d2d5499856b0c8a6..24043ae12632d57a14a41f79d36c9e262baf40bd 100644
--- a/chrome/browser/resources/chromeos/switch_access/auto_scan_manager.js
+++ b/chrome/browser/resources/chromeos/switch_access/auto_scan_manager.js
@@ -67,11 +67,13 @@ AutoScanManager.prototype = {
},
/**
- * Restart auto-scan under the current settings.
+ * Restart auto-scan under the current settings if it is currently running.
*/
- restart: function() {
- this.stop_();
- this.start_();
+ restartIfRunning: function() {
+ if (this.isRunning()) {
+ this.stop_();
+ this.start_();
+ }
},
/**
@@ -95,8 +97,6 @@ AutoScanManager.prototype = {
*/
setScanTime: function(scanTime) {
this.scanTime_ = scanTime;
- if (this.isRunning()) {
- this.restart();
- }
+ this.restartIfRunning();
},
};

Powered by Google App Engine
This is Rietveld 408576698