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

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

Issue 2655583002: MD Settings: Certificates: Add 'Import and bind' button for CrOS (Closed)
Patch Set: Elim OS_CHROMEOS condition for certificateManagerImportAndBind to fix tests Created 3 years, 11 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 | « chrome/browser/resources/settings/certificate_manager_page/certificate_list.js ('k') | 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/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..8002bf576fb9ac337803c772a22b8e37bf359f3a 100644
--- a/chrome/test/data/webui/settings/certificate_manager_page_test.js
+++ b/chrome/test/data/webui/settings/certificate_manager_page_test.js
@@ -113,8 +113,8 @@ cr.define('certificate_manager_page', function() {
},
/** @override */
- importPersonalCertificate: function() {
- this.methodCalled('importPersonalCertificate');
+ importPersonalCertificate: function(useHardwareBacked) {
+ this.methodCalled('importPersonalCertificate', useHardwareBacked);
return Promise.resolve(true);
},
@@ -799,13 +799,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} bindBtn Whether to click on the import and bind btn.
*/
function testImportForCertificateType(
- certificateType, proxyMethodName, actionEventExpected) {
- element.certificateType = certificateType
+ certificateType, proxyMethodName, actionEventExpected, bindBtn) {
+ element.certificateType = certificateType;
Polymer.dom.flush();
- var importButton = element.$$('paper-button');
+ var importButton =
+ bindBtn ? element.$$('#importAndBind') : element.$$('#import');
assertTrue(!!importButton);
var waitForActionEvent = actionEventExpected ?
@@ -813,32 +815,43 @@ cr.define('certificate_manager_page', function() {
Promise.resolve(null);
MockInteractions.tap(importButton);
- return browserProxy.whenCalled(proxyMethodName).then(function() {
- return waitForActionEvent;
- }).then(function(event) {
- if (actionEventExpected) {
- assertEquals(
- CertificateAction.IMPORT, event.detail.action);
- assertEquals(certificateType, event.detail.certificateType);
- }
- });
+ return browserProxy.whenCalled(proxyMethodName)
+ .then(function(arg) {
+ if (proxyMethodName == 'importPersonalCertificate') {
+ assertNotEquals(arg, undefined);
+ assertEquals(arg, bindBtn);
+ }
+ return waitForActionEvent;
+ })
+ .then(function(event) {
+ if (actionEventExpected) {
+ assertEquals(CertificateAction.IMPORT, event.detail.action);
+ assertEquals(certificateType, event.detail.certificateType);
+ }
+ });
}
test('ImportButton_Personal', function() {
return testImportForCertificateType(
- CertificateType.PERSONAL,
- 'importPersonalCertificate', true);
+ CertificateType.PERSONAL, 'importPersonalCertificate', true, false);
});
+ if (cr.isChromeOS) {
+ test('ImportAndBindButton_Personal', function() {
+ return testImportForCertificateType(
+ CertificateType.PERSONAL, 'importPersonalCertificate', true,
+ true);
+ });
+ }
+
test('ImportButton_Server', function() {
return testImportForCertificateType(
- CertificateType.SERVER, 'importServerCertificate',
- false);
+ CertificateType.SERVER, 'importServerCertificate', false, false);
});
test('ImportButton_CA', function() {
return testImportForCertificateType(
- CertificateType.CA, 'importCaCertificate', true);
+ CertificateType.CA, 'importCaCertificate', true, false);
});
});
}
« no previous file with comments | « chrome/browser/resources/settings/certificate_manager_page/certificate_list.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698