Bug 543800 Package chrome style tests into .jar file for Android testing r=ctalbert a=NPOTB

This commit is contained in:
Joel Maher 2010-09-30 16:49:24 -07:00
Родитель 1f60168d52
Коммит 8543ff90e4
62 изменённых файлов: 201 добавлений и 91 удалений

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

@ -73,10 +73,10 @@
var jar = getJar(rootDir);
if (jar) {
var tmpdir = extractJarToTmp(jar);
rootDir = "file://" + tmpdir.path;
rootDir = "file://" + tmpdir.path + '/';
}
var url = rootDir + "/scroll.html#link1";
var url = rootDir + "scroll.html#link1";
var tabBrowser = document.getElementById("tabBrowser");
tabBrowser.loadURI(url);
}

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

@ -39,7 +39,7 @@
}
var rootDir = getRootDirectory(window.location.href);
var href = rootDir.path + "/foo";
var href = rootDir.path + "foo";
// roles that can't live as nsHTMLLinkAccessibles
testValue("aria_menuitem_link", "");

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

@ -11,8 +11,8 @@ function test()
// Now run the tests again and then close C.
// The test results does not matter, all this is just to exercise some code to
// catch assertions or crashes.
var uri = "chrome://mochikit/content/browser/" +
"browser/base/content/test/browser_tab_dragdrop2_frame1.xul";
var chromeroot = getRootDirectory(gTestPath);
var uri = chromeroot + "browser_tab_dragdrop2_frame1.xul";
let window_B = openDialog(location, "_blank", "chrome,all,dialog=no,left=200,top=200,width=200,height=200", uri);
window_B.addEventListener("load", function(aEvent) {
window_B.removeEventListener("load", arguments.callee, false);

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

@ -43,9 +43,9 @@ function test() {
let jar = getJar(rootDir);
if (jar) {
let tmpdir = extractJarToTmp(jar);
rootDir = "file://" + tmpdir.path;
rootDir = "file://" + tmpdir.path + '/';
}
loader.loadSubScript(rootDir + "/privacypane_tests.js", this);
loader.loadSubScript(rootDir + "privacypane_tests.js", this);
run_test_subset([
test_pane_visibility,

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

@ -43,9 +43,9 @@ function test() {
let jar = getJar(rootDir);
if (jar) {
let tmpdir = extractJarToTmp(jar);
rootDir = "file://" + tmpdir.path;
rootDir = "file://" + tmpdir.path + '/';
}
loader.loadSubScript(rootDir + "/privacypane_tests.js", this);
loader.loadSubScript(rootDir + "privacypane_tests.js", this);
run_test_subset([
test_historymode_retention("remember", undefined),

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

@ -42,9 +42,9 @@ function test() {
let jar = getJar(rootDir);
if (jar) {
let tmpdir = extractJarToTmp(jar);
rootDir = "file://" + tmpdir.path;
rootDir = "file://" + tmpdir.path + '/';
}
loader.loadSubScript(rootDir + "/privacypane_tests.js", this);
loader.loadSubScript(rootDir + "privacypane_tests.js", this);
run_test_subset([
test_custom_retention("rememberHistory", "remember"),

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

@ -42,9 +42,9 @@ function test() {
let jar = getJar(rootDir);
if (jar) {
let tmpdir = extractJarToTmp(jar);
rootDir = "file://" + tmpdir.path;
rootDir = "file://" + tmpdir.path + '/';
}
loader.loadSubScript(rootDir + "/privacypane_tests.js", this);
loader.loadSubScript(rootDir + "privacypane_tests.js", this);
run_test_subset([
test_custom_retention("acceptCookies", "remember"),

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

@ -42,9 +42,9 @@ function test() {
let jar = getJar(rootDir);
if (jar) {
let tmpdir = extractJarToTmp(jar);
rootDir = "file://" + tmpdir.path;
rootDir = "file://" + tmpdir.path + '/';
}
loader.loadSubScript(rootDir + "/privacypane_tests.js", this);
loader.loadSubScript(rootDir + "privacypane_tests.js", this);
run_test_subset([
test_locbar_suggestion_retention(-1, undefined),

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

@ -42,9 +42,9 @@ function test() {
let jar = getJar(rootDir);
if (jar) {
let tmpdir = extractJarToTmp(jar);
rootDir = "file://" + tmpdir.path;
rootDir = "file://" + tmpdir.path + '/';
}
loader.loadSubScript(rootDir + "/privacypane_tests.js", this);
loader.loadSubScript(rootDir + "privacypane_tests.js", this);
run_test_subset([
test_privatebrowsing_toggle,

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

@ -42,9 +42,9 @@ function test() {
let jar = getJar(rootDir);
if (jar) {
let tmpdir = extractJarToTmp(jar);
rootDir = "file://" + tmpdir.path;
rootDir = "file://" + tmpdir.path + '/';
}
loader.loadSubScript(rootDir + "/privacypane_tests.js", this);
loader.loadSubScript(rootDir + "privacypane_tests.js", this);
run_test_subset([
test_privatebrowsing_ui,

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

@ -41,9 +41,9 @@ function test() {
let jar = getJar(rootDir);
if (jar) {
let tmpdir = extractJarToTmp(jar);
rootDir = "file://" + tmpdir.path;
rootDir = "file://" + tmpdir.path + '/';
}
loader.loadSubScript(rootDir + "/privacypane_tests.js", this);
loader.loadSubScript(rootDir + "privacypane_tests.js", this);
run_test_subset([
// history mode should be initialized to remember

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

@ -3,25 +3,32 @@
<head>
<title>postMessage chrome message receiver</title>
<script type="application/javascript">
var gPrePath = "";
function receiveMessage(evt)
{
// Content cannot post to chrome without privileges
window.parent.postMessage("SHOULD NOT GET THIS!", "*");
if (evt.data.substring(0,9) == "chrome://") {
gPrePath = evt.data;
respond("path-is-set");
} else {
// Content cannot post to chrome without privileges
window.parent.postMessage("SHOULD NOT GET THIS!", "*");
var msg = "post-to-content-response";
var msg = "post-to-content-response";
if (evt.source !== null)
msg += " wrong-source(" + evt.source + ")";
if (!evt.isTrusted)
msg += " unexpected-untrusted-event";
if (evt.type !== "message")
msg += " wrong-type(" + evt.type + ")";
if (evt.origin !== "chrome://mochikit")
msg += " wrong-origin(" + evt.origin + ")";
if (evt.data !== "post-to-content")
msg += " wrong-message(" + evt.data + ")";
if (evt.source !== null)
msg += " wrong-source(" + evt.source + ")";
if (!evt.isTrusted)
msg += " unexpected-untrusted-event";
if (evt.type !== "message")
msg += " wrong-type(" + evt.type + ")";
if (evt.origin !== gPrePath)
msg += " wrong-origin(" + evt.origin + ")";
if (evt.data !== "post-to-content")
msg += " wrong-message(" + evt.data + ")";
respond(msg);
respond(msg);
}
}
function respond(msg)

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

@ -45,6 +45,10 @@ function messageReceiver(evt)
switch (evt.data)
{
case "path-is-set":
chromePathIsSet(evt);
break;
case "post-to-self":
checkSelf(evt);
break;
@ -73,11 +77,16 @@ function checkSelf(evt)
is(evt.origin, prepath, "wrong origin for chrome: URL");
is(evt.source, null, "chrome posters get a null source, for security");
window.frames.contentDomain.postMessage(prepath, "*");
}
function chromePathIsSet(evt)
{
window.frames.contentDomain.postMessage("post-to-content",
"http://example.org");
}
/*************
* RECEIVERS *
*************/

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

@ -9,7 +9,7 @@
title="bug 514732 test">
<script type="application/javascript"
src="chrome://mochikit/content/chrome/docshell/test/chrome/docshell_helpers.js">
src="chrome://mochikit/content/tests/SimpleTest/docshell_helpers.js">
</script>
<script type="application/javascript"><![CDATA[

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

@ -14,8 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=514732
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
src= "chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
</script>
<body xmlns="http://www.w3.org/1999/xhtml">

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

@ -5,7 +5,9 @@ const Cu = Components.utils;
const RELATIVE_DIR = "modules/libpr0n/test/browser/";
const TESTROOT = "http://example.com/browser/" + RELATIVE_DIR;
const TESTROOT2 = "http://example.org/browser/" + RELATIVE_DIR;
const CHROMEROOT = "chrome://mochikit/content/browser/" + RELATIVE_DIR;
var chrome_root = getRootDirectory(gTestPath);
const CHROMEROOT = chrome_root;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");

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

@ -234,8 +234,14 @@ function getRootDirectory(path, chromeURI) {
chromeURI = getChromeURI(path);
}
var myURL = chromeURI.QueryInterface(Components.interfaces.nsIURL);
var mydir = myURL.directory;
return chromeURI.prePath + myURL.directory;
if (mydir.match('/$') != '/')
{
mydir += '/';
}
return chromeURI.prePath + mydir;
}
//used by tests to determine their directory based off window.location.path

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

@ -1,10 +1,5 @@
content rtlchrome /content
content rtlchrome /
# Override intl.css with our own CSS file
override chrome://global/locale/intl.css chrome://rtlchrome/rtl.css
override chrome://global/locale/global.dtd chrome://rtlchrome/rtl.dtd
# Override intl.css with our own CSS file
override chrome://global/locale/intl.css chrome://mochikit/content/chrome/toolkit/content/tests/chrome/rtlchrome/rtl.css
override chrome://global/locale/global.dtd chrome://mochikit/content/chrome/toolkit/content/tests/chrome/rtlchrome/rtl.dtd

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

@ -3,7 +3,7 @@ var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
var rootDir = getRootDirectory(gTestPath);
scriptLoader.loadSubScript(rootDir + "/aboutcrashes_utils.js", this);
scriptLoader.loadSubScript(rootDir + "aboutcrashes_utils.js", this);
function check_crash_list(tab, crashes) {
let doc = gBrowser.getBrowserForTab(tab).contentDocument;

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

@ -3,7 +3,7 @@ var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
var rootDir = getRootDirectory(gTestPath);
scriptLoader.loadSubScript(rootDir + "/aboutcrashes_utils.js", this);
scriptLoader.loadSubScript(rootDir + "aboutcrashes_utils.js", this);
function cleanup_and_finish() {
try {

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

@ -3,7 +3,7 @@ var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
var rootDir = getRootDirectory(gTestPath);
scriptLoader.loadSubScript(rootDir + "/aboutcrashes_utils.js", this);
scriptLoader.loadSubScript(rootDir + "aboutcrashes_utils.js", this);
function check_clear_visible(tab, aVisible) {
let doc = gBrowser.getBrowserForTab(tab).contentDocument;

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Test whether an install succeeds when authentication is required

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Test whether an install fails when authentication is required and bad

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Test whether an install fails when authentication is required and it is

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Test whether an install fails when an invalid hash is included

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Test whether an install fails when an unknown hash type is included

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests that calling InstallTrigger.installChrome works

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests that cancelling an in progress download works.

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests that starting a download from chrome works and bypasses the whitelist

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

@ -1,7 +1,10 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Test that an install that requires cookies to be sent fails when no cookies

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

@ -1,7 +1,10 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Test that an install that requires cookies to be sent succeeds when cookies

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Test that an install that requires cookies to be sent succeeds when cookies

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Test that an install that requires cookies to be sent fails when cookies

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Test whether an install fails when the xpi is corrupt.

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Test whether an install fails when there is no install script present.

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Test whether an InstallTrigger.enabled is working

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Test whether an InstallTrigger.enabled is working

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Test whether an InstallTrigger.install call fails when xpinstall is disabled

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Test whether an install succeeds when a valid hash is included

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests that calling InstallTrigger.installChrome works

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests installing an local file works when loading the url

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Test whether an install fails if the url is a local file when requested from

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests that navigating away from the initiating page during the install

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests that closing the initiating page during the install doesn't break the

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests that going offline cancels an in progress download.

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Test whether an install succeeds when the progress dialog is already open.

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests installing two signed add-ons in the same trigger works.

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests that the correct signer is presented for combinations of O and CN present.

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests installing a signed add-on that has been tampered with after signing.

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests installing an signed add-on through an InstallTrigger call in web

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests installing an add-on signed by an untrusted certificate through an

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests installing an signed add-on by navigating directly to the url

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests that calling InstallTrigger.startSoftwareUpdate works

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests installing an unsigned add-on through an InstallTrigger call in web

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests installing an unsigned add-on by navigating directly to the url

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests installing an unsigned add-on through an InstallTrigger call in web

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests installing an unsigned add-on through an InstallTrigger call in web

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests installing an unsigned add-on through a navigation. Should not be

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests installing an unsigned add-on through a navigation. Should be

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests installing an unsigned add-on through a startSoftwareUpdate call in web

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

@ -1,7 +1,9 @@
// Load in the test harness
var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
scriptLoader.loadSubScript("chrome://mochikit/content/browser/xpinstall/tests/harness.js", this);
var rootDir = getRootDirectory(window.location.href);
scriptLoader.loadSubScript(rootDir + "harness.js", this);
// ----------------------------------------------------------------------------
// Tests installing an unsigned add-on through an installChrome call in web

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

@ -1,10 +1,20 @@
const TESTROOT = "http://example.com/browser/xpinstall/tests/";
const TESTROOT2 = "http://example.org/browser/xpinstall/tests/";
const CHROMEROOT = "chrome://mochikit/content/browser/xpinstall/tests/"
const XPINSTALL_URL = "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul";
const PROMPT_URL = "chrome://global/content/commonDialog.xul";
const ADDONS_URL = "chrome://mozapps/content/extensions/extensions.xul";
var rootDir = getRootDirectory(gTestPath);
var path = rootDir.split('/');
var chromeName = path[0] + '//' + path[2];
var croot = chromeName + "/content/browser/xpinstall/tests/";
var jar = getJar(croot);
if (jar) {
var tmpdir = extractJarToTmp(jar);
croot = 'file://' + tmpdir.path + '/';
}
const CHROMEROOT = croot;
/**
* This is a test harness designed to handle responding to UI during the process
* of installing an XPI. A test can set callbacks to hear about specific parts