gecko/testing/mozmill/tests/shared-modules/testUtilsAPI.js
Jeff Hammel c7edae7f0f Bug 605978 Land Mozmill 1.5.1 and tests into M-C r=ctalbert a=NPOTB
--HG--
rename : testing/mozmill/jsbridge-2.4.0/MANIFEST.in => testing/mozmill/jsbridge/MANIFEST.in
rename : testing/mozmill/jsbridge-2.4.0/jsbridge/__init__.py => testing/mozmill/jsbridge/jsbridge/__init__.py
rename : testing/mozmill/jsbridge-2.4.0/jsbridge/extension/chrome.manifest => testing/mozmill/jsbridge/jsbridge/extension/chrome.manifest
rename : testing/mozmill/jsbridge-2.4.0/jsbridge/extension/chrome/content/overlay.js => testing/mozmill/jsbridge/jsbridge/extension/chrome/content/overlay.js
rename : testing/mozmill/jsbridge-2.4.0/jsbridge/extension/chrome/content/overlay.xul => testing/mozmill/jsbridge/jsbridge/extension/chrome/content/overlay.xul
rename : testing/mozmill/jsbridge-2.4.0/jsbridge/extension/components/cmdarg.js => testing/mozmill/jsbridge/jsbridge/extension/components/cmdarg.js
rename : testing/mozmill/jsbridge-2.4.0/jsbridge/extension/install.rdf => testing/mozmill/jsbridge/jsbridge/extension/install.rdf
rename : testing/mozmill/jsbridge-2.4.0/jsbridge/extension/resource/modules/events.js => testing/mozmill/jsbridge/jsbridge/extension/resource/modules/events.js
rename : testing/mozmill/jsbridge-2.4.0/jsbridge/extension/resource/modules/init.js => testing/mozmill/jsbridge/jsbridge/extension/resource/modules/init.js
rename : testing/mozmill/jsbridge-2.4.0/jsbridge/extension/resource/modules/json2.js => testing/mozmill/jsbridge/jsbridge/extension/resource/modules/json2.js
rename : testing/mozmill/jsbridge-2.4.0/jsbridge/extension/resource/modules/server.js => testing/mozmill/jsbridge/jsbridge/extension/resource/modules/server.js
rename : testing/mozmill/jsbridge-2.4.0/jsbridge/jsobjects.py => testing/mozmill/jsbridge/jsbridge/jsobjects.py
rename : testing/mozmill/jsbridge-2.4.0/jsbridge/network.py => testing/mozmill/jsbridge/jsbridge/network.py
rename : testing/mozmill/jsbridge-2.4.0/setup.py => testing/mozmill/jsbridge/setup.py
rename : testing/mozmill/mozmill-1.5.0/MANIFEST.in => testing/mozmill/mozmill/MANIFEST.in
rename : testing/mozmill/mozmill-1.5.0/docs/Makefile => testing/mozmill/mozmill/docs/Makefile
rename : testing/mozmill/mozmill-1.5.0/docs/_build/doctrees/environment.pickle => testing/mozmill/mozmill/docs/_build/doctrees/environment.pickle
rename : testing/mozmill/mozmill-1.5.0/docs/_build/doctrees/index.doctree => testing/mozmill/mozmill/docs/_build/doctrees/index.doctree
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/_sources/index.txt => testing/mozmill/mozmill/docs/_build/html/_sources/index.txt
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/_static/contents.png => testing/mozmill/mozmill/docs/_build/html/_static/contents.png
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/_static/default.css => testing/mozmill/mozmill/docs/_build/html/_static/default.css
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/_static/doctools.js => testing/mozmill/mozmill/docs/_build/html/_static/doctools.js
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/_static/file.png => testing/mozmill/mozmill/docs/_build/html/_static/file.png
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/_static/jquery.js => testing/mozmill/mozmill/docs/_build/html/_static/jquery.js
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/_static/minus.png => testing/mozmill/mozmill/docs/_build/html/_static/minus.png
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/_static/navigation.png => testing/mozmill/mozmill/docs/_build/html/_static/navigation.png
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/_static/plus.png => testing/mozmill/mozmill/docs/_build/html/_static/plus.png
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/_static/pygments.css => testing/mozmill/mozmill/docs/_build/html/_static/pygments.css
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/_static/rightsidebar.css => testing/mozmill/mozmill/docs/_build/html/_static/rightsidebar.css
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/_static/searchtools.js => testing/mozmill/mozmill/docs/_build/html/_static/searchtools.js
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/_static/sphinxdoc.css => testing/mozmill/mozmill/docs/_build/html/_static/sphinxdoc.css
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/_static/stickysidebar.css => testing/mozmill/mozmill/docs/_build/html/_static/stickysidebar.css
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/_static/traditional.css => testing/mozmill/mozmill/docs/_build/html/_static/traditional.css
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/genindex.html => testing/mozmill/mozmill/docs/_build/html/genindex.html
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/index.html => testing/mozmill/mozmill/docs/_build/html/index.html
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/modindex.html => testing/mozmill/mozmill/docs/_build/html/modindex.html
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/objects.inv => testing/mozmill/mozmill/docs/_build/html/objects.inv
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/search.html => testing/mozmill/mozmill/docs/_build/html/search.html
rename : testing/mozmill/mozmill-1.5.0/docs/_build/html/searchindex.js => testing/mozmill/mozmill/docs/_build/html/searchindex.js
rename : testing/mozmill/mozmill-1.5.0/docs/conf.py => testing/mozmill/mozmill/docs/conf.py
rename : testing/mozmill/mozmill-1.5.0/docs/index.rst => testing/mozmill/mozmill/docs/index.rst
rename : testing/mozmill/mozmill-1.5.0/mozmill/__init__.py => testing/mozmill/mozmill/mozmill/__init__.py
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/build.xml => testing/mozmill/mozmill/mozmill/extension/build.xml
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/chrome-jar.manifest => testing/mozmill/mozmill/mozmill/extension/chrome-jar.manifest
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/chrome.manifest => testing/mozmill/mozmill/mozmill/extension/chrome.manifest
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/chrome.js => testing/mozmill/mozmill/mozmill/extension/content/chrome.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/css/fg.menu.css => testing/mozmill/mozmill/mozmill/extension/content/css/fg.menu.css
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/css/mozmill.css => testing/mozmill/mozmill/mozmill/extension/content/css/mozmill.css
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png => testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png => testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png => testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png => testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png => testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png => testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png => testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png => testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/css/smoothness/images/ui-icons_222222_256x240.png => testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-icons_222222_256x240.png
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/css/smoothness/images/ui-icons_2e83ff_256x240.png => testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-icons_2e83ff_256x240.png
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/css/smoothness/images/ui-icons_454545_256x240.png => testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-icons_454545_256x240.png
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/css/smoothness/images/ui-icons_888888_256x240.png => testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-icons_888888_256x240.png
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/css/smoothness/images/ui-icons_cd0a0a_256x240.png => testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-icons_cd0a0a_256x240.png
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/css/smoothness/jquery-ui-1.7.1.custom.css => testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/jquery-ui-1.7.1.custom.css
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/dx.js => testing/mozmill/mozmill/mozmill/extension/content/dx.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/dxwindow.xul => testing/mozmill/mozmill/mozmill/extension/content/dxwindow.xul
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/editor/bespin/BespinEmbedded.css => testing/mozmill/mozmill/mozmill/extension/content/editor/bespin/BespinEmbedded.css
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/editor/bespin/BespinEmbedded.js => testing/mozmill/mozmill/mozmill/extension/content/editor/bespin/BespinEmbedded.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/editor/bespin/BespinMain.js => testing/mozmill/mozmill/mozmill/extension/content/editor/bespin/BespinMain.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/editor/bespin/BespinWorker.js => testing/mozmill/mozmill/mozmill/extension/content/editor/bespin/BespinWorker.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/editor/bespin/resources/screen_theme/theme.less => testing/mozmill/mozmill/mozmill/extension/content/editor/bespin/resources/screen_theme/theme.less
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/editor/editor.js => testing/mozmill/mozmill/mozmill/extension/content/editor/editor.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/img/wmIcon.png => testing/mozmill/mozmill/mozmill/extension/content/img/wmIcon.png
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/inspector.js => testing/mozmill/mozmill/mozmill/extension/content/inspector.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/jquery/fg.menu.css => testing/mozmill/mozmill/mozmill/extension/content/jquery/fg.menu.css
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/jquery/fg.menu.js => testing/mozmill/mozmill/mozmill/extension/content/jquery/fg.menu.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/jquery/jquery-1.3.2.min.js => testing/mozmill/mozmill/mozmill/extension/content/jquery/jquery-1.3.2.min.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/jquery/jquery-ui-1.7.1.custom.min.js => testing/mozmill/mozmill/mozmill/extension/content/jquery/jquery-ui-1.7.1.custom.min.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/jquery/jquery.ui.core.js => testing/mozmill/mozmill/mozmill/extension/content/jquery/jquery.ui.core.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/jquery/jquery.ui.menu.js => testing/mozmill/mozmill/mozmill/extension/content/jquery/jquery.ui.menu.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/menus.js => testing/mozmill/mozmill/mozmill/extension/content/menus.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/mozmill.html => testing/mozmill/mozmill/mozmill/extension/content/mozmill.html
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/mozmill.js => testing/mozmill/mozmill/mozmill/extension/content/mozmill.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/mozmill.xul => testing/mozmill/mozmill/mozmill/extension/content/mozmill.xul
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/output.js => testing/mozmill/mozmill/mozmill/extension/content/output.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/overlay.js => testing/mozmill/mozmill/mozmill/extension/content/overlay.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/overlay.xul => testing/mozmill/mozmill/mozmill/extension/content/overlay.xul
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/overlay_tb.xul => testing/mozmill/mozmill/mozmill/extension/content/overlay_tb.xul
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/prefs.xul => testing/mozmill/mozmill/mozmill/extension/content/prefs.xul
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/rec.js => testing/mozmill/mozmill/mozmill/extension/content/rec.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/shell.js => testing/mozmill/mozmill/mozmill/extension/content/shell.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/shortcuts.js => testing/mozmill/mozmill/mozmill/extension/content/shortcuts.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/testwindow.xul => testing/mozmill/mozmill/mozmill/extension/content/testwindow.xul
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/content/ui.js => testing/mozmill/mozmill/mozmill/extension/content/ui.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/defaults/preferences/debug.js => testing/mozmill/mozmill/mozmill/extension/defaults/preferences/debug.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/install.rdf => testing/mozmill/mozmill/mozmill/extension/install.rdf
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/locale/en-US/mozmill.dtd => testing/mozmill/mozmill/mozmill/extension/locale/en-US/mozmill.dtd
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/locale/en-US/overlay.dtd => testing/mozmill/mozmill/mozmill/extension/locale/en-US/overlay.dtd
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/readme.txt => testing/mozmill/mozmill/mozmill/extension/readme.txt
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/resource/modules/controller.js => testing/mozmill/mozmill/mozmill/extension/resource/modules/controller.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/resource/modules/elementslib.js => testing/mozmill/mozmill/mozmill/extension/resource/modules/elementslib.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/resource/modules/events.js => testing/mozmill/mozmill/mozmill/extension/resource/modules/events.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/resource/modules/frame.js => testing/mozmill/mozmill/mozmill/extension/resource/modules/frame.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/resource/modules/init.js => testing/mozmill/mozmill/mozmill/extension/resource/modules/init.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/resource/modules/inspection.js => testing/mozmill/mozmill/mozmill/extension/resource/modules/inspection.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/resource/modules/jum.js => testing/mozmill/mozmill/mozmill/extension/resource/modules/jum.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/resource/modules/mozmill.js => testing/mozmill/mozmill/mozmill/extension/resource/modules/mozmill.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/resource/modules/utils.js => testing/mozmill/mozmill/mozmill/extension/resource/modules/utils.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/resource/stdlib/EventUtils.js => testing/mozmill/mozmill/mozmill/extension/resource/stdlib/EventUtils.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/resource/stdlib/arrays.js => testing/mozmill/mozmill/mozmill/extension/resource/stdlib/arrays.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/resource/stdlib/dom.js => testing/mozmill/mozmill/mozmill/extension/resource/stdlib/dom.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/resource/stdlib/httpd.js => testing/mozmill/mozmill/mozmill/extension/resource/stdlib/httpd.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/resource/stdlib/json2.js => testing/mozmill/mozmill/mozmill/extension/resource/stdlib/json2.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/resource/stdlib/objects.js => testing/mozmill/mozmill/mozmill/extension/resource/stdlib/objects.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/resource/stdlib/os.js => testing/mozmill/mozmill/mozmill/extension/resource/stdlib/os.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/resource/stdlib/strings.js => testing/mozmill/mozmill/mozmill/extension/resource/stdlib/strings.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/resource/stdlib/withs.js => testing/mozmill/mozmill/mozmill/extension/resource/stdlib/withs.js
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/skin/chrome.css => testing/mozmill/mozmill/mozmill/extension/skin/chrome.css
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/skin/overlay.css => testing/mozmill/mozmill/mozmill/extension/skin/overlay.css
rename : testing/mozmill/mozmill-1.5.0/mozmill/extension/zipexclude.lst => testing/mozmill/mozmill/mozmill/extension/zipexclude.lst
rename : testing/mozmill/mozmill-1.5.0/setup.py => testing/mozmill/mozmill/setup.py
rename : testing/mozmill/mozmill-1.5.0/test/test_python_callbacks_callbacks.py => testing/mozmill/mozmill/test/test_python_callbacks_callbacks.py
rename : testing/mozmill/mozrunner-2.5.1/mozrunner/__init__.py => testing/mozmill/mozrunner/mozrunner/__init__.py
rename : testing/mozmill/mozrunner-2.5.1/mozrunner/killableprocess.py => testing/mozmill/mozrunner/mozrunner/killableprocess.py
rename : testing/mozmill/mozrunner-2.5.1/mozrunner/qijo.py => testing/mozmill/mozrunner/mozrunner/qijo.py
rename : testing/mozmill/mozrunner-2.5.1/mozrunner/winprocess.py => testing/mozmill/mozrunner/mozrunner/winprocess.py
rename : testing/mozmill/mozrunner-2.5.1/mozrunner/wpk.py => testing/mozmill/mozrunner/mozrunner/wpk.py
rename : testing/mozmill/mozrunner-2.5.1/setup.py => testing/mozmill/mozrunner/setup.py
2010-10-21 13:15:58 -07:00

