| 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 {settings.FingerprintBrowserProxy} | 7 * @implements {settings.FingerprintBrowserProxy} |
| 8 * @extends {settings.TestBrowserProxy} | 8 * @extends {settings.TestBrowserProxy} |
| 9 */ | 9 */ |
| 10 var TestFingerprintBrowserProxy = function() { | 10 var TestFingerprintBrowserProxy = function() { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 var browserProxy = null; | 98 var browserProxy = null; |
| 99 | 99 |
| 100 /** | 100 /** |
| 101 * @param {number} index | 101 * @param {number} index |
| 102 * @param {string=} opt_label | 102 * @param {string=} opt_label |
| 103 */ | 103 */ |
| 104 function createFakeEvent(index, opt_label) { | 104 function createFakeEvent(index, opt_label) { |
| 105 return {model: {index: index, item: opt_label || ''}}; | 105 return {model: {index: index, item: opt_label || ''}}; |
| 106 } | 106 } |
| 107 | 107 |
| 108 suiteSetup(function() { | |
| 109 return PolymerTest.importHtml('chrome://md-settings/i18n_setup.html'); | |
| 110 }); | |
| 111 | |
| 112 setup(function() { | 108 setup(function() { |
| 113 browserProxy = new TestFingerprintBrowserProxy(); | 109 browserProxy = new TestFingerprintBrowserProxy(); |
| 114 settings.FingerprintBrowserProxyImpl.instance_ = browserProxy; | 110 settings.FingerprintBrowserProxyImpl.instance_ = browserProxy; |
| 115 | 111 |
| 116 PolymerTest.clearBody(); | 112 PolymerTest.clearBody(); |
| 117 fingerprintList = document.createElement('settings-fingerprint-list'); | 113 fingerprintList = document.createElement('settings-fingerprint-list'); |
| 118 document.body.appendChild(fingerprintList); | 114 document.body.appendChild(fingerprintList); |
| 119 dialog = fingerprintList.$.setupFingerprint; | 115 dialog = fingerprintList.$.setupFingerprint; |
| 120 Polymer.dom.flush(); | 116 Polymer.dom.flush(); |
| 121 return browserProxy.whenCalled('getFingerprintsList').then(function() { | 117 return browserProxy.whenCalled('getFingerprintsList').then(function() { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 return Promise.all([ | 204 return Promise.all([ |
| 209 browserProxy.whenCalled('removeEnrollment'), | 205 browserProxy.whenCalled('removeEnrollment'), |
| 210 browserProxy.whenCalled('getFingerprintsList')]); | 206 browserProxy.whenCalled('getFingerprintsList')]); |
| 211 }).then(function() { | 207 }).then(function() { |
| 212 assertEquals(4, fingerprintList.fingerprints_.length); | 208 assertEquals(4, fingerprintList.fingerprints_.length); |
| 213 assertFalse( | 209 assertFalse( |
| 214 fingerprintList.$$('.action-button').disabled); | 210 fingerprintList.$$('.action-button').disabled); |
| 215 }); | 211 }); |
| 216 }); | 212 }); |
| 217 }); | 213 }); |
| OLD | NEW |