Bug 1365021: Refactor test_bootstrap.js to be less insane; re-enable. r=aswan

MozReview-Commit-ID: 6z2dBIuXmMP

--HG--
extra : rebase_source : 2465347d4a6d760d6925cb88b74af74ca7f6d6fa
extra : source : 2aa1a76c7dfb765f1434d8a774f83debc69ee305
This commit is contained in:
Kris Maglione 2018-03-27 17:24:16 -07:00
Родитель 5f201b2222
Коммит fa49fcf8c9
8 изменённых файлов: 1155 добавлений и 1386 удалений

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

@ -1 +0,0 @@
ChromeUtils.import("resource://xpcshell-data/BootstrapMonitor.jsm").monitor(this);

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

@ -1,24 +0,0 @@
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>bootstrap1@tests.mozilla.org</em:id>
<em:version>3.0</em:version>
<em:bootstrap>true</em:bootstrap>
<!-- Front End MetaData -->
<em:name>Test Bootstrap 1</em:name>
<em:description>Test Description</em:description>
<em:targetApplication>
<Description>
<em:id>undefined</em:id>
<em:minVersion>1</em:minVersion>
<em:maxVersion>1</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>

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

@ -1,3 +0,0 @@
var EXPORTED_SYMBOLS = ["VERSION"];
var VERSION = 3;

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

@ -1,23 +0,0 @@
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>bootstrap1@tests.mozilla.org</em:id>
<em:version>4.0</em:version>
<!-- Front End MetaData -->
<em:name>Test Bootstrap 1</em:name>
<em:description>Test Description</em:description>
<em:targetApplication>
<Description>
<em:id>xpcshell@tests.mozilla.org</em:id>
<em:minVersion>1</em:minVersion>
<em:maxVersion>1</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>

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

@ -1 +0,0 @@
ChromeUtils.import("resource://xpcshell-data/BootstrapMonitor.jsm").monitor(this);

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

@ -1,29 +0,0 @@
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>bootstrap2@tests.mozilla.org</em:id>
<em:version>1.0</em:version>
<em:bootstrap>true</em:bootstrap>
<em:multiprocessCompatible>true</em:multiprocessCompatible>
<!-- Front End MetaData -->
<em:name>Test Bootstrap 2</em:name>
<em:description>Test Description</em:description>
<em:iconURL>chrome://foo/skin/icon.png</em:iconURL>
<em:aboutURL>chrome://foo/content/about.xul</em:aboutURL>
<em:optionsURL>chrome://foo/content/options.xul</em:optionsURL>
<em:targetApplication>
<Description>
<em:id>xpcshell@tests.mozilla.org</em:id>
<em:minVersion>1</em:minVersion>
<em:maxVersion>1</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -3,28 +3,35 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
var ADDONS = [
"test_bootstrap2_1", // restartless addon
];
var ID = "bootstrap2@tests.mozilla.org";
var IDS = [
"bootstrap2@tests.mozilla.org",
];
const ADDON = {
id: ID,
version: "1.0",
bootstrap: "true",
multiprocessCompatible: "true",
function run_test() {
do_test_pending();
name: "Test Bootstrap 2",
description: "Test Description",
iconURL: "chrome://foo/skin/icon.png",
aboutURL: "chrome://foo/content/about.xul",
optionsURL: "chrome://foo/content/options.xul",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"}],
};
add_task(async function() {
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "2");
startupManager();
await promiseStartupManager();
AddonManager.checkCompatibility = false;
installAllFiles(ADDONS.map(do_get_addon), function() {
restartManager();
await promiseInstallXPI(ADDON);
AddonManager.getAddonsByIDs(IDS, function([a1]) {
Assert.equal(a1.isDebuggable, true);
do_test_finished();
});
}, true);
}
let addon = await AddonManager.getAddonByID(ID);
Assert.equal(addon.isDebuggable, true);
});