421 lines
12 KiB
JavaScript

/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is MozMill Test code.
*
* The Initial Developer of the Original Code is the Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2009
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Henrik Skupin <hskupin@mozilla.com>
* Anthony Hughes <ahughes@mozilla.com>
* M.-A. Darche <mozdev@cynode.org>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* 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 ***** */
/**
* @fileoverview
* The UtilsAPI offers various helper functions for any other API which is
* not already covered by another shared module.
*
* @version 1.0.3
*/
var MODULE_NAME = 'UtilsAPI';
const gTimeout = 5000;
/**
* Get application specific informations
* @see http://mxr.mozilla.org/mozilla-central/source/xpcom/system/nsIXULAppInfo.idl
*/
var appInfo = {
_service: null,
/**
* Get the application info service
* @returns XUL runtime object
* @type nsiXULRuntime
*/
get appInfo() {
if (!this._appInfo) {
this._service = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULAppInfo)
.QueryInterface(Ci.nsIXULRuntime);
}
return this._service;
},
/**
* Get the build id
* @returns Build id
* @type string
*/
get buildID() this.appInfo.appBuildID,
/**
* Get the application id
* @returns Application id
* @type string
*/
get ID() this.appInfo.ID,
/**
* Get the application name
* @returns Application name
* @type string
*/
get name() this.appInfo.name,
/**
* Get the operation system
* @returns Operation system name
* @type string
*/
get os() this.appInfo.OS,
/**
* Get the product vendor
* @returns Vendor name
* @type string
*/
get vendor() this.appInfo.vendor,
/**
* Get the application version
* @returns Application version
* @type string
*/
get version() this.appInfo.version,
/**
* Get the build id of the Gecko platform
* @returns Platform build id
* @type string
*/
get platformBuildID() this.appInfo.platformBuildID,
/**
* Get the version of the Gecko platform
* @returns Platform version
* @type string
*/
get platformVersion() this.appInfo.platformVersion,
/**
* Get the currently used locale
* @returns Current locale
* @type string
*/
get locale() {
var registry = Cc["@mozilla.org/chrome/chrome-registry;1"]
.getService(Ci.nsIXULChromeRegistry);
return registry.getSelectedLocale("global");
},
/**
* Get the user agent string
* @returns User agent
* @type string
*/
get userAgent() {
var window = mozmill.wm.getMostRecentWindow("navigator:browser");
if (window)
return window.navigator.userAgent;
return "";
}
};
/**
* Checks the visibility of an element.
* XXX: Mozmill doesn't check if an element is visible and also operates on
* elements which are invisible. (Bug 490548)
*
* @param {MozmillController} controller
* MozMillController of the window to operate on
* @param {ElemBase} elem
* Element to check its visibility
* @param {boolean} expectedVisibility
* Expected visibility state of the element
*/
function assertElementVisible(controller, elem, expectedVisibility) {
var element = elem.getNode();
var visible;
switch (element.nodeName) {
case 'panel':
visible = (element.state == 'open');
break;
default:
var style = controller.window.getComputedStyle(element, '');
var state = style.getPropertyValue('visibility');
visible = (state == 'visible');
}
controller.assertJS('subject.visible == subject.expectedVisibility', {
visible: visible,
expectedVisibility: expectedVisibility
});
}
/**
* Assert if the current URL is identical to the target URL.
* With this function also redirects can be tested.
*
* @param {MozmillController} controller
* MozMillController of the window to operate on
* @param {string} targetURL
* URL to check
*/
function assertLoadedUrlEqual(controller, targetUrl)
{
var locationBar = new elementslib.ID(controller.window.document, "urlbar");
var currentURL = locationBar.getNode().value;
// Load the target URL
controller.open(targetUrl);
controller.waitForPageLoad();
// Check the same web page has been opened
controller.waitForEval("subject.targetURL.value == subject.currentURL", gTimeout, 100,
{targetURL: locationBar.getNode(), currentURL: currentURL});
}
/**
* Close the context menu inside the content area of the currently open tab
*
* @param {MozmillController} controller
* MozMillController of the window to operate on
*/
function closeContentAreaContextMenu(controller)
{
var contextMenu = new elementslib.ID(controller.window.document, "contentAreaContextMenu");
controller.keypress(contextMenu, "VK_ESCAPE", {});
}
/**
* Run tests against a given search form
*
* @param {MozMillController} controller
* MozMillController of the window to operate on
* @param {ElemBase} searchField
* The HTML input form element to test
* @param {string} searchTerm
* The search term for the test
* @param {ElemBase} submitButton
* (Optional) The forms submit button
* @param {number} timeout
* The timeout value for the single tests
*/
function checkSearchField(controller, searchField, searchTerm, submitButton, timeout)
{
controller.waitThenClick(searchField, timeout);
controller.type(searchField, searchTerm);
if (submitButton != undefined) {
controller.waitThenClick(submitButton, timeout);
}
}
/**
* Create a new URI
*
* @param {string} spec
* The URI string in UTF-8 encoding.
* @param {string} originCharset
* The charset of the document from which this URI string originated.
* @param {string} baseURI
* If null, spec must specify an absolute URI. Otherwise, spec may be
* resolved relative to baseURI, depending on the protocol.
* @return A URI object
* @type nsIURI
*/
function createURI(spec, originCharset, baseURI)
{
let iosvc = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
return iosvc.newURI(spec, originCharset, baseURI);
}
/**
* Empty the clipboard by assigning an empty string
*/
function emptyClipboard() {
var clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"].
getService(Ci.nsIClipboardHelper);
clipboard.copyString("");
}
/**
* Format a URL by replacing all placeholders
*
* @param {string} prefName
* The preference name which contains the URL
* @return The formatted URL
* @type string
*/
function formatUrlPref(prefName)
{
var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Ci.nsIURLFormatter);
return formatter.formatURLPref(prefName);
}
/**
* Returns the default home page
*
* @return The URL of the default homepage
* @type string
*/
function getDefaultHomepage() {
var prefs = collector.getModule('PrefsAPI').preferences;
var prefValue = prefs.getPref("browser.startup.homepage", "",
true, Ci.nsIPrefLocalizedString);
return prefValue.data;
}
/**
* Returns the value of an individual entity in a DTD file.
*
* @param [string] urls
* Array of DTD urls.
* @param {string} entityId
* The ID of the entity to get the value of.
*
* @return The value of the requested entity
* @type string
*/
function getEntity(urls, entityId)
{
// Add xhtml11.dtd to prevent missing entity errors with XHTML files
urls.push("resource:///res/dtd/xhtml11.dtd");
// Build a string of external entities
var extEntities = "";
for (i = 0; i < urls.length; i++) {
extEntities += '<!ENTITY % dtd' + i + ' SYSTEM "' +
urls[i] + '">%dtd' + i + ';';
}
var parser = Cc["@mozilla.org/xmlextras/domparser;1"]
.createInstance(Ci.nsIDOMParser);
var header = '<?xml version="1.0"?><!DOCTYPE elem [' + extEntities + ']>';
var elem = '<elem id="elementID">&' + entityId + ';</elem>';
var doc = parser.parseFromString(header + elem, 'text/xml');
var elemNode = doc.querySelector('elem[id="elementID"]');
if (elemNode == null)
throw new Error(arguments.callee.name + ": Unknown entity - " + entityId);
return elemNode.textContent;
}
/**
* Returns the value of an individual property.
*
* @param {string} url
* URL of the string bundle.
* @param {string} prefName
* The property to get the value of.
*
* @return The value of the requested property
* @type string
*/
function getProperty(url, prefName)
{
var sbs = Cc["@mozilla.org/intl/stringbundle;1"]
.getService(Ci.nsIStringBundleService);
var bundle = sbs.createBundle(url);
try {
return bundle.GetStringFromName(prefName);
} catch (ex) {
throw new Error(arguments.callee.name + ": Unknown property - " + prefName);
}
}
/**
* Function to handle non-modal windows
*
* @param {string} type
* Specifies how to check for the new window (possible values: type or title)
* @param {string} text
* The window type of title string to search for
* @param {function} callback (optional)
* Callback function to call for window specific tests
* @param {boolean} dontClose (optional)
* Doens't close the window after the return from the callback handler
* @returns The MozMillController of the window (if the window hasn't been closed)
*/
function handleWindow(type, text, callback, dontClose) {
var func_ptr = null;
var window = null;
if (dontClose === undefined)
dontClose = false;
// Set the window opener function to use depending on the type
switch (type) {
case "type":
func_ptr = mozmill.utils.getWindowByType;
break;
case "title":
func_ptr = mozmill.utils.getWindowByTitle;
break;
default:
throw new Error(arguments.callee.name + ": Unknown opener type - " + type);
}
try {
// Wait until the window has been opened
mozmill.controller.waitForEval("subject.getWindow(subject.text) != null", gTimeout, 100,
{getWindow: func_ptr, text: text});
window = func_ptr(text);
// XXX: We still have to find a reliable way to wait until the new window
// content has been finished loading. Let's wait for now.
var ctrl = new mozmill.controller.MozMillController(window);
ctrl.sleep(200);
if (callback)
callback(ctrl);
} finally {
// If a failure happened make sure we close the window if wanted
if (dontClose != true & window != null) {
window.close();
mozmill.controller.waitForEval("subject.getWindow(subject.text) != subject.window",
gTimeout, 100,
{getWindow: func_ptr, text: text, window: window});
return null;
}
return ctrl;
}
}