Index: chrome/browser/resources/certificate_viewer.js |
diff --git a/chrome/browser/resources/certificate_viewer.js b/chrome/browser/resources/certificate_viewer.js |
index 417f5604149127090ba1f345c62099a21237d685..f90b9afc47e1b6d6bec7c5ca25c6eeb9e92a7000 100644 |
--- a/chrome/browser/resources/certificate_viewer.js |
+++ b/chrome/browser/resources/certificate_viewer.js |
@@ -23,11 +23,19 @@ cr.define('cert_viewer', function() { |
// The value of 200ms is quick enough that the user couldn't open the |
// tab in that time but long enough to allow the first tab to draw on |
// even the slowest machine. |
- setTimeout(function() { |
+ |
+ function initSecondTab() { |
initializeTree($('hierarchy'), showCertificateFields); |
initializeTree($('cert-fields'), showCertificateFieldValue); |
createCertificateHierarchy(args.hierarchy); |
- }, 200); |
+ } |
+ |
+ // When running as a unit-test, don't delay because it introduces |
+ // a race-condition and makes the test flakey. |
flackr
2012/05/17 02:28:16
It seems to me like the ideal way to fix this woul
|
+ if (typeof CertificateViewerUITest !== 'undefined') |
+ initSecondTab(); |
+ else |
+ setTimeout(initSecondTab, 200); |
stripGtkAccessorKeys(); |