Fix unit-test failures from bug 746320. r+a=unit-test bustage-fix. RELEASE_BASE_20120420
authorMark Banner <bugzilla@standard8.plus.com>
Fri, 20 Apr 2012 14:32:03 +0100
changeset 10761 d189b612682af89f21aa292890e007dd0666fbb0
parent 10760 47a7b40f9e66f550017146dfa8298e857b1953d4
child 10762 43ddf733f0d06beea717c757742e435ab98b4d13
push id461
push userbugzilla@standard8.plus.com
push dateFri, 20 Apr 2012 13:32:13 +0000
treeherdercomm-beta@d189b612682a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs746320
Fix unit-test failures from bug 746320. r+a=unit-test bustage-fix.
mail/test/mozmill/content-tabs/test-content-tab.js
mail/test/mozmill/content-tabs/test-plugin-blocked.js
mail/test/mozmill/content-tabs/test-plugin-crashing.js
mail/test/mozmill/content-tabs/test-plugin-outdated.js
mail/test/mozmill/content-tabs/test-plugin-unknown.js
--- a/mail/test/mozmill/content-tabs/test-content-tab.js
+++ b/mail/test/mozmill/content-tabs/test-content-tab.js
@@ -65,30 +65,32 @@ var setupModule = function (module) {
   let wh = collector.getModule('window-helpers');
   wh.installInto(module);
 };
 
 function test_content_tab_open() {
   // Set the pref so that what's new opens a local url
   Services.prefs.setCharPref("mailnews.start_page.override_url", whatsUrl);
 
-  let tab = open_content_tab_with_click(mc.menus.helpMenu.whatsNew, whatsUrl);
+  let tab = open_content_tab_with_url(whatsUrl);
+  //let tab = open_content_tab_with_click(mc.menus.helpMenu.whatsNew, whatsUrl);
 
   assert_tab_has_title(tab, "What's New Content Test");
   // Check the location of the what's new image, this is via the link element
   // and therefore should be set and not favicon.png.
   assert_content_tab_has_favicon(tab, url + "whatsnew.png");
 
   // Check that window.content is set up correctly wrt content-primary and
   // content-targetable.
   if (mc.window.content.location != whatsUrl)
     throw new Error("window.content is not set to the url loaded, incorrect type=\"...\"?");
 
 }
 
