Index: chrome/browser/ui/webui/options/certificate_manager_browsertest.js |
diff --git a/chrome/browser/ui/webui/options/certificate_manager_browsertest.js b/chrome/browser/ui/webui/options/certificate_manager_browsertest.js |
index 73db5a8e969ddbadb2f2c25468c3aca0efa2c7dd..af5884d0ac1d46569086795eb6aa4459ea2a7acc 100644 |
--- a/chrome/browser/ui/webui/options/certificate_manager_browsertest.js |
+++ b/chrome/browser/ui/webui/options/certificate_manager_browsertest.js |
@@ -94,9 +94,18 @@ TEST_F('CertificateManagerWebUIUnpopulatedTest', |
Mock4JS.verifyAllMocks(); |
+ // If user database is not available, import buttons should be disabled. |
+ CertificateManager.onModelReady(false /* userDbAvailable*/, |
+ false /* tpmAvailable */); |
+ |
+ expectTrue($('personalCertsTab-import').disabled); |
+ expectTrue($('serverCertsTab-import').disabled); |
+ expectTrue($('caCertsTab-import').disabled); |
+ |
// Once we get the onModelReady call, the import buttons should be enabled, |
// others should still be disabled. |
- CertificateManager.onModelReady(false /* tpm_available */); |
+ CertificateManager.onModelReady(true /* userDbAvailable*/, |
+ false /* tpmAvailable */); |
expectTrue($('personalCertsTab-view').disabled); |
expectTrue($('personalCertsTab-backup').disabled); |
@@ -122,7 +131,8 @@ TEST_F('CertificateManagerWebUIUnpopulatedTest', |
// present. |
if (this.isChromeOS) { |
expectTrue($('personalCertsTab-import-and-bind').disabled); |
- CertificateManager.onModelReady(true /* tpm_available */); |
+ CertificateManager.onModelReady(true /* userDbAvailable*/, |
+ true /* tpmAvailable */); |
expectFalse($('personalCertsTab-import-and-bind').disabled); |
} |
}); |
@@ -141,10 +151,11 @@ CertificateManagerWebUITest.prototype = { |
preLoad: function() { |
CertificateManagerWebUIBaseTest.prototype.preLoad.call(this); |
- var tpm_available = this.isChromeOS; |
+ var tpmAvailable = this.isChromeOS; |
+ var userDbAvailable = true; |
this.mockHandler.expects(once()).populateCertificateManager().will( |
callFunction(function() { |
- CertificateManager.onModelReady(tpm_available); |
+ CertificateManager.onModelReady(userDbAvailable, tpmAvailable); |
[['personalCertsTab-tree', |
[{'id': 'o1', |