зеркало из https://github.com/mozilla/pjs.git
Bug 543800 Package chrome style tests into .jar file for Android testing r=ctalbert a=NPOTB
This commit is contained in:
Родитель
1f60168d52
Коммит
8543ff90e4
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче