Bug 1373453 Part 2 Convert extensions in telemetry unit tests to webextensions r=Dexter

We will no longer load non-webextensions from user profiles starting in
57, so with this patch this test works much more like how browsers in the
field will run.  Note that we will still use legacy extensions for things
like system addons, those remain part of this test.

MozReview-Commit-ID: CEOdRbrWphi

--HG--
extra : rebase_source : d89f70c59dc50ed1850ed406a9fea1ec5ad4ee23
This commit is contained in:
Andrew Swan 2017-06-15 15:06:16 -07:00
Родитель eb7a63d1f3
Коммит 28c0b4915f
17 изменённых файлов: 65 добавлений и 128 удалений

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

@ -1,16 +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>telemetry-ext-2@tests.mozilla.org</em:id>
<em:version>2</em:version>
<em:type>2</em:type>
<!-- Front End MetaData -->
<em:name>Telemetry test extension 2</em:name>
<em:description>Yet another extension that extends twice.</em:description>
</Description>
</RDF>

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

@ -1,16 +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>telemetry-ext-1@tests.mozilla.org</em:id>
<em:version>1</em:version>
<em:type>2</em:type>
<!-- Front End MetaData -->
<em:name>Telemetry test extension</em:name>
<em:description>Yet another extension that extends.</em:description>
</Description>
</RDF>

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

@ -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>tel-longfields-xpi@tests.mozilla.org</em:id>
<em:version>This is a really long addon version, that will get limited to 100 characters. We're much longer, we're at about 116.</em:version>
<em:targetApplication>
<Description>
<em:id>toolkit@mozilla.org</em:id>
<em:minVersion>0</em:minVersion>
<em:maxVersion>*</em:maxVersion>
</Description>
</em:targetApplication>
<!-- Front End MetaData -->
<em:name>This is a really long addon name, that will get limited to 100 characters. We're much longer, we're at about 219. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nullam sodales. Yeah, Latin placeholder.</em:name>
<em:description>This is a really long addon description, that will get limited to 100 characters. We're much longer, we're at about 200. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nullam sodales.</em:description>
<em:bootstrap>true</em:bootstrap>
</Description>
</RDF>

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

@ -0,0 +1,12 @@
{
"manifest_version": 2,
"name": "This is a really long addon name, that will get limited to 100 characters. We're much longer, we're at about 219. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nullam sodales. Yeah, Latin placeholder.",
"description": "This is a really long addon description, that will get limited to 100 characters. We're much longer, we're at about 200. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nullam sodales.",
"version": "1.0",
"applications": {
"gecko": {
"id": "tel-longfields-webext@tests.mozilla.org"
}
}
}

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

@ -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>tel-restartless-xpi@tests.mozilla.org</em:id>
<em:version>1.0</em:version>
<em:targetApplication>
<Description>
<em:id>toolkit@mozilla.org</em:id>
<em:minVersion>0</em:minVersion>
<em:maxVersion>*</em:maxVersion>
</Description>
</em:targetApplication>
<!-- Front End MetaData -->
<em:name>XPI Telemetry Restartless Test</em:name>
<em:description>A restartless addon which gets enabled without a reboot.</em:description>
<em:bootstrap>true</em:bootstrap>
</Description>
</RDF>

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

@ -0,0 +1,12 @@
{
"manifest_version": 2,
"name": "XPI Telemetry Restartless Test",
"description": "A restartless addon which gets enabled without a reboot.",
"version": "1.0",
"applications": {
"gecko": {
"id": "tel-restartless-webext@tests.mozilla.org"
}
}
}

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

@ -0,0 +1,3 @@
# This file was created by https://github.com/mozilla/web-ext
# Your auto-generated extension ID for addons.mozilla.org is:
tel-signed-webext@tests.mozilla.org

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

@ -0,0 +1,7 @@
Manifest-Version: 1.0
Name: manifest.json
Digest-Algorithms: MD5 SHA1
MD5-Digest: vh0VF5quc9YIhMhIsZgKcg==
SHA1-Digest: DNXAbrHJ4ncET5W+qtJl4+45D6s=

Двоичный файл не отображается.

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

@ -0,0 +1,4 @@
Signature-Version: 1.0
MD5-Digest-Manifest: tbeA48G5pe86kvUbd4rsXA==
SHA1-Digest-Manifest: jyvWt2v9XUnYHrvrlSi4BdyZV/0=

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

@ -0,0 +1,12 @@
{
"manifest_version": 2,
"name": "XPI Telemetry Signed Test",
"description": "A signed webextension",
"version": "1.0",
"applications": {
"gecko": {
"id": "tel-signed-webext@tests.mozilla.org"
}
}
}

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

@ -1,7 +0,0 @@
Manifest-Version: 1.0
Name: install.rdf
Digest-Algorithms: MD5 SHA1
MD5-Digest: YEilRfaecTg2bMNPoYqexQ==
SHA1-Digest: GEnQKM8Coyw83phx/z1oNh327+0=

Двоичный файл не отображается.

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

@ -1,4 +0,0 @@
Signature-Version: 1.0
MD5-Digest-Manifest: Ko2bKTrwTXCdstWHWqCR4w==
SHA1-Digest-Manifest: k6+jfNGFxXtDd1cSX0ZoIyQ1cww=

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

