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

Unified Diff: chrome/browser/resources/settings/people_page/lock_state_behavior.js

Issue 2157673002: Browser tests for the quick_unlock settings pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pin-unlock-quick-unlock-interface
Patch Set: Rebase Created 4 years, 2 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/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;

Powered by Google App Engine
This is Rietveld 408576698