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

Unified Diff: chrome/test/data/webui/settings/fingerprint_browsertest_chromeos.js

Issue 2821133005: md-settings: Fix fingerprint list tests. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/settings/fingerprint_browsertest_chromeos.js
diff --git a/chrome/test/data/webui/settings/fingerprint_browsertest_chromeos.js b/chrome/test/data/webui/settings/fingerprint_browsertest_chromeos.js
index 63708feff487e89654defb0cd0f55481f90d5741..ebd2f86e2d2125c90b1b6f8b5d421922fabefadb 100644
--- a/chrome/test/data/webui/settings/fingerprint_browsertest_chromeos.js
+++ b/chrome/test/data/webui/settings/fingerprint_browsertest_chromeos.js
@@ -126,6 +126,7 @@ suite('settings-fingerprint-list', function() {
Polymer.dom.flush();
return browserProxy.whenCalled('getFingerprintsList').then(function() {
assertEquals(0, fingerprintList.fingerprints_.length);
+ browserProxy.resetResolver('getFingerprintsList');
});
});
@@ -171,25 +172,33 @@ suite('settings-fingerprint-list', function() {
assertFalse(dialog.$.dialog.open);
MockInteractions.tap(fingerprintList.$$('.action-button'));
return browserProxy.whenCalled('startEnroll').then(function() {
+ browserProxy.resetResolver('startEnroll');
+
assertTrue(dialog.$.dialog.open);
assertEquals(0, dialog.receivedScanCount_);
assertFalse(isVisible(addAnotherButton));
browserProxy.scanReceived(settings.FingerprintResultType.SUCCESS, true);
assertEquals(settings.FingerprintSetupStep.READY, dialog.step_);
- // Once the first fingerprint is enrolled, verify that enrolling the
- // second fingerprint without closing the dialog works as expected.
- return browserProxy.whenCalled('getFingerprintsList');
- }).then(function() {
- assertEquals(1, fingerprintList.fingerprints_.length);
assertTrue(dialog.$.dialog.open);
assertTrue(isVisible(addAnotherButton));
MockInteractions.tap(addAnotherButton);
- return browserProxy.whenCalled('startEnroll');
+
+ // Once the first fingerprint is enrolled, verify that enrolling the
+ // second fingerprint without closing the dialog works as expected.
+ return Promise.all([
+ browserProxy.whenCalled('startEnroll'),
+ browserProxy.whenCalled('getFingerprintsList')]);
}).then(function() {
+ browserProxy.resetResolver('getFingerprintsList');
+
assertTrue(dialog.$.dialog.open);
assertFalse(isVisible(addAnotherButton));
browserProxy.scanReceived(settings.FingerprintResultType.SUCCESS, true);
+
+ // Verify that by tapping the continue button we should exit the dialog
+ // and the fingerprint list should have two fingerprints registered.
+ MockInteractions.tap(dialog.$.closeButton);
return browserProxy.whenCalled('getFingerprintsList');
}).then(function() {
assertEquals(2, fingerprintList.fingerprints_.length);
@@ -221,6 +230,7 @@ suite('settings-fingerprint-list', function() {
fingerprintList.updateFingerprintsList_();
return browserProxy.whenCalled('getFingerprintsList').then(function() {
+ browserProxy.resetResolver('getFingerprintsList');
assertEquals(2, fingerprintList.fingerprints_.length);
fingerprintList.onFingerprintDeleteTapped_(createFakeEvent(0));
@@ -257,6 +267,7 @@ suite('settings-fingerprint-list', function() {
// Verify that new fingerprints cannot be added when there are already five
// registered fingerprints.
return browserProxy.whenCalled('getFingerprintsList').then(function() {
+ browserProxy.resetResolver('getFingerprintsList');
assertEquals(5, fingerprintList.fingerprints_.length);
assertTrue(fingerprintList.$$('.action-button').disabled);
fingerprintList.onFingerprintDeleteTapped_(createFakeEvent(0));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698