@ -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>tel-signed-xpi@tests.mozilla.org</em:id>
<em:version>1.0</em:version>
<em:targetApplication>
<Description>
<em:id>toolkit@mozilla.org</em:id>
<em:minVersion>0</em:minVersion>
<em:maxVersion>*</em:maxVersion>
</Description>
</em:targetApplication>
<!-- Front End MetaData -->
<em:name>XPI Telemetry Signed Test</em:name>
<em:description>A signed addon which gets enabled without a reboot.</em:description>
<em:bootstrap>true</em:bootstrap>
</Description>
</RDF>

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

@ -983,7 +983,7 @@ add_task(async function test_prefDefault() {
add_task(async function test_addonsWatch_InterestingChange() {
const ADDON_INSTALL_URL = gDataRoot + "restartless.xpi";
const ADDON_ID = "tel-restartless-xpi@tests.mozilla.org";
const ADDON_ID = "tel-restartless-webext@tests.mozilla.org";
// We only expect a single notification for each install, uninstall, enable, disable.
const EXPECTED_NOTIFICATIONS = 4;
@ -1018,10 +1018,12 @@ add_task(async function test_addonsWatch_InterestingChange() {
Assert.ok(!(ADDON_ID in TelemetryEnvironment.currentEnvironment.addons.activeAddons));
checkpointPromise = registerCheckpointPromise(3);
let startupPromise = AddonTestUtils.promiseWebExtensionStartup(ADDON_ID);
addon.userDisabled = false;
await checkpointPromise;
assertCheckpoint(3);
Assert.ok(ADDON_ID in TelemetryEnvironment.currentEnvironment.addons.activeAddons);
await startupPromise;
checkpointPromise = registerCheckpointPromise(4);
await AddonManagerTesting.uninstallAddonByID(ADDON_ID);
@ -1119,7 +1121,7 @@ add_task(async function test_addonsWatch_NotInterestingChange() {
add_task(async function test_addonsAndPlugins() {
const ADDON_INSTALL_URL = gDataRoot + "restartless.xpi";
const ADDON_ID = "tel-restartless-xpi@tests.mozilla.org";
const ADDON_ID = "tel-restartless-webext@tests.mozilla.org";
const ADDON_INSTALL_DATE = truncateToDays(Date.now());
const EXPECTED_ADDON_DATA = {
blocklisted: false,
@ -1136,8 +1138,8 @@ add_task(async function test_addonsAndPlugins() {
updateDay: ADDON_INSTALL_DATE,
signedState: mozinfo.addon_signing ? AddonManager.SIGNEDSTATE_PRIVILEGED : AddonManager.SIGNEDSTATE_NOT_REQUIRED,
isSystem: false,
isWebExtension: false,
multiprocessCompatible: false,
isWebExtension: true,
multiprocessCompatible: true,
};
const SYSTEM_ADDON_ID = "tel-system-xpi@tests.mozilla.org";
const EXPECTED_SYSTEM_ADDON_DATA = {
@ -1272,12 +1274,14 @@ add_task(async function test_addonsAndPlugins() {
});
add_task(async function test_signedAddon() {
const ADDON_INSTALL_URL = gDataRoot + "signed.xpi";
const ADDON_ID = "tel-signed-xpi@tests.mozilla.org";
AddonTestUtils.useRealCertChecks = true;
const ADDON_INSTALL_URL = gDataRoot + "signed-webext.xpi";
const ADDON_ID = "tel-signed-webext@tests.mozilla.org";
const ADDON_INSTALL_DATE = truncateToDays(Date.now());
const EXPECTED_ADDON_DATA = {
blocklisted: false,
description: "A signed addon which gets enabled without a reboot.",
description: "A signed webextension",
name: "XPI Telemetry Signed Test",
userDisabled: false,
appDisabled: false,
@ -1310,11 +1314,13 @@ add_task(async function test_signedAddon() {
for (let f in EXPECTED_ADDON_DATA) {
Assert.equal(targetAddon[f], EXPECTED_ADDON_DATA[f], f + " must have the correct value.");
}
AddonTestUtils.useRealCertChecks = false;
});
add_task(async function test_addonsFieldsLimit() {
const ADDON_INSTALL_URL = gDataRoot + "long-fields.xpi";
const ADDON_ID = "tel-longfields-xpi@tests.mozilla.org";
const ADDON_ID = "tel-longfields-webext@tests.mozilla.org";
// Install the addon and wait for the TelemetryEnvironment to pick it up.
let deferred = PromiseUtils.defer();
@ -1351,7 +1357,7 @@ add_task(async function test_collectionWithbrokenAddonData() {
};
const ADDON_INSTALL_URL = gDataRoot + "restartless.xpi";
const ADDON_ID = "tel-restartless-xpi@tests.mozilla.org";
const ADDON_ID = "tel-restartless-webext@tests.mozilla.org";
const ADDON_INSTALL_DATE = truncateToDays(Date.now());
const EXPECTED_ADDON_DATA = {
blocklisted: false,

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

@ -8,8 +8,6 @@ support-files =
../search/searchTest.jar
dictionary.xpi
experiment.xpi
extension.xpi
extension-2.xpi
engine.xml
system.xpi
restartless.xpi
@ -22,8 +20,6 @@ support-files =
generated-files =
dictionary.xpi
experiment.xpi
extension.xpi
extension-2.xpi
system.xpi
restartless.xpi
theme.xpi