Chromium Code Reviews| Index: chrome/test/data/webui/settings/certificate_manager_page_test.js |
| diff --git a/chrome/test/data/webui/settings/certificate_manager_page_test.js b/chrome/test/data/webui/settings/certificate_manager_page_test.js |
| index 9d7177e8e111491a66c0303d20262c8b153f9b2e..6cc59b6abfa66625d3d859149d2239d032c56ec8 100644 |
| --- a/chrome/test/data/webui/settings/certificate_manager_page_test.js |
| +++ b/chrome/test/data/webui/settings/certificate_manager_page_test.js |
| @@ -29,6 +29,9 @@ cr.define('certificate_manager_page', function() { |
| 'viewCertificate', |
| ]); |
| + /** @type {boolean} */ |
| + this.useHardwareBacked = false; |
| + |
| /** @private {!CaTrustInfo} */ |
| this.caTrustInfo_ = {ssl: true, email: true, objSign: true}; |
| @@ -113,7 +116,8 @@ cr.define('certificate_manager_page', function() { |
| }, |
| /** @override */ |
| - importPersonalCertificate: function() { |
| + importPersonalCertificate: function(useHardwareBacked) { |
| + this.useHardwareBacked = useHardwareBacked; |
| this.methodCalled('importPersonalCertificate'); |
| return Promise.resolve(true); |
|
dpapad
2017/01/24 23:16:03
This should be
return Promise.resolve(this.useHar
stevenjb
2017/01/25 19:39:35
Actually, useHardwareBacked can be passed to metho
dpapad
2017/01/25 21:14:00
Ah you are right. That is what I origanaly meant,
|
| }, |
| @@ -799,13 +803,15 @@ cr.define('certificate_manager_page', function() { |
| * @param {boolean} actionEventExpected Whether a |
| * settings.CertificateActionEvent is expected to fire as a result |
| * tapping the Import button. |
| + * @param {boolean=} opt_bind Whether to click on the import and bind btn. |
|
dpapad
2017/01/24 23:16:03
Can we make this parameter required? All calls are
stevenjb
2017/01/25 19:39:35
Noisy change imho, but sure.
|
| */ |
| function testImportForCertificateType( |
| - certificateType, proxyMethodName, actionEventExpected) { |
| - element.certificateType = certificateType |
| + certificateType, proxyMethodName, actionEventExpected, opt_bind) { |
| + element.certificateType = certificateType; |
| Polymer.dom.flush(); |
| - var importButton = element.$$('paper-button'); |
| + var importButton = |
| + opt_bind ? element.$$('#importAndBind') : element.$$('#import'); |
| assertTrue(!!importButton); |
| var waitForActionEvent = actionEventExpected ? |
| @@ -820,6 +826,9 @@ cr.define('certificate_manager_page', function() { |
| assertEquals( |
| CertificateAction.IMPORT, event.detail.action); |
| assertEquals(certificateType, event.detail.certificateType); |
| + assertTrue( |
| + proxyMethodName != 'importPersonalCertificate' || |
|
dpapad
2017/01/24 23:16:03
Don't fully understand this assertion. Can you exp
stevenjb
2017/01/25 19:39:35
Done.
|
| + !!opt_bind == browserProxy.useHardwareBacked); |
| } |
| }); |
| } |
| @@ -830,6 +839,14 @@ cr.define('certificate_manager_page', function() { |
| 'importPersonalCertificate', true); |
| }); |
| + if (cr.isChromeOS) { |
| + test('ImportAndBindButton_Personal', function() { |
| + return testImportForCertificateType( |
| + CertificateType.PERSONAL, |
| + 'importPersonalCertificate', true, true); |
| + }); |
| + } |
| + |
| test('ImportButton_Server', function() { |
| return testImportForCertificateType( |
| CertificateType.SERVER, 'importServerCertificate', |