Bug 538875 - Remove |mainController| from Mozmill tests, use mc everywhere instead. r=asuth

--HG--
extra : rebase_source : 9cf6481e36d7bb4e1ea1d6e3119d5a1e42192603
This commit is contained in:
Siddharth Agarwal 2010-01-12 00:04:37 +05:30
Родитель 348d095436
Коммит f6e60db928
5 изменённых файлов: 15 добавлений и 18 удалений

Просмотреть файл

@ -10,19 +10,19 @@ Components.utils.import('resource://mozmill/modules/mozmill.js', mozmill);
var controller = {};
Components.utils.import('resource://mozmill/modules/controller.js', controller);
var mainController = null;
var mc = null;
var setupModule = function(module) {
mainController = mozmill.getMail3PaneController();
mc = mozmill.getMail3PaneController();
controller.sleep(10000);
};
var test_start = function() {
// We have to do this manually, MozMill doesn't have a function for non-browser windows.
mainController.click(new elementslib.Elem(mainController.window.document.getElementById("button-address")));
mainController.click(new elementslib.Elem(mainController.window.document.getElementById("button-newmsg")));
mc.click(new elementslib.Elem(mc.window.document.getElementById("button-address")));
mc.click(new elementslib.Elem(mc.window.document.getElementById("button-newmsg")));
mainController.sleep(5000);
mc.sleep(5000);
}
var test_addressBook = function() {
@ -39,5 +39,5 @@ var test_compose = function() {
}
var test_shutdown = function() {
mainController.sleep(5000);
mc.sleep(5000);
}

Просмотреть файл

@ -49,7 +49,6 @@ var elementslib = {};
Components.utils.import('resource://mozmill/modules/elementslib.js', elementslib);
var windowHelper;
var mainController = null;
var mc;
// RELATIVE_ROOT messes with the collector, so we have to bring the path back
@ -59,7 +58,7 @@ var whatsUrl = url + "whatsnew.html";
var setupModule = function (module) {
windowHelper = collector.getModule('window-helpers');
mc = mainController = windowHelper.wait_for_existing_window("mail:3pane");
mc = windowHelper.wait_for_existing_window("mail:3pane");
windowHelper.installInto(module);
windowHelper.augment_controller(mc);
};

Просмотреть файл

@ -52,8 +52,7 @@ Components.utils.import('resource://mozmill/modules/controller.js', controller);
var mozmill = {}; Components.utils.import('resource://mozmill/modules/mozmill.js', mozmill);
var elementslib = {}; Components.utils.import('resource://mozmill/modules/elementslib.js', elementslib);
// The main controller and an easy alias.
var mainController = null;
// The main controller.
var mc;
// The windowHelper module.
@ -67,7 +66,7 @@ var url = collector.addHttpResource('../cookies/html', 'cookies');
function setupModule(module) {
windowHelper = collector.getModule('window-helpers');
mc = mainController = windowHelper.wait_for_existing_window("mail:3pane");
mc = windowHelper.wait_for_existing_window("mail:3pane");
windowHelper.augment_controller(mc);
}

Просмотреть файл

@ -259,7 +259,7 @@ function test_search_mode_persistence_subject_to_cc_filter()
plan_for_new_window("mail:3pane");
_open_3pane_window();
mc = mainController = wait_for_new_window("mail:3pane");
mc = wait_for_new_window("mail:3pane");
// We don't need the search window any more
plan_for_window_close(swc);

Просмотреть файл

@ -90,14 +90,13 @@ const DO_NOT_EXPORT = {
const EXPORT_VIA_GETTER_SETTER = {
// These should be getters and setters instead of direct property accesses so
// that setting them reflects across scopes.
mainController: true, mc: true,
mc: true,
};
var Application = Cc["@mozilla.org/steel/application;1"]
.getService(Ci.steelIApplication);
var mainController = null;
/** convenience shorthand for the mainController. */
/** The controller for the main 3-pane window. */
var mc;
/** the index of the current 'other' tab */
var otherTab;
@ -167,7 +166,7 @@ function setupModule() {
// use window-helper's augment_controller method to get our extra good stuff
// we need.
windowHelper = collector.getModule('window-helpers');
mc = mainController = windowHelper.wait_for_existing_window("mail:3pane");
mc = windowHelper.wait_for_existing_window("mail:3pane");
windowHelper.augment_controller(mc);
setupAccountStuff();
@ -407,7 +406,7 @@ function display_message_in_folder_tab(aMsgHdr, aExpectNew3Pane) {
windowHelper.plan_for_new_window("mail:3pane");
MailUtils.displayMessageInFolderTab(aMsgHdr);
if (aExpectNew3Pane)
mc = mainController = windowHelper.wait_for_new_window("mail:3pane");
mc = windowHelper.wait_for_new_window("mail:3pane");
wait_for_message_display_completion(mc, true);
@ -1207,7 +1206,7 @@ function wait_for_folder_events() {
*
* @param aSynSets Either a single SyntheticMessageSet or a list of them.
* @param aController Optional controller, which we get the folderDisplay
* property from. If omitted, we use the mc (mainController).
* property from. If omitted, we use mc.
*/
function assert_messages_in_view(aSynSets, aController) {
if (aController === undefined)