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

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

Issue 10407051: Revert r137984 "Fix for broken CertificateViewerUITest.testDetails." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 215a5d629ce3817895a522ecb3df354744ff1d08..417f5604149127090ba1f345c62099a21237d685 100644
--- a/chrome/browser/resources/certificate_viewer.js
+++ b/chrome/browser/resources/certificate_viewer.js
@@ -17,31 +17,17 @@ cr.define('cert_viewer', function() {
var args = JSON.parse(chrome.dialogArguments);
getCertificateInfo(args);
- /**
- * Initialize the second tab's contents.
- * This is a 'oneShot' function, meaning it will only be invoked once,
- * no matter how many times it is called. This is done for unit-testing
- * purposes in case a test needs to initialize the tab before the timer
- * fires.
- */
- var initializeDetailTab = oneShot(function() {
- initializeTree($('hierarchy'), showCertificateFields);
- initializeTree($('cert-fields'), showCertificateFieldValue);
- createCertificateHierarchy(args.hierarchy);
- });
-
// The second tab's contents aren't visible on startup, so we can
// shorten startup by not populating those controls until after we
// have had a chance to draw the visible controls the first time.
// 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(initializeDetailTab, 200);
-
- $('tabbox').addEventListener('selectedChange', function f(e) {
- $('tabbox').removeEventListener('selectedChange', f);
- initializeDetailTab();
- });
+ setTimeout(function() {
+ initializeTree($('hierarchy'), showCertificateFields);
+ initializeTree($('cert-fields'), showCertificateFieldValue);
+ createCertificateHierarchy(args.hierarchy);
+ }, 200);
stripGtkAccessorKeys();
@@ -55,18 +41,6 @@ cr.define('cert_viewer', function() {
}
/**
- * Decorate a function so that it can only be invoked once.
- */
- function oneShot(fn) {
- var fired = false;
- return function() {
- if (fired) return;
- fn();
- fired = true;
- };
- }
-
- /**
* Initialize a cr.ui.Tree object from a given element using the specified
* change handler.
* @param {HTMLElement} tree The HTMLElement to style as a tree.
« 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