Bug 612892 - Fix some timeouts and remove unwanted fragile tests [r=mbrubeck]
authorMark Finkle <mfinkle@mozilla.com>
Wed, 17 Nov 2010 11:27:42 -0500
changeset 2413 8495bbf358e332f036fe6854498020d5c3a5889b
parent 2412 b6d3914bb0c4d34ea3315f79ea56492d2d3e8a22
child 2414 6a43cd41cf25593e9c0b448c99b4114e80c1c1f8
push id2037
push usermfinkle@mozilla.com
push dateWed, 17 Nov 2010 16:22:48 +0000
reviewersmbrubeck
bugs612892
Bug 612892 - Fix some timeouts and remove unwanted fragile tests [r=mbrubeck]
chrome/tests/browser_awesomescreen.js
chrome/tests/browser_bookmarks_star.js
chrome/tests/browser_preferences_text.js
--- a/chrome/tests/browser_awesomescreen.js
+++ b/chrome/tests/browser_awesomescreen.js
@@ -8,16 +8,17 @@ let testURL_01 = chromeRoot + "browser_b
 let gTests = [];
 let gCurrentTest = null;
 let Panels = [AllPagesList, HistoryList, BookmarkList];
 
 function test() {
   // The "runNextTest" approach is async, so we need to call "waitForExplicitFinish()"
   // We call "finish()" when the tests are finished
   waitForExplicitFinish();
+  requestLongerTimeout(2);
 
   // Start the tests
   setTimeout(runNextTest, 200);
 }
 
 //------------------------------------------------------------------------------
 // Iterating tests by shifting test out one by one as runNextTest is called.
 function runNextTest() {
--- a/chrome/tests/browser_bookmarks_star.js
+++ b/chrome/tests/browser_bookmarks_star.js
@@ -202,20 +202,17 @@ gTests.push({
     let editbutton = document.getElementById("bookmark-popup-edit");
     editbutton.click();
     
     waitFor(gCurrentTest.onEditorReady, function() { return document.getElementById("bookmark-item").isEditing == true; });
   },
 
   onEditorReady: function() {
     let bookmarkitem = document.getElementById("bookmark-item");    
-    EventUtils.synthesizeMouse(bookmarkitem, bookmarkitem.clientWidth / 2, bookmarkitem.clientHeight / 2, {});
-
-    let uritextbox = document.getAnonymousElementByAttribute(bookmarkitem, "anonid", "uri");
-    uritextbox.value = testURL_01;
+    bookmarkitem.spec = testURL_01;
 
     let donebutton = document.getAnonymousElementByAttribute(bookmarkitem, "anonid", "done-button");
     donebutton.click();
     
     waitFor(gCurrentTest.onEditorDone, function() { return document.getElementById("bookmark-container").hidden == true; });
   },
 
   onEditorDone: function() {
--- a/chrome/tests/browser_preferences_text.js
+++ b/chrome/tests/browser_preferences_text.js
@@ -25,21 +25,16 @@ function getPreferencesElements() {
    prefElements.panelContainer = document.getElementById("panel-container");
    prefElements.homeButton = document.getElementById("prefs-homepage-options");
    prefElements.doneButton = document.getElementById("select-buttons-done");
    prefElements.homePageControl = document.getElementById("prefs-homepage");
    prefElements.selectContainer = document.getElementById("menulist-container");
    return prefElements;
 }
 
-function getHeight(element){
-  let style = window.getComputedStyle(element, null);
-  return style.height;
-}
-
 function test() {
   // The "runNextTest" approach is async, so we need to call "waitForExplicitFinish()"
   // We call "finish()" when the tests are finished
   waitForExplicitFinish();
 
   // Start the tests
   runNextTest();
 }
@@ -126,28 +121,14 @@ gTests.push({
     // Checkbox or radiobutton?
 
     // Check for *Clear Private Data*
     let clearData = expected.clearDataButton;
     var clearDataRegion = prefsPrivacy.lastChild;
     var clearDataButton = document.getElementById(clearData.element_id);
     is(clearDataButton.tagName, clearData.tagName, "Check for Clear Private Data button type");
 
-    // 3. Verify content & privacy and security reasons are gray and of same height
-    // Check for height
-    let aboutRegionHeight = getHeight(aboutRegion);
-    let imageRegionHeight = getHeight(imageRegion);
-    let cookiesRegionHeight = getHeight(cookiesRegion);
-
-    ok(aboutRegionHeight == getHeight(homepageRegion), "The About Page and the Fennec Start are of same height");
-    ok(imageRegionHeight == getHeight(jsRegion), "The fields of Content region are of same height");
-    todo((cookiesRegionHeight == getHeight(passwordsRegion)) && (cookiesRegionHeight == getHeight(clearDataRegion)),
-       "The fields of Privacy & Security are of same height");
-    todo(aboutRegionHeight == imageRegionHeight, "The fields of Content Region and above are of same height");
-    todo(aboutRegionHeight == cookiesRegionHeight, "The fields of Privacy & Security and above are of same height");
-    ok(imageRegionHeight == cookiesRegionHeight, "The fields of Content and Privacy & Security are of same height");
-
     prefs.panelClose.click()
     is(document.getElementById("panel-container").hidden, true, "Preferences panel should be closed");
     runNextTest();
   }
 });