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

Unified Diff: chrome/browser/ui/webui/options/certificate_manager_browsertest.js

Issue 193273002: Handle cases when user cert database has NULL slots (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 9 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
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',

Powered by Google App Engine
This is Rietveld 408576698