+
 /**
  * Just make sure that the context menu does what we expect in content tabs wrt.
  * spell checking options.
  */
 function test_spellcheck_in_content_tabs() {
   let tabmail = mc.tabmail;
   let w = tabmail.selectedTab.browser.contentWindow;
   let textarea = w.document.getElementsByTagName("textarea")[0];
@@ -150,17 +152,18 @@ function test_content_tab_context_menu()
   assert_not_equals(mailContext.firstChild.label, "Click me!");
   assert_element_not_visible("page-menu-separator");
   close_popup(mc, new elementslib.Elem(mailContext));
 }
 
 function test_content_tab_open_same() {
   let preCount = mc.tabmail.tabContainer.childNodes.length;
 
-  mc.click(new elementslib.Elem(mc.menus.helpMenu.whatsNew));
+  mc.window.openContentTab(whatsUrl);
+  //  mc.click(new elementslib.Elem(mc.menus.helpMenu.whatsNew));
 
   controller.sleep(0);
 
   if (mc.tabmail.tabContainer.childNodes.length != preCount)
     throw new Error("A new content tab was opened when it shouldn't have been");
 
   // Double-check browser is still the same.
   if (mc.window.content.location != whatsUrl)
@@ -168,17 +171,18 @@ function test_content_tab_open_same() {
 }
 
 function test_content_tab_default_favicon() {
   const whatsUrl1 = url + "whatsnew1.html";
 
   // Set the pref so that what's new opens a local url
   Services.prefs.setCharPref("mailnews.start_page.override_url", whatsUrl1);
 
-  let tab = open_content_tab_with_click(mc.menus.helpMenu.whatsNew, whatsUrl1);
+  let tab = open_content_tab_with_url(whatsUrl1);
+  //  let tab = open_content_tab_with_click(mc.menus.helpMenu.whatsNew, whatsUrl1);
 
   assert_tab_has_title(tab, "What's New Content Test 1");
   // Check the location of the favicon, this should be the site favicon in this
   // test.
   assert_content_tab_has_favicon(tab, url + "favicon.ico");
 }
 
 function test_content_tab_onbeforeunload() {
--- a/mail/test/mozmill/content-tabs/test-plugin-blocked.js
+++ b/mail/test/mozmill/content-tabs/test-plugin-blocked.js
@@ -100,18 +100,17 @@ function teardownTest() {
 /* Tests that the notification bar appears for plugins that
  * are blocklisted.  Ensures that the notification bar gives
  * links to the human-readable blocklist, as well as the
  * plugin update page.
  */
 function test_blocklisted_plugin_notification() {
   // Prepare to capture the notification bar
   NotificationWatcher.planForNotification(mc);
-  let pluginTab = open_content_tab_with_click(mc.menus.helpMenu.whatsNew,
-                                              kPluginUrl);
+  let pluginTab = open_content_tab_with_url(kPluginUrl);
   NotificationWatcher.waitForNotification(mc);
 
   // If we got here, then the notification bar appeared.  Now
   // let's make sure it displayed the right message.
   let notificationBar = get_notification_bar_for_tab(mc.tabmail.selectedTab);
   assert_not_equals(null, notificationBar, "Could not get notification bar");
   let blNotification = notificationBar.getNotificationWithValue("blocked-plugins");
   assert_not_equals(null, blNotification, "Notification value was not correct");
--- a/mail/test/mozmill/content-tabs/test-plugin-crashing.js
+++ b/mail/test/mozmill/content-tabs/test-plugin-crashing.js
@@ -106,17 +106,17 @@ function setupModule(module) {
 };
 
 function teardownModule(module) {
   Services.prefs.setCharPref(kStartPagePref, gOldStartPage);
   Services.prefs.setCharPref(kPluginCrashDocPref, gOldPluginCrashDocPage);
 }
 
 function setupTest() {
-  let tab = open_content_tab_with_click(mc.menus.helpMenu.whatsNew, kPluginUrl);
+  let tab = open_content_tab_with_url(kPluginUrl);
   assert_tab_has_title(tab, "Plugin Test");
 
   // Check that window.content is set up correctly wrt content-primary and
   // content-targetable.
   if (mc.window.content.location != kPluginUrl)
     throw new Error("window.content is not set to the url loaded, incorrect type=\"...\"?");
 
   gContentWindow = mc.tabmail.selectedTab.browser.contentWindow;
--- a/mail/test/mozmill/content-tabs/test-plugin-outdated.js
+++ b/mail/test/mozmill/content-tabs/test-plugin-outdated.js
@@ -122,18 +122,17 @@ function teardownModule(module) {
   // Cause a reload of blocklist.xml
   Services.prefs.setBoolPref(kBlEnabledPref, false);
   Services.prefs.setBoolPref(kBlEnabledPref, true);
 }
 
 function test_outdated_plugin_notification() {
   // Prepare to capture the notification bar
   NotificationWatcher.planForNotification(mc);
-  let pluginTab = open_content_tab_with_click(mc.menus.helpMenu.whatsNew,
-                                              kPluginUrl);
+  let pluginTab = open_content_tab_with_url(kPluginUrl);
   NotificationWatcher.waitForNotification(mc);
 
   let notificationBar = get_notification_bar_for_tab(mc.tabmail.selectedTab);
   assert_not_equals(null, notificationBar, "Could not get notification bar");
   let notifValue = notificationBar.getNotificationWithValue("outdated-plugins");
   assert_not_equals(null, notifValue, "Notification value was not correct");
 
   // buttons[0] should be the "update my plugins" button.
--- a/mail/test/mozmill/content-tabs/test-plugin-unknown.js
+++ b/mail/test/mozmill/content-tabs/test-plugin-unknown.js
@@ -77,17 +77,18 @@ function setupModule(module) {
   gTabmail = mc.tabmail;
 };
 
 function teardownModule(module) {
   Services.prefs.setCharPref(kStartPagePref, gOldStartPage);
 }
 
 function openPluginTab() {
-  let tab = open_content_tab_with_click(mc.menus.helpMenu.whatsNew, kPluginUrl);
+  //let tab = open_content_tab_with_click(mc.menus.helpMenu.whatsNew, kPluginUrl);
+  let tab = open_content_tab_with_url(kPluginUrl);
   assert_tab_has_title(tab, "Unknown Plugin Test");
   assert_content_tab_has_url(tab, kPluginUrl);
 
   gContentWindow = gTabmail.selectedTab.browser.contentWindow;
   gJSObject = gContentWindow.wrappedJSObject;
 
   // Strangely, in order to manipulate the embedded plugin,
   // we have to use getElementById within the context of the