Commit c4b55a50 authored by J. Ryan Stinnett's avatar J. Ryan Stinnett
Browse files

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.
parent 7eceb8f4
Loading
Loading
Loading
Loading
+8 −15
Original line number Diff line number Diff line
@@ -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) {
  // 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,13 +596,9 @@ 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]);
  }
  }

  // Check the active Experiment
  let experiment = data.addons.activeExperiment;
+2 −1
Original line number Diff line number Diff line
[DEFAULT]
head = head.js
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.