Index: chrome/browser/resources/settings/people_page/lock_state_behavior.js |
diff --git a/chrome/browser/resources/settings/people_page/lock_state_behavior.js b/chrome/browser/resources/settings/people_page/lock_state_behavior.js |
index e96c2af3453100799a6f718d6cd4e454ed97a4d4..3e5a90cce0a54676ff2411e3b9c58eb21d45c7a0 100644 |
--- a/chrome/browser/resources/settings/people_page/lock_state_behavior.js |
+++ b/chrome/browser/resources/settings/people_page/lock_state_behavior.js |
@@ -37,13 +37,22 @@ var LockStateBehavior = { |
hasPin: { |
type: Boolean, |
notify: true |
- } |
+ }, |
+ |
+ /** |
+ * Interface for chrome.quickUnlockPrivate calls. May be overriden by tests. |
+ * @private |
+ */ |
+ quickUnlockPrivate_: { |
+ type: Object, |
+ value: chrome.quickUnlockPrivate |
+ }, |
}, |
/** @override */ |
attached: function() { |
this.boundOnActiveModesChanged_ = this.updateUnlockType_.bind(this); |
- chrome.quickUnlockPrivate.onActiveModesChanged.addListener( |
+ this.quickUnlockPrivate_.onActiveModesChanged.addListener( |
this.boundOnActiveModesChanged_); |
this.updateUnlockType_(); |
@@ -51,7 +60,7 @@ var LockStateBehavior = { |
/** @override */ |
detached: function() { |
- chrome.quickUnlockPrivate.onActiveModesChanged.removeListener( |
+ this.quickUnlockPrivate_.onActiveModesChanged.removeListener( |
this.boundOnActiveModesChanged_); |
}, |
@@ -63,7 +72,7 @@ var LockStateBehavior = { |
* @private |
*/ |
updateUnlockType_: function() { |
- chrome.quickUnlockPrivate.getActiveModes(function(modes) { |
+ this.quickUnlockPrivate_.getActiveModes(function(modes) { |
if (modes.includes(chrome.quickUnlockPrivate.QuickUnlockMode.PIN)) { |
this.hasPin = true; |
this.selectedUnlockType = LockScreenUnlockType.PIN_PASSWORD; |