Bug 724448. (Av1) tests cleanup for browser_367052.js and browser_bug431826.js. r=neil.
authorSerge Gautherie <sgautherie.bz@free.fr>
Mon, 06 Feb 2012 19:44:19 +0100
changeset 10784 3678411e1ba58f0e8b17c237617b6a4e849458b3
parent 10783 61b227b45ca935b30b2455f5f591cd08b4389d3b
child 10785 a0026dd945ae4354f3e4c010aa6392b4ad40c765
push id463
push userbugzilla@standard8.plus.com
push dateTue, 24 Apr 2012 17:34:51 +0000
treeherdercomm-beta@e53588e8f7b0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil
bugs724448, 431826
Bug 724448. (Av1) tests cleanup for browser_367052.js and browser_bug431826.js. r=neil.
suite/common/tests/browser/browser_367052.js
suite/common/tests/browser/browser_bug431826.js
--- a/suite/common/tests/browser/browser_367052.js
+++ b/suite/common/tests/browser/browser_367052.js
@@ -31,41 +31,40 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   /** Test for Bug 367052 **/
-  
+
   waitForExplicitFinish();
-  
+
   // make sure that the next closed tab will increase getClosedTabCount
   let max_tabs_undo = Services.prefs.getIntPref("browser.sessionstore.max_tabs_undo");
   Services.prefs.setIntPref("browser.sessionstore.max_tabs_undo", max_tabs_undo + 1);
   let closedTabCount = ss.getClosedTabCount(window);
-  
+
   // restore a blank tab
   let tab = getBrowser().addTab("about:");
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     this.removeEventListener("load", arguments.callee, true);
-    
-    let browser = getBrowser().getBrowserForTab(tab);
-    let history = browser.webNavigation.sessionHistory;
+
+    let history = tab.linkedBrowser.webNavigation.sessionHistory;
     ok(history.count >= 1, "the new tab does have at least one history entry");
-    
+
     ss.setTabState(tab, '{ "entries": [] }');
     tab.linkedBrowser.addEventListener("load", function(aEvent) {
       this.removeEventListener("load", arguments.callee, true);
       ok(history.count == 0, "the tab was restored without any history whatsoever");
-      
+
       getBrowser().removeTab(tab);
       ok(ss.getClosedTabCount(window) == closedTabCount,
          "The closed blank tab wasn't added to Recently Closed Tabs");
-      
+
       // clean up
       if (Services.prefs.prefHasUserValue("browser.sessionstore.max_tabs_undo"))
         Services.prefs.clearUserPref("browser.sessionstore.max_tabs_undo");
       finish();
     }, true);
   }, true);
 }
--- a/suite/common/tests/browser/browser_bug431826.js
+++ b/suite/common/tests/browser/browser_bug431826.js
@@ -16,17 +16,16 @@ function testBrokenCert() {
 
   // Confirm that the expert section is collapsed
   var expertDiv = gBrowser.contentDocument.getElementById("expertContent");
   ok(expertDiv, "Expert content div should exist");
   ok(expertDiv.hasAttribute("collapsed"), "Expert content should be collapsed by default");
 
   // Tweak the expert mode pref
   Services.prefs.setBoolPref("browser.xul.error_pages.expert_bad_cert", true);
-  // Application.prefs.setValue("browser.xul.error_pages.expert_bad_cert", true);
 
   window.addEventListener("DOMContentLoaded", testExpertPref, true);
   getBrowser().reload();
 }
 
 function testExpertPref() {
   window.removeEventListener("DOMContentLoaded", testExpertPref, true);
 
@@ -34,11 +33,10 @@ function testExpertPref() {
   var technicalDiv = gBrowser.contentDocument.getElementById("technicalContent");
   ok(!expertDiv.hasAttribute("collapsed"), "Expert content should not be collapsed with the expert mode pref set");
   ok(!technicalDiv.hasAttribute("collapsed"), "Technical content should not be collapsed with the expert mode pref set");
 
   // Clean up
   getBrowser().removeCurrentTab();
   if (Services.prefs.prefHasUserValue("browser.xul.error_pages.expert_bad_cert"))
     Services.prefs.clearUserPref("browser.xul.error_pages.expert_bad_cert");
-  // Application.prefs.get("browser.xul.error_pages.expert_bad_cert").reset();
   finish();
 }