| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Mac and Windows go to native certificate manager, and certificate manager | 5 // Mac and Windows go to native certificate manager, and certificate manager |
| 6 // isn't implemented if OpenSSL is used. | 6 // isn't implemented if OpenSSL is used. |
| 7 GEN('#if defined(USE_NSS)'); | 7 GEN('#if defined(USE_NSS)'); |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * TestFixture for certificate manager WebUI testing. | 10 * TestFixture for certificate manager WebUI testing. |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 228 |
| 229 Mock4JS.verifyAllMocks(); | 229 Mock4JS.verifyAllMocks(); |
| 230 | 230 |
| 231 this.mockHandler.expects(once()).deleteCertificate(['c1']).will(callFunction( | 231 this.mockHandler.expects(once()).deleteCertificate(['c1']).will(callFunction( |
| 232 function() { | 232 function() { |
| 233 CertificateManager.onPopulateTree(['personalCertsTab-tree', []]); | 233 CertificateManager.onPopulateTree(['personalCertsTab-tree', []]); |
| 234 })); | 234 })); |
| 235 | 235 |
| 236 // Click on the delete button. | 236 // Click on the delete button. |
| 237 $('personalCertsTab-delete').click(); | 237 $('personalCertsTab-delete').click(); |
| 238 |
| 239 // Click on the cancel button to verify the confirmation overlay closes. |
| 240 $('alertOverlayCancel').click(); |
| 241 expectTrue($('alertOverlay').parentNode.classList.contains('transparent')); |
| 242 |
| 243 // Click on the delete button. |
| 244 $('personalCertsTab-delete').click(); |
| 245 |
| 238 // Click on the ok button in the confirmation overlay. | 246 // Click on the ok button in the confirmation overlay. |
| 239 $('alertOverlayOk').click(); | 247 $('alertOverlayOk').click(); |
| 248 expectTrue($('alertOverlay').parentNode.classList.contains('transparent')); |
| 240 | 249 |
| 241 // Context sensitive buttons should be disabled. | 250 // Context sensitive buttons should be disabled. |
| 242 expectTrue($('personalCertsTab-view').disabled); | 251 expectTrue($('personalCertsTab-view').disabled); |
| 243 expectTrue($('personalCertsTab-backup').disabled); | 252 expectTrue($('personalCertsTab-backup').disabled); |
| 244 expectTrue($('personalCertsTab-delete').disabled); | 253 expectTrue($('personalCertsTab-delete').disabled); |
| 245 expectFalse($('personalCertsTab-import').disabled); | 254 expectFalse($('personalCertsTab-import').disabled); |
| 246 if (this.isChromeOS) | 255 if (this.isChromeOS) |
| 247 expectFalse($('personalCertsTab-import-and-bind').disabled); | 256 expectFalse($('personalCertsTab-import-and-bind').disabled); |
| 248 // Tree should be empty. | 257 // Tree should be empty. |
| 249 expectTrue(personalCerts.querySelector('div.tree-item') === null); | 258 expectTrue(personalCerts.querySelector('div.tree-item') === null); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 271 // edit and delete buttons should be disabled. | 280 // edit and delete buttons should be disabled. |
| 272 var cert1 = certs[1]; | 281 var cert1 = certs[1]; |
| 273 expectEquals('ca_cert1', cert1.data.name); | 282 expectEquals('ca_cert1', cert1.data.name); |
| 274 expectNotEquals(null, cert1.querySelector('.cert-policy')); | 283 expectNotEquals(null, cert1.querySelector('.cert-policy')); |
| 275 cert1.click(); | 284 cert1.click(); |
| 276 expectTrue($('caCertsTab-edit').disabled); | 285 expectTrue($('caCertsTab-edit').disabled); |
| 277 expectTrue($('caCertsTab-delete').disabled); | 286 expectTrue($('caCertsTab-delete').disabled); |
| 278 }); | 287 }); |
| 279 | 288 |
| 280 GEN('#endif // defined(USE_NSS)'); | 289 GEN('#endif // defined(USE_NSS)'); |
| OLD | NEW |