Bug 1441927 part 3. Fix the exposure test for OfflineResourceList. r=bkelly
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 01 Mar 2018 12:32:33 -0500
changeset 461117 63ed8121dda4a72263c3038bb516c96839e3a917
parent 461116 82d1fb9b5a2e74e57674ef6cc6b7983c407d7aeb
child 461118 33432803d9204a6912c54acf634a4862c2869172
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly
bugs1441927
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1441927 part 3. Fix the exposure test for OfflineResourceList. r=bkelly MozReview-Commit-ID: IfIegdZWY99
dom/tests/mochitest/general/test_interfaces.js
testing/specialpowers/content/specialpowersAPI.js
--- a/dom/tests/mochitest/general/test_interfaces.js
+++ b/dom/tests/mochitest/general/test_interfaces.js
@@ -23,16 +23,17 @@
 //
 // The values of the properties need to be either literal true/false
 // (e.g. indicating whether something is enabled on a particular
 // channel/OS) or one of the is* constants below (in cases when
 // exposure is affected by channel or OS in a nontrivial way).
 
 const version = SpecialPowers.Cc["@mozilla.org/xre/app-info;1"].getService(SpecialPowers.Ci.nsIXULAppInfo).version;
 const isNightly = version.endsWith("a1");
+const isEarlyBetaOrEarlier = SpecialPowers.EARLY_BETA_OR_EARLIER;
 const isRelease = !version.includes("a");
 const isDesktop = !/Mobile|Tablet/.test(navigator.userAgent);
 const isMac = /Mac OS/.test(navigator.oscpu);
 const isWindows = /Windows/.test(navigator.oscpu);
 const isAndroid = navigator.userAgent.includes("Android");
 const isLinux = /Linux/.test(navigator.oscpu) && !isAndroid;
 const isInsecureContext = !window.isSecureContext;
 
@@ -733,17 +734,17 @@ var interfaceNamesInGlobalScope =
     {name: "Notification", insecureContext: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "OffscreenCanvas", insecureContext: true, disabled: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "OfflineAudioCompletionEvent", insecureContext: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "OfflineAudioContext", insecureContext: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
-    {name: "OfflineResourceList", insecureContext: SpecialPowers.getBoolPref("browser.cache.offline.insecure.enable")},
+    {name: "OfflineResourceList", insecureContext: !isEarlyBetaOrEarlier},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "Option", insecureContext: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "OscillatorNode", insecureContext: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "PageTransitionEvent", insecureContext: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "PaintRequest", insecureContext: true},
--- a/testing/specialpowers/content/specialpowersAPI.js
+++ b/testing/specialpowers/content/specialpowersAPI.js
@@ -14,16 +14,17 @@ var global = this;
 
 ChromeUtils.import("chrome://specialpowers/content/MockFilePicker.jsm");
 ChromeUtils.import("chrome://specialpowers/content/MockColorPicker.jsm");
 ChromeUtils.import("chrome://specialpowers/content/MockPermissionPrompt.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
+ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 
 // We're loaded with "this" not set to the global in some cases, so we
 // have to play some games to get at the global object here.  Normally
 // we'd try "this" from a function called with undefined this value,
 // but this whole file is in strict mode.  So instead fall back on
 // returning "this" from indirect eval, which returns the global.
 if (!(function() { var e = eval; return e("this"); })().File) { // eslint-disable-line no-eval
     Cu.importGlobalProperties(["File", "InspectorUtils", "NodeFilter"]);
@@ -2231,13 +2232,15 @@ SpecialPowersAPI.prototype = {
       });
     };
 
     return classifierService.asyncClassifyLocalWithTables(unwrapIfWrapped(uri),
                                                           tables,
                                                           wrapCallback);
   },
 
+  EARLY_BETA_OR_EARLIER: AppConstants.EARLY_BETA_OR_EARLIER,
+
 };
 
 this.SpecialPowersAPI = SpecialPowersAPI;
 this.bindDOMWindowUtils = bindDOMWindowUtils;
 this.getRawComponents = getRawComponents;