--- a/addon-sdk/source/python-lib/cuddlefish/prefs.py
+++ b/addon-sdk/source/python-lib/cuddlefish/prefs.py
@@ -57,17 +57,16 @@ DEFAULT_NO_CONNECTIONS_PREFS = {
'browser.search.suggest.enabled' : False,
'browser.safebrowsing.downloads.remote.url': 'http://localhost/safebrowsing-dummy/downloads',
'browser.safebrowsing.malware.enabled' : False,
'browser.safebrowsing.phishing.enabled' : False,
'browser.safebrowsing.provider.google.updateURL': 'http://localhost/safebrowsing-dummy/update',
'browser.safebrowsing.provider.google.gethashURL': 'http://localhost/safebrowsing-dummy/gethash',
'browser.safebrowsing.provider.google4.updateURL': 'http://localhost/safebrowsing4-dummy/update',
'browser.safebrowsing.provider.google4.gethashURL': 'http://localhost/safebrowsing4-dummy/gethash',
- 'browser.selfsupport.url': 'https://localhost/selfsupport-dummy',
'browser.safebrowsing.provider.mozilla.gethashURL': 'http://localhost/safebrowsing-dummy/gethash',
'browser.safebrowsing.provider.mozilla.updateURL': 'http://localhost/safebrowsing-dummy/update',
# Disable app update
'app.update.enabled' : False,
'app.update.staging.enabled': False,
# Disable about:newtab content fetch
--- a/addon-sdk/source/test/leak/leak-utils.js
+++ b/addon-sdk/source/test/leak/leak-utils.js
@@ -1,16 +1,15 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { Cu, Ci } = require("chrome");
const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
-const { SelfSupportBackend } = Cu.import("resource:///modules/SelfSupportBackend.jsm", {});
const Startup = Cu.import("resource://gre/modules/sdk/system/Startup.js", {}).exports;
// Adapted from the SpecialPowers.exactGC() code. We don't have a
// window to operate on so we cannot use the exact same logic. We
// use 6 GC iterations here as that is what is needed to clean up
// the windows we have tested with.
function gc() {
return new Promise(resolve => {
@@ -33,21 +32,16 @@ function gc() {
}
// Execute the given test function and verify that we did not leak windows
// in the process. The test function must return a promise or be a generator.
// If the promise is resolved, or generator completes, with an sdk loader
// object then it will be unloaded after the memory measurements.
exports.asyncWindowLeakTest = function*(assert, asyncTestFunc) {
- // SelfSupportBackend periodically tries to open windows. This can
- // mess up our window leak detection below, so turn it off.
- if (SelfSupportBackend._log)
- SelfSupportBackend.uninit();
-
// Wait for the browser to finish loading.
yield Startup.onceInitialized;
// Track windows that are opened in an array of weak references.
let weakWindows = [];
function windowObserver(subject, topic) {
let supportsWeak = subject.QueryInterface(Ci.nsISupportsWeakReference);
if (supportsWeak) {
--- a/addon-sdk/source/test/preferences/no-connections.json
+++ b/addon-sdk/source/test/preferences/no-connections.json
@@ -19,17 +19,16 @@
"browser.safebrowsing.malware.enabled": false,
"browser.safebrowsing.phishing.enabled": false,
"browser.safebrowsing.provider.google.updateURL": "http://localhost/safebrowsing-dummy/update",
"browser.safebrowsing.provider.google.gethashURL": "http://localhost/safebrowsing-dummy/gethash",
"browser.safebrowsing.provider.google.reportURL": "http://localhost/safebrowsing-dummy/malwarereport",
"browser.safebrowsing.provider.google4.updateURL": "http://localhost/safebrowsing4-dummy/update",
"browser.safebrowsing.provider.google4.gethashURL": "http://localhost/safebrowsing4-dummy/gethash",
"browser.safebrowsing.provider.google4.reportURL": "http://localhost/safebrowsing4-dummy/malwarereport",
- "browser.selfsupport.url": "https://localhost/selfsupport-dummy",
"browser.safebrowsing.provider.mozilla.gethashURL": "http://localhost/safebrowsing-dummy/gethash",
"browser.safebrowsing.provider.mozilla.updateURL": "http://localhost/safebrowsing-dummy/update",
"browser.newtabpage.directory.source": "data:application/json,{'jetpack':1}",
"extensions.update.url": "http://localhost/extensions-dummy/updateURL",
"extensions.update.background.url": "http://localhost/extensions-dummy/updateBackgroundURL",
"extensions.blocklist.url": "http://localhost/extensions-dummy/blocklistURL",
"extensions.webservice.discoverURL": "http://localhost/extensions-dummy/discoveryURL",
"extensions.getAddons.maxResults": 0,
--- a/browser/app/permissions
+++ b/browser/app/permissions
@@ -3,17 +3,16 @@
# * matchtype \t type \t permission \t host
# * "origin" should be used for matchtype, "host" is supported for legacy reasons
# * type is a string that identifies the type of permission (e.g. "cookie")
# * permission is an integer between 1 and 15
# See nsPermissionManager.cpp for more...
# UITour
origin uitour 1 https://www.mozilla.org
-origin uitour 1 https://self-repair.mozilla.org
origin uitour 1 https://support.mozilla.org
origin uitour 1 https://addons.mozilla.org
origin uitour 1 https://discovery.addons.mozilla.org
origin uitour 1 about:home
# XPInstall
origin install 1 https://addons.mozilla.org
origin install 1 https://testpilot.firefox.com
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -817,18 +817,16 @@ pref("browser.EULA.version", 3);
pref("browser.rights.version", 3);
pref("browser.rights.3.shown", false);
#ifdef DEBUG
// Don't show the about:rights notification in debug builds.
pref("browser.rights.override", true);
#endif
-pref("browser.selfsupport.url", "https://self-repair.mozilla.org/%LOCALE%/repair");
-
pref("browser.sessionstore.resume_from_crash", true);
pref("browser.sessionstore.resume_session_once", false);
// Minimal interval between two save operations in milliseconds (while the user is active).
pref("browser.sessionstore.interval", 15000); // 15 seconds
// Minimal interval between two save operations in milliseconds (while the user is idle).
pref("browser.sessionstore.interval.idle", 3600000); // 1h
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -29,17 +29,17 @@ XPCOMUtils.defineLazyGetter(this, "Weave
DateTimePickerHelper:false, DirectoryLinksProvider:false,
ExtensionsUI:false, Feeds:false,
FileUtils:false, FormValidationHandler:false, Integration:false,
LightweightThemeManager:false, LoginHelper:false, LoginManagerParent:false,
NetUtil:false, NewTabUtils:false, OS:false,
PageThumbs:false, PdfJs:false, PermissionUI:false, PlacesBackups:false,
PlacesUtils:false, PluralForm:false, PrivateBrowsingUtils:false,
ProcessHangMonitor:false, ReaderParent:false, RecentWindow:false,
- RemotePrompt:false, SelfSupportBackend:false, SessionStore:false,
+ RemotePrompt:false, SessionStore:false,
ShellService:false, SimpleServiceDiscovery:false, TabCrashHandler:false,
Task:false, UITour:false, WebChannel:false,
WindowsRegistry:false, webrtcUI:false, UserAgentOverrides: false */
/**
* IF YOU ADD OR REMOVE FROM THIS LIST, PLEASE UPDATE THE LIST ABOVE AS WELL.
* XXX Bug 1325373 is for making eslint detect these automatically.
*/
@@ -78,17 +78,16 @@ let initializedModules = {};
["PlacesBackups", "resource://gre/modules/PlacesBackups.jsm"],
["PlacesUtils", "resource://gre/modules/PlacesUtils.jsm"],
["PluralForm", "resource://gre/modules/PluralForm.jsm"],
["PrivateBrowsingUtils", "resource://gre/modules/PrivateBrowsingUtils.jsm"],
["ProcessHangMonitor", "resource:///modules/ProcessHangMonitor.jsm"],
["ReaderParent", "resource:///modules/ReaderParent.jsm"],
["RecentWindow", "resource:///modules/RecentWindow.jsm"],
["RemotePrompt", "resource:///modules/RemotePrompt.jsm"],
- ["SelfSupportBackend", "resource:///modules/SelfSupportBackend.jsm", "init"],
["SessionStore", "resource:///modules/sessionstore/SessionStore.jsm"],
["ShellService", "resource:///modules/ShellService.jsm"],
["SimpleServiceDiscovery", "resource://gre/modules/SimpleServiceDiscovery.jsm"],
["TabCrashHandler", "resource:///modules/ContentCrashHandlers.jsm"],
["Task", "resource://gre/modules/Task.jsm"],
["UITour", "resource:///modules/UITour.jsm"],
["WebChannel", "resource://gre/modules/WebChannel.jsm"],
["WindowsRegistry", "resource://gre/modules/WindowsRegistry.jsm"],
@@ -121,20 +120,16 @@ XPCOMUtils.defineLazyGetter(this, "gBran
XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() {
return Services.strings.createBundle("chrome://browser/locale/browser.properties");
});
const global = this;
const listeners = {
- observers: {
- "sessionstore-windows-restored": ["SelfSupportBackend"],
- },
-
ppmm: {
// PLEASE KEEP THIS LIST IN SYNC WITH THE LISTENERS ADDED IN ContentPrefServiceParent.init
"ContentPrefs:FunctionCall": ["ContentPrefServiceParent"],
"ContentPrefs:AddObserverForName": ["ContentPrefServiceParent"],
"ContentPrefs:RemoveObserverForName": ["ContentPrefServiceParent"],
// PLEASE KEEP THIS LIST IN SYNC WITH THE LISTENERS ADDED IN ContentPrefServiceParent.init
"FeedConverter:addLiveBookmark": ["Feeds"],
"WCCR:setAutoHandler": ["Feeds"],
@@ -166,43 +161,29 @@ const listeners = {
"rtcpeer:CancelRequest": ["webrtcUI"],
"rtcpeer:Request": ["webrtcUI"],
"webrtc:CancelRequest": ["webrtcUI"],
"webrtc:Request": ["webrtcUI"],
"webrtc:StopRecording": ["webrtcUI"],
"webrtc:UpdateBrowserIndicators": ["webrtcUI"],
},
- observe(subject, topic, data) {
- for (let module of this.observers[topic]) {
- try {
- this[module].observe(subject, topic, data);
- } catch (e) {
- Cu.reportError(e);
- }
- }
- },
-
receiveMessage(modules, data) {
let val;
for (let module of modules[data.name]) {
try {
val = global[module].receiveMessage(data) || val;
} catch (e) {
Cu.reportError(e);
}
}
return val;
},
init() {
- for (let observer of Object.keys(this.observers)) {
- Services.obs.addObserver(this, observer);
- }
-
let receiveMessageMM = this.receiveMessage.bind(this, this.mm);
for (let message of Object.keys(this.mm)) {
Services.mm.addMessageListener(message, receiveMessageMM);
}
let receiveMessagePPMM = this.receiveMessage.bind(this, this.ppmm);
for (let message of Object.keys(this.ppmm)) {
Services.ppmm.addMessageListener(message, receiveMessagePPMM);
deleted file mode 100644
--- a/browser/modules/SelfSupportBackend.jsm
+++ /dev/null
@@ -1,353 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["SelfSupportBackend"];
-
-const Cu = Components.utils;
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-
-Cu.import("resource://gre/modules/Log.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "HiddenFrame",
- "resource://gre/modules/HiddenFrame.jsm");
-
-// Enables or disables the Self Support.
-const PREF_ENABLED = "browser.selfsupport.enabled";
-// Url to open in the Self Support browser, in the urlFormatter service format.
-const PREF_URL = "browser.selfsupport.url";
-// Unified Telemetry status.
-const PREF_TELEMETRY_UNIFIED = "toolkit.telemetry.unified";
-// UITour status.
-const PREF_UITOUR_ENABLED = "browser.uitour.enabled";
-
-// Controls the interval at which the self support page tries to reload in case of
-// errors.
-const RETRY_INTERVAL_MS = 30000;
-// Maximum number of SelfSupport page load attempts in case of failure.
-const MAX_RETRIES = 5;
-// The delay after which to load the self-support, at startup.
-const STARTUP_DELAY_MS = 5000;
-
-const LOGGER_NAME = "Browser.SelfSupportBackend";
-const PREF_BRANCH_LOG = "browser.selfsupport.log.";
-const PREF_LOG_LEVEL = PREF_BRANCH_LOG + "level";
-const PREF_LOG_DUMP = PREF_BRANCH_LOG + "dump";
-
-const HTML_NS = "http://www.w3.org/1999/xhtml";
-const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-
-const UITOUR_FRAME_SCRIPT = "chrome://browser/content/content-UITour.js";
-
-// Whether the FHR/Telemetry unification features are enabled.
-// Changing this pref requires a restart.
-const IS_UNIFIED_TELEMETRY = Services.prefs.getBoolPref(PREF_TELEMETRY_UNIFIED, false);
-
-var gLogAppenderDump = null;
-
-this.SelfSupportBackend = Object.freeze({
- init() {
- SelfSupportBackendInternal.init();
- },
-
- uninit() {
- SelfSupportBackendInternal.uninit();
- },
-});
-
-var SelfSupportBackendInternal = {
- // The browser element that will load the SelfSupport page.
- _browser: null,
- // The Id of the timer triggering delayed SelfSupport page load.
- _delayedLoadTimerId: null,
- // The HiddenFrame holding the _browser element.
- _frame: null,
- _log: null,
- _progressListener: null,
-
- // Whether we're invited to let test code talk to our frame.
- _testing: false,
-
- // Whether self-support is enabled, and we want to continue lazy UI
- // startup after the session has been restored.
- _lazyStartupEnabled: false,
-
- /**
- * Initializes the self support backend.
- */
- init() {
- this._configureLogging();
-
- this._log.trace("init");
-
- Services.prefs.addObserver(PREF_BRANCH_LOG, this);
-
- // Only allow to use SelfSupport if Unified Telemetry is enabled.
- let reportingEnabled = IS_UNIFIED_TELEMETRY;
- if (!reportingEnabled) {
- this._log.config("init - Disabling SelfSupport because FHR and Unified Telemetry are disabled.");
- return;
- }
-
- // Make sure UITour is enabled.
- let uiTourEnabled = Services.prefs.getBoolPref(PREF_UITOUR_ENABLED, false);
- if (!uiTourEnabled) {
- this._log.config("init - Disabling SelfSupport because UITour is disabled.");
- return;
- }
-
- // Check the preferences to see if we want this to be active.
- if (!Services.prefs.getBoolPref(PREF_ENABLED, true)) {
- this._log.config("init - SelfSupport is disabled.");
- return;
- }
-
- this._lazyStartupEnabled = true;
- },
-
- /**
- * Shut down the self support backend, if active.
- */
- uninit() {
- if (!this._log) {
- // We haven't been initialized yet, so just return.
- return;
- }
-
- this._log.trace("uninit");
-
- Services.prefs.removeObserver(PREF_BRANCH_LOG, this);
-
- // Cancel delayed loading, if still active, when shutting down.
- clearTimeout(this._delayedLoadTimerId);
-
- // Dispose of the hidden browser.
- if (this._browser !== null) {
- if (this._browser.contentWindow) {
- this._browser.contentWindow.removeEventListener("DOMWindowClose", this, true);
- }
-
- if (this._progressListener) {
- this._browser.removeProgressListener(this._progressListener);
- this._progressListener.destroy();
- this._progressListener = null;
- }
-
- this._browser.remove();
- this._browser = null;
- }
-
- if (this._frame) {
- this._frame.destroy();
- this._frame = null;
- }
- if (this._testing) {
- Services.obs.notifyObservers(this._browser, "self-support-browser-destroyed");
- }
- },
-
- /**
- * Handle notifications. Once all windows are created, we wait a little bit more
- * since tabs might still be loading. Then, we open the self support.
- */
- // Observers are added in nsBrowserGlue.js
- observe(aSubject, aTopic, aData) {
- this._log.trace("observe - Topic " + aTopic);
-
- if (aTopic === "sessionstore-windows-restored") {
- if (this._lazyStartupEnabled) {
- this._delayedLoadTimerId = setTimeout(this._loadSelfSupport.bind(this), STARTUP_DELAY_MS);
- this._lazyStartupEnabled = false;
- }
- } else if (aTopic === "nsPref:changed") {
- this._configureLogging();
- }
- },
-
- /**
- * Configure the logger based on the preferences.
- */
- _configureLogging() {
- if (!this._log) {
- this._log = Log.repository.getLogger(LOGGER_NAME);
-
- // Log messages need to go to the browser console.
- let consoleAppender = new Log.ConsoleAppender(new Log.BasicFormatter());
- this._log.addAppender(consoleAppender);
- }
-
- // Make sure the logger keeps up with the logging level preference.
- this._log.level = Log.Level[Services.prefs.getStringPref(PREF_LOG_LEVEL, "Warn")];
-
- // If enabled in the preferences, add a dump appender.
- let logDumping = Services.prefs.getBoolPref(PREF_LOG_DUMP, false);
- if (logDumping != !!gLogAppenderDump) {
- if (logDumping) {
- gLogAppenderDump = new Log.DumpAppender(new Log.BasicFormatter());
- this._log.addAppender(gLogAppenderDump);
- } else {
- this._log.removeAppender(gLogAppenderDump);
- gLogAppenderDump = null;
- }
- }
- },
-
- /**
- * Create an hidden frame to host our |browser|, then load the SelfSupport page in it.
- * @param aURL The URL to load in the browser.
- */
- _makeHiddenBrowser(aURL) {
- this._frame = new HiddenFrame();
- return this._frame.get().then(aFrame => {
- let doc = aFrame.document;
-
- this._browser = doc.createElementNS(XUL_NS, "browser");
- this._browser.setAttribute("type", "content");
- this._browser.setAttribute("disableglobalhistory", "true");
- this._browser.setAttribute("src", aURL);
-
- if (this._testing) {
- Services.obs.notifyObservers(this._browser, "self-support-browser-created");
- }
- doc.documentElement.appendChild(this._browser);
- });
- },
-
- handleEvent(aEvent) {
- this._log.trace("handleEvent - aEvent.type " + aEvent.type + ", Trusted " + aEvent.isTrusted);
-
- if (aEvent.type === "DOMWindowClose") {
- let window = this._browser.contentDocument.defaultView;
- let target = aEvent.target;
-
- if (target == window) {
- // preventDefault stops the default window.close(). We need to do that to prevent
- // Services.appShell.hiddenDOMWindow from being destroyed.
- aEvent.preventDefault();
-
- this.uninit();
- }
- }
- },
-
- /**
- * Called when the self support page correctly loads.
- */
- _pageSuccessCallback() {
- this._log.debug("_pageSuccessCallback - Page correctly loaded.");
- this._browser.removeProgressListener(this._progressListener);
- this._progressListener.destroy();
- this._progressListener = null;
-
- // Allow SelfSupportBackend to catch |window.close()| issued by the content.
- this._browser.contentWindow.addEventListener("DOMWindowClose", this, true);
- },
-
- /**
- * Called when the self support page fails to load.
- */
- _pageLoadErrorCallback() {
- this._log.info("_pageLoadErrorCallback - Too many failed load attempts. Giving up.");
- this.uninit();
- },
-
- /**
- * Create a browser and attach it to an hidden window. The browser will contain the
- * self support page and attempt to load the page content. If loading fails, try again
- * after an interval.
- */
- _loadSelfSupport() {
- // Fetch the Self Support URL from the preferences.
- let unformattedURL = Services.prefs.getStringPref(PREF_URL, "");
- let url = Services.urlFormatter.formatURL(unformattedURL);
- if (!url.startsWith("https:")) {
- this._log.error("_loadSelfSupport - Non HTTPS URL provided: " + url);
- return;
- }
-
- this._log.config("_loadSelfSupport - URL " + url);
-
- // Create the hidden browser.
- this._makeHiddenBrowser(url).then(() => {
- // Load UITour frame script.
- this._browser.messageManager.loadFrameScript(UITOUR_FRAME_SCRIPT, true);
-
- // We need to watch for load errors as well and, in case, try to reload
- // the self support page.
- const webFlags = Ci.nsIWebProgress.NOTIFY_STATE_WINDOW |
- Ci.nsIWebProgress.NOTIFY_STATE_REQUEST |
- Ci.nsIWebProgress.NOTIFY_LOCATION;
-
- this._progressListener = new ProgressListener(() => this._pageLoadErrorCallback(),
- () => this._pageSuccessCallback());
-
- this._browser.addProgressListener(this._progressListener, webFlags);
- });
- }
-};
-
-/**
- * A progress listener object which notifies of page load error and load success
- * through callbacks. When the page fails to load, the progress listener tries to
- * reload it up to MAX_RETRIES times. The page is not loaded again immediately, but
- * after a timeout.
- *
- * @param aLoadErrorCallback Called when a page failed to load MAX_RETRIES times.
- * @param aLoadSuccessCallback Called when a page correctly loads.
- */
-function ProgressListener(aLoadErrorCallback, aLoadSuccessCallback) {
- this._loadErrorCallback = aLoadErrorCallback;
- this._loadSuccessCallback = aLoadSuccessCallback;
- // The number of page loads attempted.
- this._loadAttempts = 0;
- this._log = Log.repository.getLogger(LOGGER_NAME);
- // The Id of the timer which triggers page load again in case of errors.
- this._reloadTimerId = null;
-}
-
-ProgressListener.prototype = {
- onLocationChange(aWebProgress, aRequest, aLocation, aFlags) {
- if (aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_ERROR_PAGE) {
- this._log.warn("onLocationChange - There was a problem fetching the SelfSupport URL (attempt " +
- this._loadAttempts + ").");
-
- // Increase the number of attempts and bail out if we failed too many times.
- this._loadAttempts++;
- if (this._loadAttempts > MAX_RETRIES) {
- this._loadErrorCallback();
- return;
- }
-
- // Reload the page after the retry interval expires. The interval is multiplied
- // by the number of attempted loads, so that it takes a bit more to try to reload
- // when frequently failing.
- this._reloadTimerId = setTimeout(() => {
- this._log.debug("onLocationChange - Reloading SelfSupport URL in the hidden browser.");
- aWebProgress.DOMWindow.location.reload();
- }, RETRY_INTERVAL_MS * this._loadAttempts);
- }
- },
-
- onStateChange(aWebProgress, aRequest, aFlags, aStatus) {
- if (aFlags & Ci.nsIWebProgressListener.STATE_STOP &&
- aFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK &&
- aFlags & Ci.nsIWebProgressListener.STATE_IS_WINDOW &&
- Components.isSuccessCode(aStatus)) {
- this._loadSuccessCallback();
- }
- },
-
- destroy() {
- // Make sure we don't try to reload self support when shutting down.
- clearTimeout(this._reloadTimerId);
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
- Ci.nsISupportsWeakReference]),
-};
--- a/browser/modules/moz.build
+++ b/browser/modules/moz.build
@@ -11,19 +11,16 @@ with Files("test/browser/*Telemetry*"):
BUG_COMPONENT = ("Toolkit", "Telemetry")
with Files("test/browser/*ContentSearch*"):
BUG_COMPONENT = ("Firefox", "Search")
with Files("test/browser/*PermissionUI*"):
BUG_COMPONENT = ("Firefox", "Site Identity and Permission Panels")
-with Files("test/browser/browser_SelfSupportBackend.js"):
- BUG_COMPONENT = ("Toolkit", "Telemetry")
-
with Files("test/browser/*SitePermissions*"):
BUG_COMPONENT = ("Firefox", "Site Identity and Permission Panels")
with Files("test/browser/browser_UnsubmittedCrashHandler.js"):
BUG_COMPONENT = ("Toolkit", "Crash Reporting")
with Files("test/browser/browser_bug1319078.js"):
BUG_COMPONENT = ("Core", "DOM: Core & HTML")
@@ -92,19 +89,16 @@ with Files("ProcessHangMonitor.jsm"):
BUG_COMPONENT = ("Core", "DOM: Content Processes")
with Files("ReaderParent.jsm"):
BUG_COMPONENT = ("Toolkit", "Reader Mode")
with Files("Sanitizer.jsm"):
BUG_COMPONENT = ("Firefox", "Preferences")
-with Files("SelfSupportBackend.jsm"):
- BUG_COMPONENT = ("Toolkit", "Telemetry")
-
with Files("SitePermissions.jsm"):
BUG_COMPONENT = ("Firefox", "Site Identity and Permission Panels")
with Files("Social*"):
BUG_COMPONENT = ("Firefox", "SocialAPI")
with Files("TransientPrefs.jsm"):
BUG_COMPONENT = ("Firefox", "Preferences")
@@ -155,17 +149,16 @@ EXTRA_JS_MODULES += [
'offlineAppCache.jsm',
'PermissionUI.jsm',
'PluginContent.jsm',
'ProcessHangMonitor.jsm',
'ReaderParent.jsm',
'RecentWindow.jsm',
'RemotePrompt.jsm',
'Sanitizer.jsm',
- 'SelfSupportBackend.jsm',
'SitePermissions.jsm',
'Social.jsm',
'SocialService.jsm',
'TransientPrefs.jsm',
'webrtcUI.jsm',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
--- a/browser/modules/test/browser/browser.ini
+++ b/browser/modules/test/browser/browser.ini
@@ -14,20 +14,16 @@ support-files =
contentSearchSuggestions.sjs
contentSearchSuggestions.xml
!/browser/components/search/test/head.js
!/browser/components/search/test/testEngine.xml
[browser_PermissionUI.js]
[browser_PermissionUI_prompts.js]
[browser_ProcessHangNotifications.js]
skip-if = !e10s
-[browser_SelfSupportBackend.js]
-support-files =
- ../../../components/uitour/test/uitour.html
- ../../../components/uitour/UITour-lib.js
[browser_SitePermissions.js]
[browser_SitePermissions_combinations.js]
[browser_SitePermissions_expiry.js]
[browser_SitePermissions_tab_urls.js]
[browser_taskbar_preview.js]
skip-if = os != "win"
[browser_UnsubmittedCrashHandler.js]
run-if = crashreporter
deleted file mode 100644
--- a/browser/modules/test/browser/browser_SelfSupportBackend.js
+++ /dev/null
@@ -1,172 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-// Pass an empty scope object to the import to prevent "leaked window property"
-// errors in tests.
-var Preferences = Cu.import("resource://gre/modules/Preferences.jsm", {}).Preferences;
-var PromiseUtils = Cu.import("resource://gre/modules/PromiseUtils.jsm", {}).PromiseUtils;
-var SelfSupportBackend =
- Cu.import("resource:///modules/SelfSupportBackend.jsm", {}).SelfSupportBackend;
-
-const PREF_SELFSUPPORT_ENABLED = "browser.selfsupport.enabled";
-const PREF_SELFSUPPORT_URL = "browser.selfsupport.url";
-const PREF_UITOUR_ENABLED = "browser.uitour.enabled";
-
-const TEST_WAIT_RETRIES = 60;
-
-const TEST_PAGE_URL = getRootDirectory(gTestPath) + "uitour.html";
-const TEST_PAGE_URL_HTTPS = TEST_PAGE_URL.replace("chrome://mochitests/content/", "https://example.com/");
-
-function sendSessionRestoredNotification() {
- let selfSupportBackendImpl =
- Cu.import("resource:///modules/SelfSupportBackend.jsm", {}).SelfSupportBackendInternal;
- selfSupportBackendImpl.observe(null, "sessionstore-windows-restored", null);
-}
-
-function toggleSelfSupportTestMode(testing) {
- let selfSupportBackendImpl =
- Cu.import("resource:///modules/SelfSupportBackend.jsm", {}).SelfSupportBackendInternal;
- selfSupportBackendImpl._testing = testing;
-}
-
-
-/**
- * Wait for self support page to load.
- *
- * @param aURL The URL to look for to identify the browser.
- *
- * @returns {Promise} Return a promise which is resolved when SelfSupport page is fully
- * loaded.
- */
-function promiseSelfSupportLoad(aURL) {
- return new Promise((resolve, reject) => {
- // Find the SelfSupport browser.
- let browser = null;
- let browserPromise = TestUtils.topicObserved("self-support-browser-created",
- (subject, topic) => {
- let url = subject.getAttribute("src");
- Cu.reportError("Got browser with src: " + url);
- if (url == aURL) {
- browser = subject;
- }
- return url == aURL;
- });
-
- // Once found, append a "load" listener to catch page loads.
- browserPromise.then(() => {
- if (browser.contentDocument.readyState === "complete") {
- resolve(browser);
- } else {
- let handler = () => {
- browser.removeEventListener("load", handler, true);
- resolve(browser);
- };
- browser.addEventListener("load", handler, true);
- }
- }, reject);
- });
-}
-
-/**
- * Prepare the test environment.
- */
-add_task(async function setupEnvironment() {
- // We always run the SelfSupportBackend in tests to check for weird behaviours.
- // Disable it to test its start-up.
- SelfSupportBackend.uninit();
-
- // Testing prefs are set via |user_pref|, so we need to get their value in order
- // to restore them.
- let selfSupportEnabled = Preferences.get(PREF_SELFSUPPORT_ENABLED, true);
- let uitourEnabled = Preferences.get(PREF_UITOUR_ENABLED, false);
- let selfSupportURL = Preferences.get(PREF_SELFSUPPORT_URL, "");
-
- // Enable the SelfSupport backend and set the page URL. We also make sure UITour
- // is enabled.
- Preferences.set(PREF_SELFSUPPORT_ENABLED, true);
- Preferences.set(PREF_UITOUR_ENABLED, true);
- Preferences.set(PREF_SELFSUPPORT_URL, TEST_PAGE_URL_HTTPS);
-
- // Whitelist the HTTPS page to use UITour.
- let pageURI = Services.io.newURI(TEST_PAGE_URL_HTTPS);
- Services.perms.add(pageURI, "uitour", Services.perms.ALLOW_ACTION);
-
- registerCleanupFunction(() => {
- Services.perms.remove(pageURI, "uitour");
- Preferences.set(PREF_SELFSUPPORT_ENABLED, selfSupportEnabled);
- Preferences.set(PREF_UITOUR_ENABLED, uitourEnabled);
- Preferences.set(PREF_SELFSUPPORT_URL, selfSupportURL);
- });
-});
-
-/**
- * Test that the self support page can use the UITour API and close itself.
- */
-add_task(async function test_selfSupport() {
- toggleSelfSupportTestMode(true);
- registerCleanupFunction(toggleSelfSupportTestMode.bind(null, false));
- // Initialise the SelfSupport backend and trigger the load.
- SelfSupportBackend.init();
-
- // Wait for the SelfSupport page to load.
- let selfSupportBrowserPromise = promiseSelfSupportLoad(TEST_PAGE_URL_HTTPS);
-
- // SelfSupportBackend waits for "sessionstore-windows-restored" to start loading. Send it.
- info("Sending sessionstore-windows-restored");
- sendSessionRestoredNotification();
-
- // Wait for the SelfSupport page to load.
- info("Waiting for the SelfSupport local page to load.");
- let selfSupportBrowser = await selfSupportBrowserPromise;
- Assert.ok(!!selfSupportBrowser, "SelfSupport browser must exist.");
-
- // Get a reference to the UITour API.
- info("Testing access to the UITour API.");
- let contentWindow =
- Cu.waiveXrays(selfSupportBrowser.contentDocument.defaultView);
- let uitourAPI = contentWindow.Mozilla.UITour;
-
- // Test the UITour API with a ping.
- let pingPromise = new Promise((resolve) => {
- uitourAPI.ping(resolve);
- });
- await pingPromise;
- info("Ping succeeded");
-
- let observePromise = ContentTask.spawn(selfSupportBrowser, null, async function checkObserve() {
- await new Promise(resolve => {
- let win = Cu.waiveXrays(content);
- win.Mozilla.UITour.observe((event, data) => {
- if (event != "Heartbeat:Engaged") {
- return;
- }
- Assert.equal(data.flowId, "myFlowID", "Check flowId");
- Assert.ok(!!data.timestamp, "Check timestamp");
- resolve(data);
- }, () => {});
- });
- });
-
- info("Notifying Heartbeat:Engaged");
- UITour.notify("Heartbeat:Engaged", {
- flowId: "myFlowID",
- timestamp: Date.now(),
- });
- await observePromise;
- info("Observed in the hidden frame");
-
- let selfSupportClosed = TestUtils.topicObserved("self-support-browser-destroyed");
- // Close SelfSupport from content.
- contentWindow.close();
-
- await selfSupportClosed;
- Assert.ok(!selfSupportBrowser.parentNode, "SelfSupport browser must have been removed.");
-
- // We shouldn't need this, but let's keep it to make sure closing SelfSupport twice
- // doesn't create any problem.
- SelfSupportBackend.uninit();
-});
-
--- a/layout/tools/reftest/reftest-preferences.js
+++ b/layout/tools/reftest/reftest-preferences.js
@@ -58,18 +58,17 @@ user_pref("layout.testing.overlay-scroll
user_pref("layout.interruptible-reflow.enabled", false);
// Tell the search service we are running in the US. This also has the
// desired side-effect of preventing our geoip lookup.
user_pref("browser.search.isUS", true);
user_pref("browser.search.countryCode", "US");
user_pref("browser.search.geoSpecificDefaults", false);
-// Make sure SelfSupport doesn't hit the network.
-user_pref("browser.selfsupport.url", "https://localhost/selfsupport-dummy/");
+// Make sure Shield doesn't hit the network.
user_pref("extensions.shield-recipe-client.api_url", "https://localhost/selfsupport-dummy/");
// use about:blank, not browser.startup.homepage
user_pref("browser.startup.page", 0);
// Allow XUL and XBL files to be opened from file:// URIs
user_pref("dom.allow_XUL_XBL_for_file", true);
--- a/testing/mochitest/browser-test.js
+++ b/testing/mochitest/browser-test.js
@@ -6,19 +6,16 @@ var gConfig;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://gre/modules/AppConstants.jsm");
Cu.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ContentSearch",
"resource:///modules/ContentSearch.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "SelfSupportBackend",
- "resource:///modules/SelfSupportBackend.jsm");
-
const SIMPLETEST_OVERRIDES =
["ok", "is", "isnot", "todo", "todo_is", "todo_isnot", "info", "expectAssertions", "requestCompleteLog"];
// non-android is bootstrapped by marionette
if (Services.appinfo.OS == 'Android') {
window.addEventListener("load", function() {
window.addEventListener("MozAfterPaint", function() {
setTimeout(testInit, 0);
@@ -597,17 +594,16 @@ Tester.prototype = {
// This will prevent false positives for tests that were the last
// to touch the sidebar. They will thus not be blamed for leaking
// a document.
let sidebar = document.getElementById("sidebar");
sidebar.setAttribute("src", "data:text/html;charset=utf-8,");
sidebar.docShell.createAboutBlankContentViewer(null);
sidebar.setAttribute("src", "about:blank");
- SelfSupportBackend.uninit();
SocialShare.uninit();
}
// Destroy BackgroundPageThumbs resources.
let {BackgroundPageThumbs} =
Cu.import("resource://gre/modules/BackgroundPageThumbs.jsm", {});
BackgroundPageThumbs._destroy();
--- a/testing/profiles/prefs_general.js
+++ b/testing/profiles/prefs_general.js
@@ -296,18 +296,17 @@ user_pref("browser.uitour.url", "http://
// Tell the search service we are running in the US. This also has the desired
// side-effect of preventing our geoip lookup.
user_pref("browser.search.isUS", true);
user_pref("browser.search.countryCode", "US");
// This will prevent HTTP requests for region defaults.
user_pref("browser.search.geoSpecificDefaults", false);
-// Make sure self support doesn't hit the network.
-user_pref("browser.selfsupport.url", "https://example.com/selfsupport-dummy/");
+// Make sure Shield doesn't hit the network.
user_pref("extensions.shield-recipe-client.api_url", "https://example.com/selfsupport-dummy/");
user_pref("media.eme.enabled", true);
// Set the number of shmems the PChromiumCDM protocol pre-allocates to 0,
// so that we test the case where we under-estimate how many shmems we need
// to send decoded video frames from the CDM to Gecko.
user_pref("media.eme.chromium-api.video-shmems", 0);
--- a/testing/talos/talos/config.py
+++ b/testing/talos/talos/config.py
@@ -113,18 +113,16 @@ DEFAULTS = dict(
'http://127.0.0.1/trackingprotection/tour',
'browser.safebrowsing.phishing.enabled': False,
'browser.safebrowsing.malware.enabled': False,
'browser.safebrowsing.blockedURIs.enabled': False,
'privacy.trackingprotection.enabled': False,
'privacy.trackingprotection.pbmode.enabled': False,
'browser.search.isUS': True,
'browser.search.countryCode': 'US',
- 'browser.selfsupport.url':
- 'https://127.0.0.1/selfsupport-dummy/',
'extensions.update.url':
'http://127.0.0.1/extensions-dummy/updateURL',
'extensions.update.background.url':
'http://127.0.0.1/extensions-dummy/updateBackgroundURL',
'extensions.blocklist.enabled': False,
'extensions.blocklist.url':
'http://127.0.0.1/extensions-dummy/blocklistURL',
'extensions.hotfix.url':
--- a/testing/xpcshell/head.js
+++ b/testing/xpcshell/head.js
@@ -1600,17 +1600,16 @@ try {
try {
if (runningInParent) {
let prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref("media.gmp-manager.url.override", "http://%(server)s/dummy-gmp-manager.xml");
prefs.setCharPref("media.gmp-manager.updateEnabled", false);
prefs.setCharPref("extensions.systemAddon.update.url", "http://%(server)s/dummy-system-addons.xml");
- prefs.setCharPref("browser.selfsupport.url", "https://%(server)s/selfsupport-dummy/");
prefs.setCharPref("extensions.shield-recipe-client.api_url",
"https://%(server)s/selfsupport-dummy/");
prefs.setCharPref("toolkit.telemetry.server", "https://%(server)s/telemetry-dummy");
prefs.setCharPref("browser.search.geoip.url", "https://%(server)s/geoip-dummy");
prefs.setCharPref("browser.safebrowsing.downloads.remote.url", "https://%(server)s/safebrowsing-dummy");
}
} catch (e) { }
--- a/toolkit/components/extensions/test/mochitest/head_webrequest.js
+++ b/toolkit/components/extensions/test/mochitest/head_webrequest.js
@@ -1,17 +1,10 @@
"use strict";
-// SelfSupport has a tendency to fire when running a test alone (it would
-// fire in some earlier test otherwise), without a good way to turn it off
-// we just set the url to "".
-SpecialPowers.pushPrefEnv({
- set: [["browser.selfsupport.url", ""]],
-});
-
let commonEvents = {
"onBeforeRequest": [{urls: ["<all_urls>"]}, ["blocking"]],
"onBeforeSendHeaders": [{urls: ["<all_urls>"]}, ["blocking", "requestHeaders"]],
"onSendHeaders": [{urls: ["<all_urls>"]}, ["requestHeaders"]],
"onBeforeRedirect": [{urls: ["<all_urls>"]}],
"onHeadersReceived": [{urls: ["<all_urls>"]}, ["blocking", "responseHeaders"]],
// Auth tests will need to set their own events object
// "onAuthRequired": [{urls: ["<all_urls>"]}, ["blocking", "responseHeaders"]],
--- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_basic.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_basic.html
@@ -13,22 +13,16 @@
"use strict";
if (AppConstants.platform === "android") {
SimpleTest.requestLongerTimeout(3);
}
let extension;
add_task(async function setup() {
- // SelfSupport has a tendency to fire when running this test alone, without
- // a good way to turn it off we just set the url to ""
- await SpecialPowers.pushPrefEnv({
- set: [["browser.selfsupport.url", ""]],
- });
-
// Clear the image cache, since it gets in the way otherwise.
let imgTools = SpecialPowers.Cc["@mozilla.org/image/tools;1"].getService(SpecialPowers.Ci.imgITools);
let cache = imgTools.getImgCacheForDocument(document);
cache.clearCache(false);
extension = makeExtension();
await extension.startup();
});