Disable keep-alive connections to check disabled ssl error pages, r=hskupin mozilla1.9.1
authorAnthony Hughes <anthony.s.hughes@gmail.com>
Mon, 14 Jun 2010 16:35:44 -0700
branchmozilla1.9.1
changeset 502 c7b1d08c520f6382917aa0e4883b8e8d7ec05df1
parent 498 bd1045e2c2003847ddf694d760dd1b60947aecd4
child 505 8d05a15c3757a64bd3f5009b3d49dff06ed99402
push id407
push userhskupin@mozilla.com
push dateWed, 16 Jun 2010 11:24:51 +0000
reviewershskupin
Disable keep-alive connections to check disabled ssl error pages, r=hskupin
firefox/testSecurity/testSSLDisabledErrorPage.js
--- a/firefox/testSecurity/testSSLDisabledErrorPage.js
+++ b/firefox/testSecurity/testSSLDisabledErrorPage.js
@@ -39,36 +39,44 @@
 var RELATIVE_ROOT = '../../shared-modules';
 var MODULE_REQUIRES = ['PrefsAPI'];
 
 const gDelay = 0;
 const gTimeout = 5000;
 
 var setupModule = function(module) {
   module.controller = mozmill.getBrowserController();
+  
+  // XXX: Bug 513129
+  //      Disable Keep-alive connections
+  PrefsAPI.preferences.setPref("network.http.keep-alive", false);
 }
 
 var teardownModule = function(module) {
   // Reset the SSL and TLS pref
   PrefsAPI.preferences.clearUserPref("security.enable_ssl3");
   PrefsAPI.preferences.clearUserPref("security.enable_tls");
+  
+  // XXX: Bug 513129
+  //      Re-enable Keep-alive connections
+  PrefsAPI.preferences.clearUserPref("network.http.keep-alive");
 }
 
 /**
  * Test that SSL and TLS are checked by default
  *
  */
 var testDisableSSL = function() {
   // Open a blank page so we don't have any error page shown
   controller.open("about:blank");
   controller.waitForPageLoad();
 
   PrefsAPI.openPreferencesDialog(prefDialogCallback);
 
-  controller.open("https://www.verisign.com");
+  controller.open("https://www.google.com");
   controller.waitForPageLoad(1000);
 
   // Verify "Secure Connection Failed" error page title
   var title = new elementslib.ID(controller.tabs.activeTab, "errorTitleText");
   controller.waitForElement(title, gTimeout);
   controller.assertJS("subject.errorTitle == 'Secure Connection Failed'",
                       {errorTitle: title.getNode().textContent});
 
@@ -76,17 +84,17 @@ var testDisableSSL = function() {
   controller.assertNode(new elementslib.ID(controller.tabs.activeTab, "errorTryAgain"));
 
   // Verify the error message is correct
   var text = new elementslib.ID(controller.tabs.activeTab, "errorShortDescText");
   controller.waitForElement(text, gTimeout);
   controller.assertJS("subject.errorMessage.indexOf('ssl_error_ssl_disabled') != -1",
                       {errorMessage: text.getNode().textContent});
 
-  controller.assertJS("subject.errorMessage.indexOf('www.verisign.com') != -1",
+  controller.assertJS("subject.errorMessage.indexOf('www.google.com') != -1",
                       {errorMessage: text.getNode().textContent});
 
   controller.assertJS("subject.errorMessage.indexOf('SSL protocol has been disabled') != -1",
                       {errorMessage: text.getNode().textContent});
 }
 
 /**
  * Disable SSL 3.0 and TLS for secure connections