gecko/services/sync/tests/tps/mozmill_sanity2.js
Jonathan Griffin 513009edb0 Bug 678628 - allow TPS to run Mozmill tests, f=philikon, a=testonly, DONTBUILD
--HG--
rename : services/sync/tps/chrome.manifest => services/sync/tps/extensions/tps/chrome.manifest
rename : services/sync/tps/components/tps-cmdline.js => services/sync/tps/extensions/tps/components/tps-cmdline.js
rename : services/sync/tps/install.rdf => services/sync/tps/extensions/tps/install.rdf
rename : services/sync/tps/modules/bookmarks.jsm => services/sync/tps/extensions/tps/modules/bookmarks.jsm
rename : services/sync/tps/modules/forms.jsm => services/sync/tps/extensions/tps/modules/forms.jsm
rename : services/sync/tps/modules/history.jsm => services/sync/tps/extensions/tps/modules/history.jsm
rename : services/sync/tps/modules/logger.jsm => services/sync/tps/extensions/tps/modules/logger.jsm
rename : services/sync/tps/modules/passwords.jsm => services/sync/tps/extensions/tps/modules/passwords.jsm
rename : services/sync/tps/modules/prefs.jsm => services/sync/tps/extensions/tps/modules/prefs.jsm
rename : services/sync/tps/modules/quit.js => services/sync/tps/extensions/tps/modules/quit.js
rename : services/sync/tps/modules/tabs.jsm => services/sync/tps/extensions/tps/modules/tabs.jsm
rename : services/sync/tps/modules/tps.jsm => services/sync/tps/extensions/tps/modules/tps.jsm
extra : rebase_source : d4eed9a707ffe801de9b1bb4e6f08d31e670eec4
2011-08-22 14:27:25 -07:00

54 lines
2.7 KiB
JavaScript

/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
var jum = {}; Components.utils.import('resource://mozmill/modules/jum.js', jum);
var setupModule = function(module) {
module.controller = mozmill.getBrowserController();
};
var testGetNode = function() {
controller.open("about:support");
controller.waitForPageLoad();
var appbox = new elementslib.ID(controller.tabs.activeTab, "application-box");
jum.assert(appbox.getNode().innerHTML == 'Firefox', 'correct app name');
};
const NAV_BAR = '/id("main-window")/id("tab-view-deck")/{"flex":"1"}' +
'/id("navigator-toolbox")/id("nav-bar")';
const SEARCH_BAR = NAV_BAR + '/id("search-container")/id("searchbar")';
const SEARCH_TEXTBOX = SEARCH_BAR + '/anon({"anonid":"searchbar-textbox"})';
const SEARCH_DROPDOWN = SEARCH_TEXTBOX + '/[0]/anon({"anonid":"searchbar-engine-button"})';
const SEARCH_POPUP = SEARCH_DROPDOWN + '/anon({"anonid":"searchbar-popup"})';
const SEARCH_INPUT = SEARCH_TEXTBOX + '/anon({"class":"autocomplete-textbox-container"})' +
'/anon({"anonid":"textbox-input-box"})' +
'/anon({"anonid":"input"})';
const SEARCH_CONTEXT = SEARCH_TEXTBOX + '/anon({"anonid":"textbox-input-box"})' +
'/anon({"anonid":"input-box-contextmenu"})';
const SEARCH_GO_BUTTON = SEARCH_TEXTBOX + '/anon({"class":"search-go-container"})' +
'/anon({"class":"search-go-button"})';
const SEARCH_AUTOCOMPLETE = '/id("main-window")/id("mainPopupSet")/id("PopupAutoComplete")';
var testLookupExpressions = function() {
var item;
item = new elementslib.Lookup(controller.window.document, NAV_BAR);
controller.click(item);
item = new elementslib.Lookup(controller.window.document, SEARCH_BAR);
controller.click(item);
item = new elementslib.Lookup(controller.window.document, SEARCH_TEXTBOX);
controller.click(item);
item = new elementslib.Lookup(controller.window.document, SEARCH_DROPDOWN);
controller.click(item);
item = new elementslib.Lookup(controller.window.document, SEARCH_POPUP);
controller.click(item);
item = new elementslib.Lookup(controller.window.document, SEARCH_INPUT);
controller.click(item);
item = new elementslib.Lookup(controller.window.document, SEARCH_CONTEXT);
controller.click(item);
item = new elementslib.Lookup(controller.window.document, SEARCH_GO_BUTTON);
controller.click(item);
item = new elementslib.Lookup(controller.window.document, SEARCH_AUTOCOMPLETE);
controller.click(item);
};