Bug 1373563 - Mozscreenshots: disable intermittent controlCenter_localFile on Windows 10 and OSX. r=MattN
I'm not sure whether this problem will extend to Linux and Win < 10
any time soon, if that's the case we will need to disable the test
entirely.
MozReview-Commit-ID: 5vvBPP8OjTb
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/ControlCenter.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/ControlCenter.jsm
@@ -8,16 +8,17 @@ this.EXPORTED_SYMBOLS = ["ControlCenter"
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Timer.jsm");
Cu.import("resource://testing-common/BrowserTestUtils.jsm");
Cu.import("resource:///modules/SitePermissions.jsm");
Cu.import("resource://gre/modules/NetUtil.jsm");
+Cu.import("resource://gre/modules/AppConstants.jsm");
let {UrlClassifierTestUtils} = Cu.import("resource://testing-common/UrlClassifierTestUtils.jsm", {});
const RESOURCE_PATH = "browser/browser/tools/mozscreenshots/mozscreenshots/extension/mozscreenshots/browser/chrome/mozscreenshots/lib/controlCenter";
const HTTP_PAGE = "http://example.com/";
const HTTPS_PAGE = "https://example.com/";
const PERMISSIONS_PAGE = "https://test1.example.com/";
const HTTP_PASSWORD_PAGE = `http://test2.example.org/${RESOURCE_PATH}/password.html`;
@@ -32,31 +33,16 @@ this.ControlCenter = {
configurations: {
about: {
async applyConfig() {
await loadPage("about:home");
await openIdentityPopup();
},
},
- localFile: {
- async applyConfig() {
- let channel = NetUtil.newChannel({
- uri: "chrome://mozscreenshots/content/lib/mozscreenshots.html",
- loadUsingSystemPrincipal: true
- });
- channel = channel.QueryInterface(Ci.nsIFileChannel);
- let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
- let gBrowser = browserWindow.gBrowser;
- BrowserTestUtils.loadURI(gBrowser.selectedBrowser, channel.file.path);
- await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
- await openIdentityPopup();
- },
- },
-
http: {
async applyConfig() {
await loadPage(HTTP_PAGE);
await openIdentityPopup();
},
},
httpSubView: {
@@ -217,16 +203,33 @@ this.ControlCenter = {
gBrowser.ownerGlobal.document.querySelector("#tracking-action-unblock").click();
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, TRACKING_PAGE);
await openIdentityPopup();
},
},
},
};
+// Local file paths include temporary task identifiers on OSX and Win10.
+if (AppConstants.platform != "macosx" &&
+ !AppConstants.isPlatformAndVersionAtLeast("win", "10")) {
+ this.ControlCenter.localFile = async function applyConfig() {
+ let channel = NetUtil.newChannel({
+ uri: "chrome://mozscreenshots/content/lib/mozscreenshots.html",
+ loadUsingSystemPrincipal: true
+ });
+ channel = channel.QueryInterface(Ci.nsIFileChannel);
+ let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
+ let gBrowser = browserWindow.gBrowser;
+ BrowserTestUtils.loadURI(gBrowser.selectedBrowser, channel.file.path);
+ await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+ await openIdentityPopup();
+ };
+}
+
async function loadPage(url) {
let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
let gBrowser = browserWindow.gBrowser;
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url);
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, url);
}
async function openIdentityPopup(expand) {