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

Unified Diff: chrome/browser/resources/certificate_viewer.js

Issue 10382145: Fix for broken CertificateViewerUITest.testDetails. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: With test to not delay during testing. Created 8 years, 7 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 | « no previous file | chrome/test/data/webui/certificate_viewer_dialog_test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | chrome/test/data/webui/certificate_viewer_dialog_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698