mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 17:25:36 +00:00
Bug 1203159 - Tweak environment test for appdir change. r=gfritzsche
Some DevTools files are changing how they are installed. This environment test relies on add-on manager infrastructure, which also loads some DevTools files. To access these DevTools files in XPCShell from a Firefox build, we need to set `firefox-appdir = browser` in the test manifest. However, this then causes `GMPProvider` to become enabled where it was not before, changing the values of the test. The test is adjusted to reflect the values `GMPProvider` reports.
This commit is contained in:
parent
7eceb8f4c5
commit
c4b55a504d
@ -210,13 +210,7 @@ function checkNullOrString(aValue) {
|
||||
* boolean.
|
||||
*/
|
||||
function checkNullOrBool(aValue) {
|
||||
if (aValue) {
|
||||
return (typeof aValue == "boolean");
|
||||
} else if (aValue === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return aValue === null || (typeof aValue == "boolean");
|
||||
}
|
||||
|
||||
function checkBuildSection(data) {
|
||||
@ -564,9 +558,12 @@ function checkTheme(data) {
|
||||
}
|
||||
|
||||
function checkActiveGMPlugin(data) {
|
||||
Assert.equal(typeof data.version, "string");
|
||||
// GMP plugin version defaults to null until GMPDownloader runs to update it.
|
||||
if (data.version) {
|
||||
Assert.equal(typeof data.version, "string");
|
||||
}
|
||||
Assert.equal(typeof data.userDisabled, "boolean");
|
||||
Assert.equal(typeof data.applyBackgroundUpdates, "boolean");
|
||||
Assert.equal(typeof data.applyBackgroundUpdates, "number");
|
||||
}
|
||||
|
||||
function checkAddonsSection(data) {
|
||||
@ -599,12 +596,8 @@ function checkAddonsSection(data) {
|
||||
|
||||
// Check active GMPlugins
|
||||
let activeGMPlugins = data.addons.activeGMPlugins;
|
||||
if (!gIsAndroid) {
|
||||
// We don't check for data validity on Android here since XPCSHELL tests on Android
|
||||
// report one valid (plugin.isValid == true) GMPlugin with a "null" version field.
|
||||
for (let gmPlugin in activeGMPlugins) {
|
||||
checkActiveGMPlugin(activeGMPlugins[gmPlugin]);
|
||||
}
|
||||
for (let gmPlugin in activeGMPlugins) {
|
||||
checkActiveGMPlugin(activeGMPlugins[gmPlugin]);
|
||||
}
|
||||
|
||||
// Check the active Experiment
|
||||
|
@ -1,6 +1,7 @@
|
||||
[DEFAULT]
|
||||
head = head.js
|
||||
tail =
|
||||
tail =
|
||||
firefox-appdir = browser
|
||||
skip-if = toolkit == 'gonk'
|
||||
# The *.xpi files are only needed for test_TelemetryEnvironment.js, but
|
||||
# xpcshell fails to install tests if we move them under the test entry.
|
||||
|
Loading…
Reference in New Issue
Block a user