diff options
Diffstat (limited to 'toolkit')
54 files changed, 245 insertions, 2561 deletions
diff --git a/toolkit/components/moz.build b/toolkit/components/moz.build index 12e1748e9..5dba09a32 100644 --- a/toolkit/components/moz.build +++ b/toolkit/components/moz.build @@ -79,9 +79,6 @@ if not CONFIG['MOZ_FENNEC']: if CONFIG['NS_PRINTING']: DIRS += ['printing'] -if CONFIG['MOZ_CRASHREPORTER']: - DIRS += ['crashes'] - if CONFIG['BUILD_CTYPES']: DIRS += ['ctypes'] diff --git a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js index b66489234..720e80446 100644 --- a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js +++ b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js @@ -808,6 +808,9 @@ LoginManagerPrompter.prototype = { */ _showLoginCaptureDoorhanger(login, type) { let { browser } = this._getNotifyWindow(); + if (!browser) { + return; + } let saveMsgNames = { prompt: login.username === "" ? "rememberLoginMsgNoUser" @@ -1405,10 +1408,34 @@ LoginManagerPrompter.prototype = { * Given a content DOM window, returns the chrome window and browser it's in. */ _getChromeWindow: function (aWindow) { + // Handle non-e10s toolkit consumers. + if (!Cu.isCrossProcessWrapper(aWindow)) { + let chromeWin = aWindow.QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIWebNavigation) + .QueryInterface(Ci.nsIDocShell) + .chromeEventHandler.ownerGlobal; + if (!chromeWin) { + return null; + } + + // gBrowser only exists on some apps, like Firefox. + let tabbrowser = chromeWin.gBrowser || + (typeof chromeWin.getBrowser == "function" ? chromeWin.getBrowser() : null); + // At least serve the chrome window if getBrowser() + // or getBrowserForContentWindow() are not supported. + if (!tabbrowser || typeof tabbrowser.getBrowserForContentWindow != "function") { + return { win: chromeWin }; + } + + let browser = tabbrowser.getBrowserForContentWindow(aWindow); + return { win: chromeWin, browser }; + } + let windows = Services.wm.getEnumerator(null); while (windows.hasMoreElements()) { let win = windows.getNext(); - let browser = win.gBrowser.getBrowserForContentWindow(aWindow); + let tabbrowser = win.gBrowser || win.getBrowser(); + let browser = tabbrowser.getBrowserForContentWindow(aWindow); if (browser) { return { win, browser }; } diff --git a/toolkit/components/places/tests/cpp/places_test_harness_tail.h b/toolkit/components/places/tests/cpp/places_test_harness_tail.h index 4bbd45ccb..9e57c3724 100644 --- a/toolkit/components/places/tests/cpp/places_test_harness_tail.h +++ b/toolkit/components/places/tests/cpp/places_test_harness_tail.h @@ -6,9 +6,6 @@ #include "nsWidgetsCID.h" #include "nsIComponentRegistrar.h" -#ifdef MOZ_CRASHREPORTER -#include "nsICrashReporter.h" -#endif #ifndef TEST_NAME #error "Must #define TEST_NAME before including places_test_harness_tail.h" @@ -94,32 +91,6 @@ main(int aArgc, return -1; } -#ifdef MOZ_CRASHREPORTER - char* enabled = PR_GetEnv("MOZ_CRASHREPORTER"); - if (enabled && !strcmp(enabled, "1")) { - // bug 787458: move this to an even-more-common location to use in all - // C++ unittests - nsCOMPtr<nsICrashReporter> crashreporter = - do_GetService("@mozilla.org/toolkit/crash-reporter;1"); - if (crashreporter) { - fprintf(stderr, "Setting up crash reporting\n"); - - nsCOMPtr<nsIProperties> dirsvc = - do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID); - if (!dirsvc) - NS_RUNTIMEABORT("Couldn't get directory service"); - nsCOMPtr<nsIFile> cwd; - nsresult rv = dirsvc->Get(NS_OS_CURRENT_WORKING_DIR, - NS_GET_IID(nsIFile), - getter_AddRefs(cwd)); - if (NS_FAILED(rv)) - NS_RUNTIMEABORT("Couldn't get CWD"); - crashreporter->SetEnabled(true); - crashreporter->SetMinidumpPath(cwd); - } - } -#endif - RefPtr<WaitForConnectionClosed> spinClose = new WaitForConnectionClosed(); // Tinderboxes are constantly on idle. Since idle tasks can interact with diff --git a/toolkit/components/protobuf/moz.build b/toolkit/components/protobuf/moz.build index b5015eb67..8cca3514c 100644 --- a/toolkit/components/protobuf/moz.build +++ b/toolkit/components/protobuf/moz.build @@ -117,10 +117,13 @@ DEFINES['GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER'] = True # Suppress warnings in third-party code. if CONFIG['GNU_CXX']: CXXFLAGS += [ - '-Wno-null-conversion', '-Wno-return-type', '-Wno-sign-compare', ] + if CONFIG['CLANG_CXX']: + CXXFLAGS += [ + '-Wno-null-conversion', + ] elif CONFIG['_MSC_VER']: CXXFLAGS += [ '-wd4005', # 'WIN32_LEAN_AND_MEAN' : macro redefinition diff --git a/toolkit/components/telemetry/TelemetryEnvironment.jsm b/toolkit/components/telemetry/TelemetryEnvironment.jsm index 2f4ac81ba..910d804ae 100644 --- a/toolkit/components/telemetry/TelemetryEnvironment.jsm +++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm @@ -153,7 +153,6 @@ const DEFAULT_ENVIRONMENT_PREFS = new Map([ ["dom.ipc.plugins.enabled", {what: RECORD_PREF_VALUE}], ["dom.ipc.processCount", {what: RECORD_PREF_VALUE, requiresRestart: true}], ["dom.max_script_run_time", {what: RECORD_PREF_VALUE}], - ["experiments.manifest.uri", {what: RECORD_PREF_VALUE}], ["extensions.autoDisableScopes", {what: RECORD_PREF_VALUE}], ["extensions.enabledScopes", {what: RECORD_PREF_VALUE}], ["extensions.blocklist.enabled", {what: RECORD_PREF_VALUE}], @@ -209,7 +208,6 @@ const PREF_E10S_COHORT = "e10s.rollout.cohort"; const COMPOSITOR_CREATED_TOPIC = "compositor:created"; const DISTRIBUTION_CUSTOMIZATION_COMPLETE_TOPIC = "distribution-customization-complete"; -const EXPERIMENTS_CHANGED_TOPIC = "experiments-changed"; const GFX_FEATURES_READY_TOPIC = "gfx-features-ready"; const SEARCH_ENGINE_MODIFIED_TOPIC = "browser-search-engine-modified"; const SEARCH_SERVICE_TOPIC = "browser-search-service"; @@ -465,7 +463,6 @@ EnvironmentAddonBuilder.prototype = { watchForChanges: function() { this._loaded = true; AddonManager.addAddonListener(this); - Services.obs.addObserver(this, EXPERIMENTS_CHANGED_TOPIC, false); }, // AddonListener @@ -490,7 +487,6 @@ EnvironmentAddonBuilder.prototype = { // nsIObserver observe: function (aSubject, aTopic, aData) { this._environment._log.trace("observe - Topic " + aTopic); - this._checkForChanges("experiment-changed"); }, _checkForChanges: function(changeReason) { @@ -515,7 +511,6 @@ EnvironmentAddonBuilder.prototype = { _shutdownBlocker: function() { if (this._loaded) { AddonManager.removeAddonListener(this); - Services.obs.removeObserver(this, EXPERIMENTS_CHANGED_TOPIC); } return this._pendingTask; }, @@ -545,7 +540,6 @@ EnvironmentAddonBuilder.prototype = { theme: yield this._getActiveTheme(), activePlugins: this._getActivePlugins(), activeGMPlugins: yield this._getActiveGMPlugins(), - activeExperiment: this._getActiveExperiment(), persona: personaId, }; @@ -718,29 +712,7 @@ EnvironmentAddonBuilder.prototype = { } return activeGMPlugins; - }), - - /** - * Get the active experiment data in object form. - * @return Object containing the active experiment data. - */ - _getActiveExperiment: function () { - let experimentInfo = {}; - try { - let scope = {}; - Cu.import("resource:///modules/experiments/Experiments.jsm", scope); - let experiments = scope.Experiments.instance(); - let activeExperiment = experiments.getActiveExperimentID(); - if (activeExperiment) { - experimentInfo.id = activeExperiment; - experimentInfo.branch = experiments.getActiveExperimentBranch(); - } - } catch (e) { - // If this is not Firefox, the import will fail. - } - - return experimentInfo; - }, + }) }; function EnvironmentCache() { diff --git a/toolkit/components/terminator/nsTerminator.cpp b/toolkit/components/terminator/nsTerminator.cpp index f9459cc5d..91e872821 100644 --- a/toolkit/components/terminator/nsTerminator.cpp +++ b/toolkit/components/terminator/nsTerminator.cpp @@ -29,9 +29,6 @@ #include "nsIObserverService.h" #include "nsIPrefService.h" -#if defined(MOZ_CRASHREPORTER) -#include "nsExceptionHandler.h" -#endif #if defined(XP_WIN) #include <windows.h> @@ -541,13 +538,7 @@ nsTerminator::UpdateTelemetry() void nsTerminator::UpdateCrashReport(const char* aTopic) { -#if defined(MOZ_CRASHREPORTER) - // In case of crash, we wish to know where in shutdown we are - nsAutoCString report(aTopic); - - Unused << CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ShutdownProgress"), - report); -#endif // defined(MOZ_CRASH_REPORTER) + /*** STUB ***/ } diff --git a/toolkit/content/aboutSupport.js b/toolkit/content/aboutSupport.js index 5daf6d189..e66095e20 100644 --- a/toolkit/content/aboutSupport.js +++ b/toolkit/content/aboutSupport.js @@ -75,69 +75,7 @@ var snapshotFormatters = { }, crashes: function crashes(data) { - if (!AppConstants.MOZ_CRASHREPORTER) - return; - - let strings = stringBundle(); - let daysRange = Troubleshoot.kMaxCrashAge / (24 * 60 * 60 * 1000); - $("crashes-title").textContent = - PluralForm.get(daysRange, strings.GetStringFromName("crashesTitle")) - .replace("#1", daysRange); - let reportURL; - try { - reportURL = Services.prefs.getCharPref("breakpad.reportURL"); - // Ignore any non http/https urls - if (!/^https?:/i.test(reportURL)) - reportURL = null; - } - catch (e) { } - if (!reportURL) { - $("crashes-noConfig").style.display = "block"; - $("crashes-noConfig").classList.remove("no-copy"); - return; - } - $("crashes-allReports").style.display = "block"; - $("crashes-allReports").classList.remove("no-copy"); - - if (data.pending > 0) { - $("crashes-allReportsWithPending").textContent = - PluralForm.get(data.pending, strings.GetStringFromName("pendingReports")) - .replace("#1", data.pending); - } - - let dateNow = new Date(); - $.append($("crashes-tbody"), data.submitted.map(function (crash) { - let date = new Date(crash.date); - let timePassed = dateNow - date; - let formattedDate; - if (timePassed >= 24 * 60 * 60 * 1000) - { - let daysPassed = Math.round(timePassed / (24 * 60 * 60 * 1000)); - let daysPassedString = strings.GetStringFromName("crashesTimeDays"); - formattedDate = PluralForm.get(daysPassed, daysPassedString) - .replace("#1", daysPassed); - } - else if (timePassed >= 60 * 60 * 1000) - { - let hoursPassed = Math.round(timePassed / (60 * 60 * 1000)); - let hoursPassedString = strings.GetStringFromName("crashesTimeHours"); - formattedDate = PluralForm.get(hoursPassed, hoursPassedString) - .replace("#1", hoursPassed); - } - else - { - let minutesPassed = Math.max(Math.round(timePassed / (60 * 1000)), 1); - let minutesPassedString = strings.GetStringFromName("crashesTimeMinutes"); - formattedDate = PluralForm.get(minutesPassed, minutesPassedString) - .replace("#1", minutesPassed); - } - return $.new("tr", [ - $.new("td", [ - $.new("a", crash.id, null, {href : reportURL + crash.id}) - ]), - $.new("td", formattedDate) - ]); - })); + return; }, extensions: function extensions(data) { @@ -151,22 +89,6 @@ var snapshotFormatters = { })); }, - experiments: function experiments(data) { - $.append($("experiments-tbody"), data.map(function (experiment) { - return $.new("tr", [ - $.new("td", experiment.name), - $.new("td", experiment.id), - $.new("td", experiment.description), - $.new("td", experiment.active), - $.new("td", experiment.endDate), - $.new("td", [ - $.new("a", experiment.detailURL, null, {href : experiment.detailURL, }) - ]), - $.new("td", experiment.branch), - ]); - })); - }, - modifiedPreferences: function modifiedPreferences(data) { $.append($("prefs-tbody"), sortedArrayFromObject(data).map( function ([name, value]) { diff --git a/toolkit/content/aboutSupport.xhtml b/toolkit/content/aboutSupport.xhtml index e2885c8b8..8464e014b 100644 --- a/toolkit/content/aboutSupport.xhtml +++ b/toolkit/content/aboutSupport.xhtml @@ -253,34 +253,6 @@ </table> <!-- - - - - - - - - - - - - - - - - - - - - --> -#ifdef MOZ_CRASHREPORTER - - <h2 class="major-section" id="crashes-title"> - &aboutSupport.crashes.title; - </h2> - - <table id="crashes-table"> - <thead> - <tr> - <th> - &aboutSupport.crashes.id; - </th> - <th> - &aboutSupport.crashes.sendDate; - </th> - </tr> - </thead> - <tbody id="crashes-tbody"> - </tbody> - </table> - <p id="crashes-allReports" class="hidden no-copy"> - <a href="about:crashes" id="crashes-allReportsWithPending" class="block">&aboutSupport.crashes.allReports;</a> - </p> - <p id="crashes-noConfig" class="hidden no-copy">&aboutSupport.crashes.noConfig;</p> - -#endif - <!-- - - - - - - - - - - - - - - - - - - - - --> - <h2 class="major-section"> &aboutSupport.extensionsTitle; </h2> @@ -504,39 +476,6 @@ </table> - <h2 class="major-section"> - &aboutSupport.experimentsTitle; - </h2> - - <table> - <thead> - <tr> - <th> - &aboutSupport.experimentName; - </th> - <th> - &aboutSupport.experimentId; - </th> - <th> - &aboutSupport.experimentDescription; - </th> - <th> - &aboutSupport.experimentActive; - </th> - <th> - &aboutSupport.experimentEndDate; - </th> - <th> - &aboutSupport.experimentHomepage; - </th> - <th> - &aboutSupport.experimentBranch; - </th> - </tr> - </thead> - <tbody id="experiments-tbody"> - </tbody> - </table> <!-- - - - - - - - - - - - - - - - - - - - - --> #if defined(MOZ_SANDBOX) diff --git a/toolkit/content/browser-child.js b/toolkit/content/browser-child.js index c819e3db6..7d0fe18c5 100644 --- a/toolkit/content/browser-child.js +++ b/toolkit/content/browser-child.js @@ -17,12 +17,6 @@ Cu.import("resource://gre/modules/Timer.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PageThumbUtils", "resource://gre/modules/PageThumbUtils.jsm"); -if (AppConstants.MOZ_CRASHREPORTER) { - XPCOMUtils.defineLazyServiceGetter(this, "CrashReporter", - "@mozilla.org/xre/app-info;1", - "nsICrashReporter"); -} - function makeInputStream(aString) { let stream = Cc["@mozilla.org/io/string-input-stream;1"]. createInstance(Ci.nsISupportsCString); @@ -174,15 +168,6 @@ var WebProgressListener = { json.principal = content.document.nodePrincipal; json.synthetic = content.document.mozSyntheticDocument; json.inLoadURI = WebNavigation.inLoadURI; - - if (AppConstants.MOZ_CRASHREPORTER && CrashReporter.enabled) { - let uri = aLocationURI.clone(); - try { - // If the current URI contains a username/password, remove it. - uri.userPass = ""; - } catch (ex) { /* Ignore failures on about: URIs. */ } - CrashReporter.annotateCrashReport("URL", uri.spec); - } } this._send("Content:LocationChange", json, objects); @@ -310,17 +295,6 @@ var WebNavigation = { }, loadURI: function(uri, flags, referrer, referrerPolicy, postData, headers, baseURI) { - if (AppConstants.MOZ_CRASHREPORTER && CrashReporter.enabled) { - let annotation = uri; - try { - let url = Services.io.newURI(uri, null, null); - // If the current URI contains a username/password, remove it. - url.userPass = ""; - annotation = url.spec; - } catch (ex) { /* Ignore failures to parse and failures - on about: URIs. */ } - CrashReporter.annotateCrashReport("URL", annotation); - } if (referrer) referrer = Services.io.newURI(referrer, null, null); if (postData) diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn index 0a0f0253b..f9ac19a24 100644 --- a/toolkit/content/jar.mn +++ b/toolkit/content/jar.mn @@ -28,7 +28,7 @@ toolkit.jar: content/global/aboutwebrtc/aboutWebrtc.css (aboutwebrtc/aboutWebrtc.css) content/global/aboutwebrtc/aboutWebrtc.js (aboutwebrtc/aboutWebrtc.js) content/global/aboutwebrtc/aboutWebrtc.html (aboutwebrtc/aboutWebrtc.html) - content/global/aboutSupport.js +* content/global/aboutSupport.js * content/global/aboutSupport.xhtml content/global/aboutTelemetry.js content/global/aboutTelemetry.xhtml @@ -54,7 +54,12 @@ toolkit.jar: #endif content/global/filepicker.properties content/global/globalOverlay.js + content/global/memoriam.xhtml +* content/global/mozilla.css content/global/mozilla.xhtml +#ifdef MOZ_PHOENIX + content/global/logopage.xhtml +#endif content/global/process-content.js content/global/resetProfile.css content/global/resetProfile.js diff --git a/toolkit/content/license.html b/toolkit/content/license.html index 99ee42fde..45889a191 100644 --- a/toolkit/content/license.html +++ b/toolkit/content/license.html @@ -87,7 +87,7 @@ <li><a href="about:license#dtoa">dtoa License</a></li> <li><a href="about:license#hunspell-nl">Dutch Spellchecking Dictionary License</a></li> #if defined(XP_WIN) || defined(XP_LINUX) - <li><a href="about:license#emojione">EmojiOne License</a></li> + <li><a href="about:license#twemoji">Twemoji License</a></li> #endif <li><a href="about:license#hunspell-ee">Estonian Spellchecking Dictionary License</a></li> <li><a href="about:license#expat">Expat License</a></li> @@ -2911,14 +2911,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <hr> #if defined(XP_WIN) || defined(XP_LINUX) - <h1><a id="emojione"></a>EmojiOne License</h1> + <h1><a id="twemoji"></a>Twemoji License</h1> <p>This license applies to the emoji art contained within the bundled emoji font file.</p> <pre> -Copyright (c) 2016 Ranks.com Inc. -Copyright (c) 2014 Twitter, Inc and other contributors. +Copyright (c) 2018 Twitter, Inc and other contributors. Creative Commons Attribution 4.0 International (CC BY 4.0) diff --git a/toolkit/content/logopage.xhtml b/toolkit/content/logopage.xhtml new file mode 100644 index 000000000..bcf1da0f0 --- /dev/null +++ b/toolkit/content/logopage.xhtml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" + "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" [ +]> + +<!-- 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/. --> + +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title></title> + <style type="text/css"> + body { + background: Menu; + color: MenuText; + } + + img { + text-align: center; + position: absolute; + margin: auto; + top: 0; + right: 0; + bottom: 0; + left: 0; + opacity: 0.2; + } + </style> +</head> + +<body> + <img src="about:logo" alt=""/> +</body> +</html> diff --git a/toolkit/content/memoriam.xhtml b/toolkit/content/memoriam.xhtml new file mode 100644 index 000000000..f1a1b474d --- /dev/null +++ b/toolkit/content/memoriam.xhtml @@ -0,0 +1,76 @@ +<!DOCTYPE html +[ + <!ENTITY % directionDTD SYSTEM "chrome://global/locale/global.dtd" > + %directionDTD; + <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd"> + %brandDTD; +]> + +<!-- 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/. --> + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta charset='utf-8' /> + <title>Mozilla: In Memoriam</title> + +<style> +html { + background: maroon radial-gradient( circle, #a01010 0%, #800000 80%) center center / cover no-repeat; + color: white; + font-style: italic; + text-rendering: optimizeLegibility; + min-height: 100%; +} + +#moztext { + margin-top: 15%; + font-size: 1.1em; + font-family: serif; + text-align: center; + line-height: 1.5; +} + +#from { + font-size: 1.0em; + font-family: serif; + text-align: right; +} + +em { + font-size: 1.3em; + line-height: 0; +} + +a { + text-decoration: none; + color: white; +} +</style> +</head> + +<body dir="&locale.dir;"> + +<section> + <p id="moztext"> + <h1>Mozilla: In Memoriam</h1> + <br/> + Dedicated to the tireless developers who have come and gone.<br/> + To those who have put their heart and soul into Mozilla products.<br/> + To those who have seen their good intentions and hard work squandered.<br/> + To those who really cared about the user, and cared about usability.<br/> + To those who truly understood us and desired freedom, but were unheard.<br/> + To those who knew that change is inevitable, but loss of vision is not.<br/> + To those who were forced to give up the good fight.<br/> + <br/> + <em>Thank you.</em> &brandFullName; would not have been possible without you.<br/> + <br/> + </p> + + <p id="from"> + </p> +</section> + +</body> +</html>
\ No newline at end of file diff --git a/toolkit/content/mozilla.css b/toolkit/content/mozilla.css new file mode 100644 index 000000000..d5eae6415 --- /dev/null +++ b/toolkit/content/mozilla.css @@ -0,0 +1,36 @@ +html { +%ifdef MC_PALEMOON + background: #333399 radial-gradient( circle at 75% 25%, #6666b0 0%, #333399 40%, #111177 80%) center center / cover no-repeat; +%else + background: maroon radial-gradient( circle, #a01010 0%, #800000 80%) center center / cover no-repeat; +%endif + + color: white; + font-style: italic; + text-rendering: optimizeLegibility; + min-height: 100%; +} + +#moztext { + margin-top: 15%; + font-size: 1.1em; + font-family: serif; + text-align: center; + line-height: 1.5; +} + +#from { + font-size: 1.95em; + font-family: serif; + text-align: right; +} + +em { + font-size: 1.3em; + line-height: 0; +} + +a { + text-decoration: none; + color: white; +}
\ No newline at end of file diff --git a/toolkit/content/mozilla.xhtml b/toolkit/content/mozilla.xhtml index 2acfc9f5d..8c79b5ff9 100644 --- a/toolkit/content/mozilla.xhtml +++ b/toolkit/content/mozilla.xhtml @@ -15,39 +15,8 @@ <meta charset='utf-8' /> <title>&chronicles.title.55.2;</title> -<style> -html { - background: maroon radial-gradient( circle, #a01010 0%, #800000 80%) center center / cover no-repeat; - color: white; - font-style: italic; - text-rendering: optimizeLegibility; - min-height: 100%; -} - -#moztext { - margin-top: 15%; - font-size: 1.1em; - font-family: serif; - text-align: center; - line-height: 1.5; -} - -#from { - font-size: 1.95em; - font-family: serif; - text-align: right; -} - -em { - font-size: 1.3em; - line-height: 0; -} - -a { - text-decoration: none; - color: white; -} -</style> + <link rel="stylesheet" href="chrome://global/content/mozilla.css" + type="text/css"/> </head> <body dir="&locale.dir;"> diff --git a/toolkit/content/plugins.html b/toolkit/content/plugins.html index 84cbba596..d389f52dd 100644 --- a/toolkit/content/plugins.html +++ b/toolkit/content/plugins.html @@ -10,6 +10,7 @@ "use strict"; Components.utils.import("resource://gre/modules/Services.jsm"); + Components.utils.import("resource://gre/modules/AddonManager.jsm"); var Ci = Components.interfaces; var strBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(Ci.nsIStringBundleService); @@ -57,7 +58,7 @@ */ navigator.plugins.refresh(false); - addMessageListener("PluginList", function({ data: aPlugins }) { + AddonManager.getAddonsByTypes(["plugin"], function (aPlugins) { var fragment = document.createDocumentFragment(); // "Installed plugins" @@ -209,8 +210,6 @@ document.getElementById("outside").appendChild(fragment); }); - - sendAsyncMessage("RequestPlugins"); </script> </div> </body> diff --git a/toolkit/locales/Makefile.in b/toolkit/locales/Makefile.in index e20128611..189e0b1b0 100644 --- a/toolkit/locales/Makefile.in +++ b/toolkit/locales/Makefile.in @@ -30,11 +30,3 @@ chrome-%: libs:: update.locale sed -e 's/%AB_CD%/$(AB_CD)/' $< > $(FINAL_TARGET)/update.locale -ifdef MOZ_CRASHREPORTER -libs:: crashreporter.ini -ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) - $(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/crashreporter.app/Contents/Resources -else - $(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET) -endif -endif diff --git a/toolkit/locales/l10n.mk b/toolkit/locales/l10n.mk index 34d78d33c..05bda0b56 100644 --- a/toolkit/locales/l10n.mk +++ b/toolkit/locales/l10n.mk @@ -120,14 +120,6 @@ ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) ifneq (en,$(LPROJ_ROOT)) mv $(STAGEDIST)/en.lproj $(STAGEDIST)/$(LPROJ_ROOT).lproj endif -ifdef MOZ_CRASHREPORTER -# On Mac OS X, the crashreporter.ini file needs to be moved from under the -# application bundle's Resources directory where all other l10n files are -# located to the crash reporter bundle's Resources directory. - mv $(STAGEDIST)/crashreporter.app/Contents/Resources/crashreporter.ini \ - $(STAGEDIST)/../MacOS/crashreporter.app/Contents/Resources/crashreporter.ini - $(RM) -rf $(STAGEDIST)/crashreporter.app -endif endif $(NSINSTALL) -D $(DIST)/l10n-stage/$(PKG_PATH) diff --git a/toolkit/modules/AppConstants.jsm b/toolkit/modules/AppConstants.jsm index ba5d82c01..93acea0ec 100644 --- a/toolkit/modules/AppConstants.jsm +++ b/toolkit/modules/AppConstants.jsm @@ -183,13 +183,6 @@ this.AppConstants = Object.freeze({ Services.vc.compare(platformVersion, version) <= 0; }, - MOZ_CRASHREPORTER: -#ifdef MOZ_CRASHREPORTER - true, -#else - false, -#endif - MOZ_VERIFY_MAR_SIGNATURE: #ifdef MOZ_VERIFY_MAR_SIGNATURE true, diff --git a/toolkit/modules/Services.jsm b/toolkit/modules/Services.jsm index 1bf1a89fe..58d87ffb1 100644 --- a/toolkit/modules/Services.jsm +++ b/toolkit/modules/Services.jsm @@ -39,15 +39,6 @@ XPCOMUtils.defineLazyGetter(Services, "dirsvc", function () { .QueryInterface(Ci.nsIProperties); }); -#ifdef MOZ_CRASHREPORTER -XPCOMUtils.defineLazyGetter(Services, "crashmanager", () => { - let ns = {}; - Components.utils.import("resource://gre/modules/CrashManager.jsm", ns); - - return ns.CrashManager.Singleton; -}); -#endif - XPCOMUtils.defineLazyGetter(Services, "mm", () => { return Cc["@mozilla.org/globalmessagemanager;1"] .getService(Ci.nsIMessageBroadcaster) diff --git a/toolkit/modules/Troubleshoot.jsm b/toolkit/modules/Troubleshoot.jsm index cc545b4c4..60f7e8666 100644 --- a/toolkit/modules/Troubleshoot.jsm +++ b/toolkit/modules/Troubleshoot.jsm @@ -12,13 +12,6 @@ Cu.import("resource://gre/modules/AddonManager.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/AppConstants.jsm"); -var Experiments; -try { - Experiments = Cu.import("resource:///modules/experiments/Experiments.jsm").Experiments; -} -catch (e) { -} - // We use a preferences whitelist to make sure we only show preferences that // are useful for support and won't compromise the user's privacy. Note that // entries are *prefixes*: for example, "accessibility." applies to all prefs @@ -263,18 +256,6 @@ var dataProviders = { }); }, - experiments: function experiments(done) { - if (Experiments === undefined) { - done([]); - return; - } - - // getExperiments promises experiment history - Experiments.instance().getExperiments().then( - experiments => done(experiments) - ); - }, - modifiedPreferences: function modifiedPreferences(done) { done(getPrefList(name => Services.prefs.prefHasUserValue(name))); }, @@ -549,19 +530,6 @@ var dataProviders = { } }; -if (AppConstants.MOZ_CRASHREPORTER) { - dataProviders.crashes = function crashes(done) { - let CrashReports = Cu.import("resource://gre/modules/CrashReports.jsm").CrashReports; - let reports = CrashReports.getReports(); - let now = new Date(); - let reportsNew = reports.filter(report => (now - report.date < Troubleshoot.kMaxCrashAge)); - let reportsSubmitted = reportsNew.filter(report => (!report.pending)); - let reportsPendingCount = reportsNew.length - reportsSubmitted.length; - let data = {submitted : reportsSubmitted, pending : reportsPendingCount}; - done(data); - } -} - if (AppConstants.MOZ_SANDBOX) { dataProviders.sandbox = function sandbox(done) { let data = {}; diff --git a/toolkit/moz.build b/toolkit/moz.build index d9becc9c6..778f1c0de 100644 --- a/toolkit/moz.build +++ b/toolkit/moz.build @@ -54,9 +54,6 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android': DIRS += ['system/androidproxy'] -if CONFIG['MOZ_CRASHREPORTER']: - DIRS += ['crashreporter'] - TEST_HARNESS_FILES.testing.mochitest.browser.toolkit.crashreporter.test.browser += [ 'crashreporter/test/browser/crashreport.sjs', ] diff --git a/toolkit/moz.configure b/toolkit/moz.configure index 4717af022..c1e0880c9 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -444,34 +444,10 @@ def omnijar_name(toolkit): set_config('OMNIJAR_NAME', omnijar_name) -project_flag('MOZ_PLACES', - help='Build Places if required', - set_as_define=True) - -project_flag('MOZ_SOCIAL', - help='Build SocialAPI if required', - default=True) - -project_flag('MOZ_SERVICES_HEALTHREPORT', - help='Build Firefox Health Reporter Service', - set_for_old_configure=True, - set_as_define=True) - -project_flag('MOZ_SERVICES_SYNC', - help='Build Sync Services if required') - -project_flag('MOZ_SERVICES_CLOUDSYNC', - help='Build Services/CloudSync if required') - project_flag('MOZ_ANDROID_HISTORY', help='Enable Android History instead of Places', set_as_define=True) -@depends('MOZ_PLACES', 'MOZ_ANDROID_HISTORY') -def check_places_and_android_history(places, android_history): - if places and android_history: - die('Cannot use MOZ_ANDROID_HISTORY alongside MOZ_PLACES.') - # Permissions system # ============================================================== option(name='--disable-permissions', diff --git a/toolkit/mozapps/extensions/content/extensions.js b/toolkit/mozapps/extensions/content/extensions.js index a799eeebb..6f2a47482 100644 --- a/toolkit/mozapps/extensions/content/extensions.js +++ b/toolkit/mozapps/extensions/content/extensions.js @@ -19,11 +19,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm"); XPCOMUtils.defineLazyGetter(this, "BrowserToolboxProcess", function () { - return Cu.import("resource://gre/modules/devtools/ToolboxProcess.jsm", {}). + return Cu.import("resource://devtools/client/framework/ToolboxProcess.jsm", {}). BrowserToolboxProcess; }); -XPCOMUtils.defineLazyModuleGetter(this, "Experiments", - "resource:///modules/experiments/Experiments.jsm"); const PREF_DISCOVERURL = "extensions.webservice.discoverURL"; const PREF_DISCOVER_ENABLED = "extensions.getAddons.showPane"; @@ -216,23 +214,6 @@ function isDiscoverEnabled() { return true; } -function getExperimentEndDate(aAddon) { - if (!("@mozilla.org/browser/experiments-service;1" in Cc)) { - return 0; - } - - if (!aAddon.isActive) { - return aAddon.endDate; - } - - let experiment = Experiments.instance().getActiveExperiment(); - if (!experiment) { - return 0; - } - - return experiment.endDate; -} - /** * Obtain the main DOMWindow for the current context. */ @@ -1316,28 +1297,7 @@ var gViewController = { doCommand: function cmd_neverActivateItem_doCommand(aAddon) { aAddon.userDisabled = true; } - }, - - cmd_experimentsLearnMore: { - isEnabled: function cmd_experimentsLearnMore_isEnabled() { - let mainWindow = getMainWindow(); - return mainWindow && "switchToTabHavingURI" in mainWindow; - }, - doCommand: function cmd_experimentsLearnMore_doCommand() { - let url = Services.prefs.getCharPref("toolkit.telemetry.infoURL"); - openOptionsInTab(url); - }, - }, - - cmd_experimentsOpenTelemetryPreferences: { - isEnabled: function cmd_experimentsOpenTelemetryPreferences_isEnabled() { - return !!getMainWindowWithPreferencesPane(); - }, - doCommand: function cmd_experimentsOpenTelemetryPreferences_doCommand() { - let mainWindow = getMainWindowWithPreferencesPane(); - mainWindow.openAdvancedPreferences("dataChoicesTab"); - }, - }, + } }, supportsCommand: function gVC_supportsCommand(aCommand) { @@ -1468,10 +1428,6 @@ function createItem(aObj, aIsInstall, aIsRemote) { // the binding handles the rest item.setAttribute("value", aObj.id); - if (aObj.type == "experiment") { - item.endDate = getExperimentEndDate(aObj); - } - return item; } @@ -2679,13 +2635,6 @@ var gListView = { // the existing item if (aInstall.existingAddon) this.removeItem(aInstall, true); - - if (aInstall.addon.type == "experiment") { - let item = this.getListItemForID(aInstall.addon.id); - if (item) { - item.endDate = getExperimentEndDate(aInstall.addon); - } - } }, addItem: function gListView_addItem(aObj, aIsInstall) { @@ -2945,34 +2894,6 @@ var gDetailView = { } } - if (this._addon.type == "experiment") { - let prefix = "details.experiment."; - let active = this._addon.isActive; - - let stateKey = prefix + "state." + (active ? "active" : "complete"); - let node = document.getElementById("detail-experiment-state"); - node.value = gStrings.ext.GetStringFromName(stateKey); - - let now = Date.now(); - let end = getExperimentEndDate(this._addon); - let days = Math.abs(end - now) / (24 * 60 * 60 * 1000); - - let timeKey = prefix + "time."; - let timeMessage; - if (days < 1) { - timeKey += (active ? "endsToday" : "endedToday"); - timeMessage = gStrings.ext.GetStringFromName(timeKey); - } else { - timeKey += (active ? "daysRemaining" : "daysPassed"); - days = Math.round(days); - let timeString = gStrings.ext.GetStringFromName(timeKey); - timeMessage = PluralForm.get(days, timeString) - .replace("#1", days); - } - - document.getElementById("detail-experiment-time").value = timeMessage; - } - this.fillSettingsRows(aScrollToPreferences, (function updateView_fillSettingsRows() { this.updateState(); gViewController.notifyViewChanged(); diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.jsm b/toolkit/mozapps/extensions/internal/XPIProvider.jsm index 54b86edc4..d5f1ab5dd 100644 --- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm +++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm @@ -37,9 +37,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "Task", XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "BrowserToolboxProcess", - "resource://gre/modules/devtools/ToolboxProcess.jsm"); + "resource://devtools/client/framework/ToolboxProcess.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "ConsoleAPI", - "resource://gre/modules/devtools/Console.jsm"); + "resource://gre/modules/Console.jsm"); XPCOMUtils.defineLazyServiceGetter(this, "Blocklist", "@mozilla.org/extensions/blocklist;1", @@ -2082,7 +2082,7 @@ this.XPIProvider = { Services.prefs.addObserver(PREF_EM_MIN_COMPAT_APP_VERSION, this, false); Services.prefs.addObserver(PREF_EM_MIN_COMPAT_PLATFORM_VERSION, this, false); Services.obs.addObserver(this, NOTIFICATION_FLUSH_PERMISSIONS, false); - if (Cu.isModuleLoaded("resource://gre/modules/devtools/ToolboxProcess.jsm")) { + if (Cu.isModuleLoaded("resource://devtools/client/framework/ToolboxProcess.jsm")) { // If BrowserToolboxProcess is already loaded, set the boolean to true // and do whatever is needed this._toolboxProcessLoaded = true; diff --git a/toolkit/mozapps/extensions/test/browser/browser_experiments.js b/toolkit/mozapps/extensions/test/browser/browser_experiments.js deleted file mode 100644 index 72d0ca83e..000000000 --- a/toolkit/mozapps/extensions/test/browser/browser_experiments.js +++ /dev/null @@ -1,645 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ - */ - -Components.utils.import("resource://gre/modules/Promise.jsm", this); - -let {AddonTestUtils} = Components.utils.import("resource://testing-common/AddonManagerTesting.jsm", {}); -let {HttpServer} = Components.utils.import("resource://testing-common/httpd.js", {}); - -let gManagerWindow; -let gCategoryUtilities; -let gExperiments; -let gHttpServer; - -let gSavedManifestURI; -let gIsEnUsLocale; - -const SEC_IN_ONE_DAY = 24 * 60 * 60; -const MS_IN_ONE_DAY = SEC_IN_ONE_DAY * 1000; - -function getExperimentAddons() { - let deferred = Promise.defer(); - AddonManager.getAddonsByTypes(["experiment"], (addons) => { - deferred.resolve(addons); - }); - return deferred.promise; -} - -function getInstallItem() { - let doc = gManagerWindow.document; - let view = doc.getElementById("view-port").selectedPanel; - let list = doc.getElementById("addon-list"); - - let node = list.firstChild; - while (node) { - if (node.getAttribute("status") == "installing") { - return node; - } - node = node.nextSibling; - } - - return null; -} - -function patchPolicy(policy, data) { - for (let key of Object.keys(data)) { - Object.defineProperty(policy, key, { - value: data[key], - writable: true, - }); - } -} - -function defineNow(policy, time) { - patchPolicy(policy, { now: () => new Date(time) }); -} - -function openDetailsView(aId) { - let item = get_addon_element(gManagerWindow, aId); - Assert.ok(item, "Should have got add-on element."); - is_element_visible(item, "Add-on element should be visible."); - - EventUtils.synthesizeMouseAtCenter(item, { clickCount: 1 }, gManagerWindow); - EventUtils.synthesizeMouseAtCenter(item, { clickCount: 2 }, gManagerWindow); - - let deferred = Promise.defer(); - wait_for_view_load(gManagerWindow, deferred.resolve); - return deferred.promise; -} - -function clickRemoveButton(addonElement) { - let btn = gManagerWindow.document.getAnonymousElementByAttribute(addonElement, "anonid", "remove-btn"); - if (!btn) { - return Promise.reject(); - } - - EventUtils.synthesizeMouseAtCenter(btn, { clickCount: 1 }, gManagerWindow); - let deferred = Promise.defer(); - setTimeout(deferred.resolve, 0); - return deferred; -} - -function clickUndoButton(addonElement) { - let btn = gManagerWindow.document.getAnonymousElementByAttribute(addonElement, "anonid", "undo-btn"); - if (!btn) { - return Promise.reject(); - } - - EventUtils.synthesizeMouseAtCenter(btn, { clickCount: 1 }, gManagerWindow); - let deferred = Promise.defer(); - setTimeout(deferred.resolve, 0); - return deferred; -} - -add_task(function* initializeState() { - gManagerWindow = yield open_manager(); - gCategoryUtilities = new CategoryUtilities(gManagerWindow); - - registerCleanupFunction(() => { - Services.prefs.clearUserPref("experiments.enabled"); - if (gHttpServer) { - gHttpServer.stop(() => {}); - if (gSavedManifestURI !== undefined) { - Services.prefs.setCharPref("experments.manifest.uri", gSavedManifestURI); - } - } - if (gExperiments) { - let tmp = {}; - Cu.import("resource:///modules/experiments/Experiments.jsm", tmp); - gExperiments._policy = new tmp.Experiments.Policy(); - } - }); - - let chrome = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIXULChromeRegistry); - gIsEnUsLocale = chrome.getSelectedLocale("global") == "en-US"; - - // The Experiments Manager will interfere with us by preventing installs - // of experiments it doesn't know about. We remove it from the equation - // because here we are only concerned with core Addon Manager operation, - // not the superset Experiments Manager has imposed. - if ("@mozilla.org/browser/experiments-service;1" in Components.classes) { - let tmp = {}; - Cu.import("resource:///modules/experiments/Experiments.jsm", tmp); - // There is a race condition between XPCOM service initialization and - // this test running. We have to initialize the instance first, then - // uninitialize it to prevent this. - gExperiments = tmp.Experiments.instance(); - yield gExperiments._mainTask; - yield gExperiments.uninit(); - } -}); - -// On an empty profile with no experiments, the experiment category -// should be hidden. -add_task(function* testInitialState() { - Assert.ok(gCategoryUtilities.get("experiment", false), "Experiment tab is defined."); - Assert.ok(!gCategoryUtilities.isTypeVisible("experiment"), "Experiment tab hidden by default."); -}); - -add_task(function* testExperimentInfoNotVisible() { - yield gCategoryUtilities.openType("extension"); - let el = gManagerWindow.document.getElementsByClassName("experiment-info-container")[0]; - is_element_hidden(el, "Experiment info not visible on other types."); -}); - -// If we have an active experiment, we should see the experiments tab -// and that tab should have some messages. -add_task(function* testActiveExperiment() { - let addon = yield install_addon("addons/browser_experiment1.xpi"); - - Assert.ok(addon.userDisabled, "Add-on is disabled upon initial install."); - Assert.equal(addon.isActive, false, "Add-on is not active."); - - Assert.ok(gCategoryUtilities.isTypeVisible("experiment"), "Experiment tab visible."); - - yield gCategoryUtilities.openType("experiment"); - let el = gManagerWindow.document.getElementsByClassName("experiment-info-container")[0]; - is_element_visible(el, "Experiment info is visible on experiment tab."); -}); - -add_task(function* testExperimentLearnMore() { - // Actual URL is irrelevant. - Services.prefs.setCharPref("toolkit.telemetry.infoURL", - "http://mochi.test:8888/server.js"); - - yield gCategoryUtilities.openType("experiment"); - let btn = gManagerWindow.document.getElementById("experiments-learn-more"); - - if (!gUseInContentUI) { - is_element_hidden(btn, "Learn more button hidden if not using in-content UI."); - Services.prefs.clearUserPref("toolkit.telemetry.infoURL"); - - return; - } - - is_element_visible(btn, "Learn more button visible."); - - let deferred = Promise.defer(); - window.addEventListener("DOMContentLoaded", function onLoad(event) { - info("Telemetry privacy policy window opened."); - window.removeEventListener("DOMContentLoaded", onLoad, false); - - let browser = gBrowser.selectedBrowser; - let expected = Services.prefs.getCharPref("toolkit.telemetry.infoURL"); - Assert.equal(browser.currentURI.spec, expected, "New tab should have loaded privacy policy."); - browser.contentWindow.close(); - - Services.prefs.clearUserPref("toolkit.telemetry.infoURL"); - - deferred.resolve(); - }, false); - - info("Opening telemetry privacy policy."); - EventUtils.synthesizeMouseAtCenter(btn, {}, gManagerWindow); - - yield deferred.promise; -}); - -add_task(function* testOpenPreferences() { - yield gCategoryUtilities.openType("experiment"); - let btn = gManagerWindow.document.getElementById("experiments-change-telemetry"); - if (!gUseInContentUI) { - is_element_hidden(btn, "Change telemetry button not enabled in out of window UI."); - info("Skipping preferences open test because not using in-content UI."); - return; - } - - is_element_visible(btn, "Change telemetry button visible in in-content UI."); - - let deferred = Promise.defer(); - Services.obs.addObserver(function observer(prefWin, topic, data) { - Services.obs.removeObserver(observer, "advanced-pane-loaded"); - info("Advanced preference pane opened."); - executeSoon(function() { - // We want this test to fail if the preferences pane changes. - let el = prefWin.document.getElementById("dataChoicesPanel"); - is_element_visible(el); - - prefWin.close(); - info("Closed preferences pane."); - - deferred.resolve(); - }); - }, "advanced-pane-loaded", false); - - info("Loading preferences pane."); - EventUtils.synthesizeMouseAtCenter(btn, {}, gManagerWindow); - - yield deferred.promise; -}); - -add_task(function* testButtonPresence() { - yield gCategoryUtilities.openType("experiment"); - let item = get_addon_element(gManagerWindow, "test-experiment1@experiments.mozilla.org"); - Assert.ok(item, "Got add-on element."); - item.parentNode.ensureElementIsVisible(item); - - let el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "remove-btn"); - // Corresponds to the uninstall permission. - is_element_visible(el, "Remove button is visible."); - // Corresponds to lack of disable permission. - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "disable-btn"); - is_element_hidden(el, "Disable button not visible."); - // Corresponds to lack of enable permission. - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "enable-btn"); - is_element_hidden(el, "Enable button not visible."); -}); - -// Remove the add-on we've been testing with. -add_task(function* testCleanup() { - yield AddonTestUtils.uninstallAddonByID("test-experiment1@experiments.mozilla.org"); - // Verify some conditions, just in case. - let addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "No experiment add-ons are installed."); -}); - -// The following tests should ideally live in browser/experiments/. However, -// they rely on some of the helper functions from head.js, which can't easily -// be consumed from other directories. So, they live here. - -add_task(function* testActivateExperiment() { - if (!gExperiments) { - info("Skipping experiments test because that feature isn't available."); - return; - } - - gHttpServer = new HttpServer(); - gHttpServer.start(-1); - let root = "http://localhost:" + gHttpServer.identity.primaryPort + "/"; - gHttpServer.registerPathHandler("/manifest", (request, response) => { - response.setStatusLine(null, 200, "OK"); - response.write(JSON.stringify({ - "version": 1, - "experiments": [ - { - id: "experiment-1", - xpiURL: TESTROOT + "addons/browser_experiment1.xpi", - xpiHash: "IRRELEVANT", - startTime: Date.now() / 1000 - 3600, - endTime: Date.now() / 1000 + 3600, - maxActiveSeconds: 600, - appName: [Services.appinfo.name], - channel: [gExperiments._policy.updatechannel()], - }, - ], - })); - response.processAsync(); - response.finish(); - }); - - gSavedManifestURI = Services.prefs.getCharPref("experiments.manifest.uri"); - Services.prefs.setCharPref("experiments.manifest.uri", root + "manifest"); - - // We need to remove the cache file to help ensure consistent state. - yield OS.File.remove(gExperiments._cacheFilePath); - - Services.prefs.setBoolPref("experiments.enabled", true); - - info("Initializing experiments service."); - yield gExperiments.init(); - info("Experiments service finished first run."); - - // Check conditions, just to be sure. - let experiments = yield gExperiments.getExperiments(); - Assert.equal(experiments.length, 0, "No experiments known to the service."); - - // This makes testing easier. - gExperiments._policy.ignoreHashes = true; - - info("Manually updating experiments manifest."); - yield gExperiments.updateManifest(); - info("Experiments update complete."); - - let deferred = Promise.defer(); - gHttpServer.stop(() => { - gHttpServer = null; - - info("getting experiment by ID"); - AddonManager.getAddonByID("test-experiment1@experiments.mozilla.org", (addon) => { - Assert.ok(addon, "Add-on installed via Experiments manager."); - - deferred.resolve(); - }); - }); - - yield deferred.promise; - - Assert.ok(gCategoryUtilities.isTypeVisible, "experiment", "Experiment tab visible."); - yield gCategoryUtilities.openType("experiment"); - let el = gManagerWindow.document.getElementsByClassName("experiment-info-container")[0]; - is_element_visible(el, "Experiment info is visible on experiment tab."); -}); - -add_task(function testDeactivateExperiment() { - if (!gExperiments) { - return; - } - - // Fake an empty manifest to purge data from previous manifest. - yield gExperiments._updateExperiments({ - "version": 1, - "experiments": [], - }); - - yield gExperiments.disableExperiment("testing"); - - // We should have a record of the previously-active experiment. - let experiments = yield gExperiments.getExperiments(); - Assert.equal(experiments.length, 1, "1 experiment is known."); - Assert.equal(experiments[0].active, false, "Experiment is not active."); - - // We should have a previous experiment in the add-ons manager. - let deferred = Promise.defer(); - AddonManager.getAddonsByTypes(["experiment"], (addons) => { - deferred.resolve(addons); - }); - let addons = yield deferred.promise; - Assert.equal(addons.length, 1, "1 experiment add-on known."); - Assert.ok(addons[0].appDisabled, "It is a previous experiment."); - Assert.equal(addons[0].id, "experiment-1", "Add-on ID matches expected."); - - // Verify the UI looks sane. - - Assert.ok(gCategoryUtilities.isTypeVisible("experiment"), "Experiment tab visible."); - let item = get_addon_element(gManagerWindow, "experiment-1"); - Assert.ok(item, "Got add-on element."); - Assert.ok(!item.active, "Element should not be active."); - item.parentNode.ensureElementIsVisible(item); - - // User control buttons should not be present because previous experiments - // should have no permissions. - let el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "remove-btn"); - is_element_hidden(el, "Remove button is not visible."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "disable-btn"); - is_element_hidden(el, "Disable button is not visible."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "enable-btn"); - is_element_hidden(el, "Enable button is not visible."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "preferences-btn"); - is_element_hidden(el, "Preferences button is not visible."); -}); - -add_task(function testActivateRealExperiments() { - if (!gExperiments) { - info("Skipping experiments test because that feature isn't available."); - return; - } - - yield gExperiments._updateExperiments({ - "version": 1, - "experiments": [ - { - id: "experiment-2", - xpiURL: TESTROOT + "addons/browser_experiment1.xpi", - xpiHash: "IRRELEVANT", - startTime: Date.now() / 1000 - 3600, - endTime: Date.now() / 1000 + 3600, - maxActiveSeconds: 600, - appName: [Services.appinfo.name], - channel: [gExperiments._policy.updatechannel()], - }, - ], - }); - yield gExperiments._run(); - - // Check the active experiment. - - let item = get_addon_element(gManagerWindow, "test-experiment1@experiments.mozilla.org"); - Assert.ok(item, "Got add-on element."); - item.parentNode.ensureElementIsVisible(item); - - let el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-state"); - is_element_visible(el, "Experiment state label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "Active"); - } - - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-time"); - is_element_visible(el, "Experiment time label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "Less than a day remaining"); - } - - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "error-container"); - is_element_hidden(el, "error-container should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "warning-container"); - is_element_hidden(el, "warning-container should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "pending-container"); - is_element_hidden(el, "pending-container should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "version"); - is_element_hidden(el, "version should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "class", "disabled-postfix"); - is_element_hidden(el, "disabled-postfix should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "class", "update-postfix"); - is_element_hidden(el, "update-postfix should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "class", "experiment-bullet"); - is_element_visible(el, "experiment-bullet should be visible."); - - // Check the previous experiment. - - item = get_addon_element(gManagerWindow, "experiment-1"); - Assert.ok(item, "Got add-on element."); - item.parentNode.ensureElementIsVisible(item); - - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-state"); - is_element_visible(el, "Experiment state label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "Complete"); - } - - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-time"); - is_element_visible(el, "Experiment time label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "Less than a day ago"); - } - - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "error-container"); - is_element_hidden(el, "error-container should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "warning-container"); - is_element_hidden(el, "warning-container should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "pending-container"); - is_element_hidden(el, "pending-container should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "version"); - is_element_hidden(el, "version should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "class", "disabled-postfix"); - is_element_hidden(el, "disabled-postfix should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "class", "update-postfix"); - is_element_hidden(el, "update-postfix should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "class", "experiment-bullet"); - is_element_visible(el, "experiment-bullet should be visible."); - - // Install an "older" experiment. - - yield gExperiments.disableExperiment("experiment-2"); - - let now = Date.now(); - let fakeNow = now - 5 * MS_IN_ONE_DAY; - defineNow(gExperiments._policy, fakeNow); - - yield gExperiments._updateExperiments({ - "version": 1, - "experiments": [ - { - id: "experiment-3", - xpiURL: TESTROOT + "addons/browser_experiment1.xpi", - xpiHash: "IRRELEVANT", - startTime: fakeNow / 1000 - SEC_IN_ONE_DAY, - endTime: now / 1000 + 10 * SEC_IN_ONE_DAY, - maxActiveSeconds: 100 * SEC_IN_ONE_DAY, - appName: [Services.appinfo.name], - channel: [gExperiments._policy.updatechannel()], - }, - ], - }); - yield gExperiments._run(); - - // Check the active experiment. - - item = get_addon_element(gManagerWindow, "test-experiment1@experiments.mozilla.org"); - Assert.ok(item, "Got add-on element."); - item.parentNode.ensureElementIsVisible(item); - - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-state"); - is_element_visible(el, "Experiment state label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "Active"); - } - - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-time"); - is_element_visible(el, "Experiment time label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "10 days remaining"); - } - - // Disable it and check it's previous experiment entry. - - yield gExperiments.disableExperiment("experiment-3"); - - item = get_addon_element(gManagerWindow, "experiment-3"); - Assert.ok(item, "Got add-on element."); - item.parentNode.ensureElementIsVisible(item); - - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-state"); - is_element_visible(el, "Experiment state label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "Complete"); - } - - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-time"); - is_element_visible(el, "Experiment time label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "5 days ago"); - } -}); - -add_task(function testDetailView() { - if (!gExperiments) { - info("Skipping experiments test because that feature isn't available."); - return; - } - - defineNow(gExperiments._policy, Date.now()); - yield gExperiments._updateExperiments({ - "version": 1, - "experiments": [ - { - id: "experiment-4", - xpiURL: TESTROOT + "addons/browser_experiment1.xpi", - xpiHash: "IRRELEVANT", - startTime: Date.now() / 1000 - 3600, - endTime: Date.now() / 1000 + 3600, - maxActiveSeconds: 600, - appName: [Services.appinfo.name], - channel: [gExperiments._policy.updatechannel()], - }, - ], - }); - yield gExperiments._run(); - - // Check active experiment. - - yield openDetailsView("test-experiment1@experiments.mozilla.org"); - - let el = gManagerWindow.document.getElementById("detail-experiment-state"); - is_element_visible(el, "Experiment state label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "Active"); - } - - el = gManagerWindow.document.getElementById("detail-experiment-time"); - is_element_visible(el, "Experiment time label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "Less than a day remaining"); - } - - el = gManagerWindow.document.getElementById("detail-version"); - is_element_hidden(el, "detail-version should be hidden."); - el = gManagerWindow.document.getElementById("detail-creator"); - is_element_hidden(el, "detail-creator should be hidden."); - el = gManagerWindow.document.getElementById("detail-experiment-bullet"); - is_element_visible(el, "experiment-bullet should be visible."); - - // Check previous experiment. - - yield gCategoryUtilities.openType("experiment"); - yield openDetailsView("experiment-3"); - - el = gManagerWindow.document.getElementById("detail-experiment-state"); - is_element_visible(el, "Experiment state label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "Complete"); - } - - el = gManagerWindow.document.getElementById("detail-experiment-time"); - is_element_visible(el, "Experiment time label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "5 days ago"); - } - - el = gManagerWindow.document.getElementById("detail-version"); - is_element_hidden(el, "detail-version should be hidden."); - el = gManagerWindow.document.getElementById("detail-creator"); - is_element_hidden(el, "detail-creator should be hidden."); - el = gManagerWindow.document.getElementById("detail-experiment-bullet"); - is_element_visible(el, "experiment-bullet should be visible."); -}); - -add_task(function* testRemoveAndUndo() { - if (!gExperiments) { - info("Skipping experiments test because that feature isn't available."); - return; - } - - yield gCategoryUtilities.openType("experiment"); - - let addon = get_addon_element(gManagerWindow, "test-experiment1@experiments.mozilla.org"); - Assert.ok(addon, "Got add-on element."); - - yield clickRemoveButton(addon); - addon.parentNode.ensureElementIsVisible(addon); - - let el = gManagerWindow.document.getAnonymousElementByAttribute(addon, "class", "pending"); - is_element_visible(el, "Uninstall undo information should be visible."); - - yield clickUndoButton(addon); - addon = get_addon_element(gManagerWindow, "test-experiment1@experiments.mozilla.org"); - Assert.ok(addon, "Got add-on element."); -}); - -add_task(function* testCleanup() { - if (gExperiments) { - Services.prefs.clearUserPref("experiments.enabled"); - Services.prefs.setCharPref("experiments.manifest.uri", gSavedManifestURI); - - // We perform the uninit/init cycle to purge any leftover state. - yield OS.File.remove(gExperiments._cacheFilePath); - yield gExperiments.uninit(); - yield gExperiments.init(); - } - - // Check post-conditions. - let addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "No experiment add-ons are installed."); - - yield close_manager(gManagerWindow); -}); diff --git a/toolkit/mozapps/webextensions/content/extensions.js b/toolkit/mozapps/webextensions/content/extensions.js index 5e428fe17..3159eb1e1 100644 --- a/toolkit/mozapps/webextensions/content/extensions.js +++ b/toolkit/mozapps/webextensions/content/extensions.js @@ -29,9 +29,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "PluralForm", XPCOMUtils.defineLazyModuleGetter(this, "Preferences", "resource://gre/modules/Preferences.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "Experiments", - "resource:///modules/experiments/Experiments.jsm"); - const PREF_DISCOVERURL = "extensions.webservice.discoverURL"; const PREF_DISCOVER_ENABLED = "extensions.getAddons.showPane"; const PREF_XPI_ENABLED = "xpinstall.enabled"; @@ -297,23 +294,6 @@ function isDiscoverEnabled() { return true; } -function getExperimentEndDate(aAddon) { - if (!("@mozilla.org/browser/experiments-service;1" in Cc)) { - return 0; - } - - if (!aAddon.isActive) { - return aAddon.endDate; - } - - let experiment = Experiments.instance().getActiveExperiment(); - if (!experiment) { - return 0; - } - - return experiment.endDate; -} - /** * Obtain the main DOMWindow for the current context. */ @@ -1444,27 +1424,6 @@ var gViewController = { } }, - cmd_experimentsLearnMore: { - isEnabled: function() { - let mainWindow = getMainWindow(); - return mainWindow && "switchToTabHavingURI" in mainWindow; - }, - doCommand: function() { - let url = Services.prefs.getCharPref("toolkit.telemetry.infoURL"); - openOptionsInTab(url); - }, - }, - - cmd_experimentsOpenTelemetryPreferences: { - isEnabled: function() { - return !!getMainWindowWithPreferencesPane(); - }, - doCommand: function() { - let mainWindow = getMainWindowWithPreferencesPane(); - mainWindow.openAdvancedPreferences("dataChoicesTab"); - }, - }, - cmd_showUnsignedExtensions: { isEnabled: function() { return true; @@ -1577,10 +1536,6 @@ function shouldShowVersionNumber(aAddon) { if (!aAddon.version) return false; - // The version number is hidden for experiments. - if (aAddon.type == "experiment") - return false; - // The version number is hidden for lightweight themes. if (aAddon.type == "theme") return !/@personas\.mozilla\.org$/.test(aAddon.id); @@ -1614,10 +1569,6 @@ function createItem(aObj, aIsInstall, aIsRemote) { // the binding handles the rest item.setAttribute("value", aObj.id); - if (aObj.type == "experiment") { - item.endDate = getExperimentEndDate(aObj); - } - return item; } @@ -2861,13 +2812,6 @@ var gListView = { // the existing item if (aInstall.existingAddon) this.removeItem(aInstall, true); - - if (aInstall.addon.type == "experiment") { - let item = this.getListItemForID(aInstall.addon.id); - if (item) { - item.endDate = getExperimentEndDate(aInstall.addon); - } - } }, addItem: function(aObj, aIsInstall) { @@ -3126,34 +3070,6 @@ var gDetailView = { } } - if (this._addon.type == "experiment") { - let prefix = "details.experiment."; - let active = this._addon.isActive; - - let stateKey = prefix + "state." + (active ? "active" : "complete"); - let node = document.getElementById("detail-experiment-state"); - node.value = gStrings.ext.GetStringFromName(stateKey); - - let now = Date.now(); - let end = getExperimentEndDate(this._addon); - let days = Math.abs(end - now) / (24 * 60 * 60 * 1000); - - let timeKey = prefix + "time."; - let timeMessage; - if (days < 1) { - timeKey += (active ? "endsToday" : "endedToday"); - timeMessage = gStrings.ext.GetStringFromName(timeKey); - } else { - timeKey += (active ? "daysRemaining" : "daysPassed"); - days = Math.round(days); - let timeString = gStrings.ext.GetStringFromName(timeKey); - timeMessage = PluralForm.get(days, timeString) - .replace("#1", days); - } - - document.getElementById("detail-experiment-time").value = timeMessage; - } - this.fillSettingsRows(aScrollToPreferences, (function() { this.updateState(); gViewController.notifyViewChanged(); diff --git a/toolkit/mozapps/webextensions/internal/XPIProvider.jsm b/toolkit/mozapps/webextensions/internal/XPIProvider.jsm index 87e09cef1..7c3cb6763 100644 --- a/toolkit/mozapps/webextensions/internal/XPIProvider.jsm +++ b/toolkit/mozapps/webextensions/internal/XPIProvider.jsm @@ -175,6 +175,8 @@ const RDFURI_INSTALL_MANIFEST_ROOT = "urn:mozilla:install-manifest"; const PREFIX_NS_EM = "http://www.mozilla.org/2004/em-rdf#"; const TOOLKIT_ID = "toolkit@mozilla.org"; +const WEBEXTENSIONS_ID = "webextensions@mozilla.org"; +const WEBEXTENSIONS_VERSION = "52.0"; const XPI_SIGNATURE_CHECK_PERIOD = 24 * 60 * 60; @@ -1037,7 +1039,7 @@ var loadManifestFromWebManifest = Task.async(function*(aUri) { delete addon.defaultLocale.locales; addon.targetApplications = [{ - id: TOOLKIT_ID, + id: WEBEXTENSIONS_ID, minVersion: bss.strict_min_version, maxVersion: bss.strict_max_version, }]; @@ -7228,6 +7230,8 @@ AddonInternal.prototype = { version = aAppVersion; else if (app.id == TOOLKIT_ID) version = aPlatformVersion + else if (app.id == WEBEXTENSIONS_ID) + version = WEBEXTENSIONS_VERSION // Only extensions and dictionaries can be compatible by default; themes // and language packs always use strict compatibility checking. @@ -7250,7 +7254,7 @@ AddonInternal.prototype = { let minCompatVersion; if (app.id == Services.appinfo.ID) minCompatVersion = XPIProvider.minCompatibleAppVersion; - else if (app.id == TOOLKIT_ID) + else if (app.id == TOOLKIT_ID || app.id == WEBEXTENSIONS_ID) minCompatVersion = XPIProvider.minCompatiblePlatformVersion; if (minCompatVersion && @@ -7269,7 +7273,7 @@ AddonInternal.prototype = { for (let targetApp of this.targetApplications) { if (targetApp.id == Services.appinfo.ID) return targetApp; - if (targetApp.id == TOOLKIT_ID) + if (targetApp.id == TOOLKIT_ID || targetApp.id == WEBEXTENSIONS_ID) app = targetApp; } return app; diff --git a/toolkit/mozapps/webextensions/test/browser/browser_experiments.js b/toolkit/mozapps/webextensions/test/browser/browser_experiments.js deleted file mode 100644 index 18a548de5..000000000 --- a/toolkit/mozapps/webextensions/test/browser/browser_experiments.js +++ /dev/null @@ -1,654 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ - */ - -Components.utils.import("resource://gre/modules/Promise.jsm", this); - -var {AddonManagerTesting} = Components.utils.import("resource://testing-common/AddonManagerTesting.jsm", {}); -var {HttpServer} = Components.utils.import("resource://testing-common/httpd.js", {}); - -var gManagerWindow; -var gCategoryUtilities; -var gExperiments; -var gHttpServer; - -var gSavedManifestURI; -var gIsEnUsLocale; - -const SEC_IN_ONE_DAY = 24 * 60 * 60; -const MS_IN_ONE_DAY = SEC_IN_ONE_DAY * 1000; - -function getExperimentAddons() { - let deferred = Promise.defer(); - AddonManager.getAddonsByTypes(["experiment"], (addons) => { - deferred.resolve(addons); - }); - return deferred.promise; -} - -function getInstallItem() { - let doc = gManagerWindow.document; - let view = get_current_view(gManagerWindow); - let list = doc.getElementById("addon-list"); - - let node = list.firstChild; - while (node) { - if (node.getAttribute("status") == "installing") { - return node; - } - node = node.nextSibling; - } - - return null; -} - -function patchPolicy(policy, data) { - for (let key of Object.keys(data)) { - Object.defineProperty(policy, key, { - value: data[key], - writable: true, - }); - } -} - -function defineNow(policy, time) { - patchPolicy(policy, { now: () => new Date(time) }); -} - -function openDetailsView(aId) { - let item = get_addon_element(gManagerWindow, aId); - Assert.ok(item, "Should have got add-on element."); - is_element_visible(item, "Add-on element should be visible."); - - EventUtils.synthesizeMouseAtCenter(item, { clickCount: 1 }, gManagerWindow); - EventUtils.synthesizeMouseAtCenter(item, { clickCount: 2 }, gManagerWindow); - - let deferred = Promise.defer(); - wait_for_view_load(gManagerWindow, deferred.resolve); - return deferred.promise; -} - -function clickRemoveButton(addonElement) { - let btn = gManagerWindow.document.getAnonymousElementByAttribute(addonElement, "anonid", "remove-btn"); - if (!btn) { - return Promise.reject(); - } - - EventUtils.synthesizeMouseAtCenter(btn, { clickCount: 1 }, gManagerWindow); - let deferred = Promise.defer(); - setTimeout(deferred.resolve, 0); - return deferred; -} - -function clickUndoButton(addonElement) { - let btn = gManagerWindow.document.getAnonymousElementByAttribute(addonElement, "anonid", "undo-btn"); - if (!btn) { - return Promise.reject(); - } - - EventUtils.synthesizeMouseAtCenter(btn, { clickCount: 1 }, gManagerWindow); - let deferred = Promise.defer(); - setTimeout(deferred.resolve, 0); - return deferred; -} - -add_task(function* initializeState() { - gManagerWindow = yield open_manager(); - gCategoryUtilities = new CategoryUtilities(gManagerWindow); - - registerCleanupFunction(() => { - Services.prefs.clearUserPref("experiments.enabled"); - Services.prefs.clearUserPref("toolkit.telemetry.enabled"); - if (gHttpServer) { - gHttpServer.stop(() => {}); - if (gSavedManifestURI !== undefined) { - Services.prefs.setCharPref("experments.manifest.uri", gSavedManifestURI); - } - } - if (gExperiments) { - let tmp = {}; - Cu.import("resource:///modules/experiments/Experiments.jsm", tmp); - gExperiments._policy = new tmp.Experiments.Policy(); - } - }); - - let chrome = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIXULChromeRegistry); - gIsEnUsLocale = chrome.getSelectedLocale("global") == "en-US"; - - // The Experiments Manager will interfere with us by preventing installs - // of experiments it doesn't know about. We remove it from the equation - // because here we are only concerned with core Addon Manager operation, - // not the superset Experiments Manager has imposed. - if ("@mozilla.org/browser/experiments-service;1" in Components.classes) { - let tmp = {}; - Cu.import("resource:///modules/experiments/Experiments.jsm", tmp); - // There is a race condition between XPCOM service initialization and - // this test running. We have to initialize the instance first, then - // uninitialize it to prevent this. - gExperiments = tmp.Experiments.instance(); - yield gExperiments._mainTask; - yield gExperiments.uninit(); - } -}); - -// On an empty profile with no experiments, the experiment category -// should be hidden. -add_task(function* testInitialState() { - Assert.ok(gCategoryUtilities.get("experiment", false), "Experiment tab is defined."); - Assert.ok(!gCategoryUtilities.isTypeVisible("experiment"), "Experiment tab hidden by default."); -}); - -add_task(function* testExperimentInfoNotVisible() { - yield gCategoryUtilities.openType("extension"); - let el = gManagerWindow.document.getElementsByClassName("experiment-info-container")[0]; - is_element_hidden(el, "Experiment info not visible on other types."); -}); - -// If we have an active experiment, we should see the experiments tab -// and that tab should have some messages. -add_task(function* testActiveExperiment() { - let addon = yield install_addon("addons/browser_experiment1.xpi"); - - Assert.ok(addon.userDisabled, "Add-on is disabled upon initial install."); - Assert.equal(addon.isActive, false, "Add-on is not active."); - - Assert.ok(gCategoryUtilities.isTypeVisible("experiment"), "Experiment tab visible."); - - yield gCategoryUtilities.openType("experiment"); - let el = gManagerWindow.document.getElementsByClassName("experiment-info-container")[0]; - is_element_visible(el, "Experiment info is visible on experiment tab."); -}); - -add_task(function* testExperimentLearnMore() { - // Actual URL is irrelevant. - Services.prefs.setCharPref("toolkit.telemetry.infoURL", - "http://mochi.test:8888/server.js"); - - yield gCategoryUtilities.openType("experiment"); - let btn = gManagerWindow.document.getElementById("experiments-learn-more"); - - if (!gUseInContentUI) { - is_element_hidden(btn, "Learn more button hidden if not using in-content UI."); - Services.prefs.clearUserPref("toolkit.telemetry.infoURL"); - - return; - } - - is_element_visible(btn, "Learn more button visible."); - - let deferred = Promise.defer(); - window.addEventListener("DOMContentLoaded", function onLoad(event) { - info("Telemetry privacy policy window opened."); - window.removeEventListener("DOMContentLoaded", onLoad, false); - - let browser = gBrowser.selectedBrowser; - let expected = Services.prefs.getCharPref("toolkit.telemetry.infoURL"); - Assert.equal(browser.currentURI.spec, expected, "New tab should have loaded privacy policy."); - browser.contentWindow.close(); - - Services.prefs.clearUserPref("toolkit.telemetry.infoURL"); - - deferred.resolve(); - }, false); - - info("Opening telemetry privacy policy."); - EventUtils.synthesizeMouseAtCenter(btn, {}, gManagerWindow); - - yield deferred.promise; -}); - -add_task(function* testOpenPreferences() { - yield gCategoryUtilities.openType("experiment"); - let btn = gManagerWindow.document.getElementById("experiments-change-telemetry"); - if (!gUseInContentUI) { - is_element_hidden(btn, "Change telemetry button not enabled in out of window UI."); - info("Skipping preferences open test because not using in-content UI."); - return; - } - - is_element_visible(btn, "Change telemetry button visible in in-content UI."); - - let deferred = Promise.defer(); - Services.obs.addObserver(function observer(prefWin, topic, data) { - Services.obs.removeObserver(observer, "advanced-pane-loaded"); - info("Advanced preference pane opened."); - executeSoon(function() { - // We want this test to fail if the preferences pane changes. - let el = prefWin.document.getElementById("dataChoicesPanel"); - is_element_visible(el); - - prefWin.close(); - info("Closed preferences pane."); - - deferred.resolve(); - }); - }, "advanced-pane-loaded", false); - - info("Loading preferences pane."); - // We need to focus before synthesizing the mouse event (bug 1240052) as - // synthesizeMouseAtCenter currently only synthesizes the mouse in the child process. - // This can cause some subtle differences if the child isn't focused. - yield SimpleTest.promiseFocus(); - yield BrowserTestUtils.synthesizeMouseAtCenter("#experiments-change-telemetry", {}, - gBrowser.selectedBrowser); - - yield deferred.promise; -}); - -add_task(function* testButtonPresence() { - yield gCategoryUtilities.openType("experiment"); - let item = get_addon_element(gManagerWindow, "test-experiment1@experiments.mozilla.org"); - Assert.ok(item, "Got add-on element."); - item.parentNode.ensureElementIsVisible(item); - - let el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "remove-btn"); - // Corresponds to the uninstall permission. - is_element_visible(el, "Remove button is visible."); - // Corresponds to lack of disable permission. - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "disable-btn"); - is_element_hidden(el, "Disable button not visible."); - // Corresponds to lack of enable permission. - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "enable-btn"); - is_element_hidden(el, "Enable button not visible."); -}); - -// Remove the add-on we've been testing with. -add_task(function* testCleanup() { - yield AddonManagerTesting.uninstallAddonByID("test-experiment1@experiments.mozilla.org"); - // Verify some conditions, just in case. - let addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "No experiment add-ons are installed."); -}); - -// The following tests should ideally live in browser/experiments/. However, -// they rely on some of the helper functions from head.js, which can't easily -// be consumed from other directories. So, they live here. - -add_task(function* testActivateExperiment() { - if (!gExperiments) { - info("Skipping experiments test because that feature isn't available."); - return; - } - - gHttpServer = new HttpServer(); - gHttpServer.start(-1); - let root = "http://localhost:" + gHttpServer.identity.primaryPort + "/"; - gHttpServer.registerPathHandler("/manifest", (request, response) => { - response.setStatusLine(null, 200, "OK"); - response.write(JSON.stringify({ - "version": 1, - "experiments": [ - { - id: "experiment-1", - xpiURL: TESTROOT + "addons/browser_experiment1.xpi", - xpiHash: "IRRELEVANT", - startTime: Date.now() / 1000 - 3600, - endTime: Date.now() / 1000 + 3600, - maxActiveSeconds: 600, - appName: [Services.appinfo.name], - channel: [gExperiments._policy.updatechannel()], - }, - ], - })); - response.processAsync(); - response.finish(); - }); - - gSavedManifestURI = Services.prefs.getCharPref("experiments.manifest.uri"); - Services.prefs.setCharPref("experiments.manifest.uri", root + "manifest"); - - // We need to remove the cache file to help ensure consistent state. - yield OS.File.remove(gExperiments._cacheFilePath); - - Services.prefs.setBoolPref("toolkit.telemetry.enabled", true); - Services.prefs.setBoolPref("experiments.enabled", true); - - info("Initializing experiments service."); - yield gExperiments.init(); - info("Experiments service finished first run."); - - // Check conditions, just to be sure. - let experiments = yield gExperiments.getExperiments(); - Assert.equal(experiments.length, 0, "No experiments known to the service."); - - // This makes testing easier. - gExperiments._policy.ignoreHashes = true; - - info("Manually updating experiments manifest."); - yield gExperiments.updateManifest(); - info("Experiments update complete."); - - let deferred = Promise.defer(); - gHttpServer.stop(() => { - gHttpServer = null; - - info("getting experiment by ID"); - AddonManager.getAddonByID("test-experiment1@experiments.mozilla.org", (addon) => { - Assert.ok(addon, "Add-on installed via Experiments manager."); - - deferred.resolve(); - }); - }); - - yield deferred.promise; - - Assert.ok(gCategoryUtilities.isTypeVisible, "experiment", "Experiment tab visible."); - yield gCategoryUtilities.openType("experiment"); - let el = gManagerWindow.document.getElementsByClassName("experiment-info-container")[0]; - is_element_visible(el, "Experiment info is visible on experiment tab."); -}); - -add_task(function* testDeactivateExperiment() { - if (!gExperiments) { - return; - } - - // Fake an empty manifest to purge data from previous manifest. - yield gExperiments._updateExperiments({ - "version": 1, - "experiments": [], - }); - - yield gExperiments.disableExperiment("testing"); - - // We should have a record of the previously-active experiment. - let experiments = yield gExperiments.getExperiments(); - Assert.equal(experiments.length, 1, "1 experiment is known."); - Assert.equal(experiments[0].active, false, "Experiment is not active."); - - // We should have a previous experiment in the add-ons manager. - let deferred = Promise.defer(); - AddonManager.getAddonsByTypes(["experiment"], (addons) => { - deferred.resolve(addons); - }); - let addons = yield deferred.promise; - Assert.equal(addons.length, 1, "1 experiment add-on known."); - Assert.ok(addons[0].appDisabled, "It is a previous experiment."); - Assert.equal(addons[0].id, "experiment-1", "Add-on ID matches expected."); - - // Verify the UI looks sane. - - Assert.ok(gCategoryUtilities.isTypeVisible("experiment"), "Experiment tab visible."); - let item = get_addon_element(gManagerWindow, "experiment-1"); - Assert.ok(item, "Got add-on element."); - Assert.ok(!item.active, "Element should not be active."); - item.parentNode.ensureElementIsVisible(item); - - // User control buttons should not be present because previous experiments - // should have no permissions. - let el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "remove-btn"); - is_element_hidden(el, "Remove button is not visible."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "disable-btn"); - is_element_hidden(el, "Disable button is not visible."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "enable-btn"); - is_element_hidden(el, "Enable button is not visible."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "preferences-btn"); - is_element_hidden(el, "Preferences button is not visible."); -}); - -add_task(function* testActivateRealExperiments() { - if (!gExperiments) { - info("Skipping experiments test because that feature isn't available."); - return; - } - - yield gExperiments._updateExperiments({ - "version": 1, - "experiments": [ - { - id: "experiment-2", - xpiURL: TESTROOT + "addons/browser_experiment1.xpi", - xpiHash: "IRRELEVANT", - startTime: Date.now() / 1000 - 3600, - endTime: Date.now() / 1000 + 3600, - maxActiveSeconds: 600, - appName: [Services.appinfo.name], - channel: [gExperiments._policy.updatechannel()], - }, - ], - }); - yield gExperiments._run(); - - // Check the active experiment. - - let item = get_addon_element(gManagerWindow, "test-experiment1@experiments.mozilla.org"); - Assert.ok(item, "Got add-on element."); - item.parentNode.ensureElementIsVisible(item); - - let el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-state"); - is_element_visible(el, "Experiment state label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "Active"); - } - - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-time"); - is_element_visible(el, "Experiment time label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "Less than a day remaining"); - } - - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "error-container"); - is_element_hidden(el, "error-container should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "warning-container"); - is_element_hidden(el, "warning-container should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "pending-container"); - is_element_hidden(el, "pending-container should be hidden."); - let { version } = yield get_tooltip_info(item); - Assert.equal(version, undefined, "version should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "class", "disabled-postfix"); - is_element_hidden(el, "disabled-postfix should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "class", "update-postfix"); - is_element_hidden(el, "update-postfix should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "class", "experiment-bullet"); - is_element_visible(el, "experiment-bullet should be visible."); - - // Check the previous experiment. - - item = get_addon_element(gManagerWindow, "experiment-1"); - Assert.ok(item, "Got add-on element."); - item.parentNode.ensureElementIsVisible(item); - - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-state"); - is_element_visible(el, "Experiment state label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "Complete"); - } - - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-time"); - is_element_visible(el, "Experiment time label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "Less than a day ago"); - } - - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "error-container"); - is_element_hidden(el, "error-container should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "warning-container"); - is_element_hidden(el, "warning-container should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "pending-container"); - is_element_hidden(el, "pending-container should be hidden."); - ({ version } = yield get_tooltip_info(item)); - Assert.equal(version, undefined, "version should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "class", "disabled-postfix"); - is_element_hidden(el, "disabled-postfix should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "class", "update-postfix"); - is_element_hidden(el, "update-postfix should be hidden."); - el = item.ownerDocument.getAnonymousElementByAttribute(item, "class", "experiment-bullet"); - is_element_visible(el, "experiment-bullet should be visible."); - - // Install an "older" experiment. - - yield gExperiments.disableExperiment("experiment-2"); - - let now = Date.now(); - let fakeNow = now - 5 * MS_IN_ONE_DAY; - defineNow(gExperiments._policy, fakeNow); - - yield gExperiments._updateExperiments({ - "version": 1, - "experiments": [ - { - id: "experiment-3", - xpiURL: TESTROOT + "addons/browser_experiment1.xpi", - xpiHash: "IRRELEVANT", - startTime: fakeNow / 1000 - SEC_IN_ONE_DAY, - endTime: now / 1000 + 10 * SEC_IN_ONE_DAY, - maxActiveSeconds: 100 * SEC_IN_ONE_DAY, - appName: [Services.appinfo.name], - channel: [gExperiments._policy.updatechannel()], - }, - ], - }); - yield gExperiments._run(); - - // Check the active experiment. - - item = get_addon_element(gManagerWindow, "test-experiment1@experiments.mozilla.org"); - Assert.ok(item, "Got add-on element."); - item.parentNode.ensureElementIsVisible(item); - - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-state"); - is_element_visible(el, "Experiment state label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "Active"); - } - - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-time"); - is_element_visible(el, "Experiment time label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "10 days remaining"); - } - - // Disable it and check it's previous experiment entry. - - yield gExperiments.disableExperiment("experiment-3"); - - item = get_addon_element(gManagerWindow, "experiment-3"); - Assert.ok(item, "Got add-on element."); - item.parentNode.ensureElementIsVisible(item); - - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-state"); - is_element_visible(el, "Experiment state label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "Complete"); - } - - el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-time"); - is_element_visible(el, "Experiment time label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "5 days ago"); - } -}); - -add_task(function* testDetailView() { - if (!gExperiments) { - info("Skipping experiments test because that feature isn't available."); - return; - } - - defineNow(gExperiments._policy, Date.now()); - yield gExperiments._updateExperiments({ - "version": 1, - "experiments": [ - { - id: "experiment-4", - xpiURL: TESTROOT + "addons/browser_experiment1.xpi", - xpiHash: "IRRELEVANT", - startTime: Date.now() / 1000 - 3600, - endTime: Date.now() / 1000 + 3600, - maxActiveSeconds: 600, - appName: [Services.appinfo.name], - channel: [gExperiments._policy.updatechannel()], - }, - ], - }); - yield gExperiments._run(); - - // Check active experiment. - - yield openDetailsView("test-experiment1@experiments.mozilla.org"); - - let el = gManagerWindow.document.getElementById("detail-experiment-state"); - is_element_visible(el, "Experiment state label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "Active"); - } - - el = gManagerWindow.document.getElementById("detail-experiment-time"); - is_element_visible(el, "Experiment time label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "Less than a day remaining"); - } - - el = gManagerWindow.document.getElementById("detail-version"); - is_element_hidden(el, "detail-version should be hidden."); - el = gManagerWindow.document.getElementById("detail-creator"); - is_element_hidden(el, "detail-creator should be hidden."); - el = gManagerWindow.document.getElementById("detail-experiment-bullet"); - is_element_visible(el, "experiment-bullet should be visible."); - - // Check previous experiment. - - yield gCategoryUtilities.openType("experiment"); - yield openDetailsView("experiment-3"); - - el = gManagerWindow.document.getElementById("detail-experiment-state"); - is_element_visible(el, "Experiment state label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "Complete"); - } - - el = gManagerWindow.document.getElementById("detail-experiment-time"); - is_element_visible(el, "Experiment time label should be visible."); - if (gIsEnUsLocale) { - Assert.equal(el.value, "5 days ago"); - } - - el = gManagerWindow.document.getElementById("detail-version"); - is_element_hidden(el, "detail-version should be hidden."); - el = gManagerWindow.document.getElementById("detail-creator"); - is_element_hidden(el, "detail-creator should be hidden."); - el = gManagerWindow.document.getElementById("detail-experiment-bullet"); - is_element_visible(el, "experiment-bullet should be visible."); -}); - -add_task(function* testRemoveAndUndo() { - if (!gExperiments) { - info("Skipping experiments test because that feature isn't available."); - return; - } - - yield gCategoryUtilities.openType("experiment"); - - let addon = get_addon_element(gManagerWindow, "test-experiment1@experiments.mozilla.org"); - Assert.ok(addon, "Got add-on element."); - - yield clickRemoveButton(addon); - addon.parentNode.ensureElementIsVisible(addon); - - let el = gManagerWindow.document.getAnonymousElementByAttribute(addon, "class", "pending"); - is_element_visible(el, "Uninstall undo information should be visible."); - - yield clickUndoButton(addon); - addon = get_addon_element(gManagerWindow, "test-experiment1@experiments.mozilla.org"); - Assert.ok(addon, "Got add-on element."); -}); - -add_task(function* testCleanup() { - if (gExperiments) { - Services.prefs.clearUserPref("experiments.enabled"); - Services.prefs.setCharPref("experiments.manifest.uri", gSavedManifestURI); - - // We perform the uninit/init cycle to purge any leftover state. - yield OS.File.remove(gExperiments._cacheFilePath); - yield gExperiments.uninit(); - yield gExperiments.init(); - - Services.prefs.clearUserPref("toolkit.telemetry.enabled"); - } - - // Check post-conditions. - let addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "No experiment add-ons are installed."); - - yield close_manager(gManagerWindow); -}); diff --git a/toolkit/profile/nsProfileLock.cpp b/toolkit/profile/nsProfileLock.cpp index 08d109224..cc9ecb62e 100644 --- a/toolkit/profile/nsProfileLock.cpp +++ b/toolkit/profile/nsProfileLock.cpp @@ -30,7 +30,7 @@ #include "prenv.h" #endif -#if defined(MOZ_WIDGET_GONK) && !defined(MOZ_CRASHREPORTER) +#if defined(MOZ_WIDGET_GONK) #include <sys/syscall.h> #endif @@ -198,7 +198,6 @@ void nsProfileLock::FatalSignalHandler(int signo case SIGILL: case SIGABRT: case SIGSEGV: -#ifndef MOZ_CRASHREPORTER // Retrigger the signal for those that can generate a core dump signal(signo, SIG_DFL); if (info->si_code <= 0) { @@ -206,7 +205,6 @@ void nsProfileLock::FatalSignalHandler(int signo break; } } -#endif return; default: break; diff --git a/toolkit/themes/linux/mozapps/jar.mn b/toolkit/themes/linux/mozapps/jar.mn index d4997d36c..37325c0be 100644 --- a/toolkit/themes/linux/mozapps/jar.mn +++ b/toolkit/themes/linux/mozapps/jar.mn @@ -23,30 +23,33 @@ toolkit.jar: * skin/classic/mozapps/extensions/newaddon.css (webextensions/newaddon.css) skin/classic/mozapps/extensions/heart.png (webextensions/heart.png) #else -+ skin/classic/mozapps/extensions/extensions.css (extensions/extensions.css) -+ skin/classic/mozapps/extensions/category-search.png (extensions/category-search.png) -+ skin/classic/mozapps/extensions/category-discover.png (extensions/category-discover.png) -+ skin/classic/mozapps/extensions/category-languages.png (extensions/localeGeneric.png) -+ skin/classic/mozapps/extensions/category-extensions.png (extensions/extensionGeneric.png) -+ skin/classic/mozapps/extensions/category-themes.png (extensions/themeGeneric.png) -+ skin/classic/mozapps/extensions/category-plugins.png (extensions/category-plugins.png) -+ skin/classic/mozapps/extensions/category-service.png (extensions/category-service.png) -+ skin/classic/mozapps/extensions/category-dictionaries.png (extensions/category-dictionaries.png) -+ skin/classic/mozapps/extensions/category-experiments.png (extensions/category-experiments.png) -+ skin/classic/mozapps/extensions/category-recent.png (extensions/category-recent.png) -+ skin/classic/mozapps/extensions/category-available.png (extensions/category-available.png) -+ skin/classic/mozapps/extensions/extensionGeneric.png (extensions/extensionGeneric.png) -+ skin/classic/mozapps/extensions/extensionGeneric-16.png (extensions/extensionGeneric-16.png) -+ skin/classic/mozapps/extensions/dictionaryGeneric.png (extensions/dictionaryGeneric.png) -+ skin/classic/mozapps/extensions/dictionaryGeneric-16.png (extensions/dictionaryGeneric-16.png) -+ skin/classic/mozapps/extensions/experimentGeneric.png (extensions/experimentGeneric.png) -+ skin/classic/mozapps/extensions/themeGeneric.png (extensions/themeGeneric.png) -+ skin/classic/mozapps/extensions/themeGeneric-16.png (extensions/themeGeneric-16.png) -+ skin/classic/mozapps/extensions/localeGeneric.png (extensions/localeGeneric.png) -+ skin/classic/mozapps/extensions/newaddon.css (extensions/newaddon.css) -+ skin/classic/mozapps/extensions/selectAddons.css (extensions/selectAddons.css) -+ skin/classic/mozapps/xpinstall/xpinstallItemGeneric.png (extensions/extensionGeneric.png) + skin/classic/mozapps/extensions/extensions.css (extensions/extensions.css) + skin/classic/mozapps/extensions/category-search.png (extensions/category-search.png) + skin/classic/mozapps/extensions/category-discover.png (extensions/category-discover.png) + skin/classic/mozapps/extensions/category-languages.png (extensions/localeGeneric.png) + skin/classic/mozapps/extensions/category-extensions.png (extensions/extensionGeneric.png) + skin/classic/mozapps/extensions/category-themes.png (extensions/themeGeneric.png) + skin/classic/mozapps/extensions/category-plugins.png (extensions/category-plugins.png) + skin/classic/mozapps/extensions/category-service.png (extensions/category-service.png) + skin/classic/mozapps/extensions/category-dictionaries.png (extensions/category-dictionaries.png) + skin/classic/mozapps/extensions/category-experiments.png (extensions/category-experiments.png) + skin/classic/mozapps/extensions/category-recent.png (extensions/category-recent.png) + skin/classic/mozapps/extensions/category-available.png (extensions/category-available.png) + skin/classic/mozapps/extensions/extensionGeneric.png (extensions/extensionGeneric.png) + skin/classic/mozapps/extensions/extensionGeneric-16.png (extensions/extensionGeneric-16.png) + skin/classic/mozapps/extensions/dictionaryGeneric.png (extensions/dictionaryGeneric.png) + skin/classic/mozapps/extensions/dictionaryGeneric-16.png (extensions/dictionaryGeneric-16.png) + skin/classic/mozapps/extensions/experimentGeneric.png (extensions/experimentGeneric.png) + skin/classic/mozapps/extensions/themeGeneric.png (extensions/themeGeneric.png) + skin/classic/mozapps/extensions/themeGeneric-16.png (extensions/themeGeneric-16.png) + skin/classic/mozapps/extensions/localeGeneric.png (extensions/localeGeneric.png) + skin/classic/mozapps/extensions/newaddon.css (extensions/newaddon.css) + skin/classic/mozapps/extensions/selectAddons.css (extensions/selectAddons.css) + skin/classic/mozapps/xpinstall/xpinstallItemGeneric.png (extensions/extensionGeneric.png) #endif + skin/classic/mozapps/passwordmgr/key.png (passwordmgr/key.png) + skin/classic/mozapps/passwordmgr/key-16.png (passwordmgr/key-16.png) + skin/classic/mozapps/passwordmgr/key-64.png (passwordmgr/key-64.png) skin/classic/mozapps/plugins/pluginGeneric.png (plugins/pluginGeneric.png) skin/classic/mozapps/plugins/pluginBlocked.png (plugins/pluginBlocked.png) skin/classic/mozapps/plugins/pluginGeneric-16.png (plugins/pluginGeneric-16.png) diff --git a/toolkit/themes/linux/mozapps/passwordmgr/key-16.png b/toolkit/themes/linux/mozapps/passwordmgr/key-16.png Binary files differnew file mode 100644 index 000000000..ac135b847 --- /dev/null +++ b/toolkit/themes/linux/mozapps/passwordmgr/key-16.png diff --git a/toolkit/themes/linux/mozapps/passwordmgr/key-64.png b/toolkit/themes/linux/mozapps/passwordmgr/key-64.png Binary files differnew file mode 100644 index 000000000..0fb69f382 --- /dev/null +++ b/toolkit/themes/linux/mozapps/passwordmgr/key-64.png diff --git a/toolkit/themes/linux/mozapps/passwordmgr/key.png b/toolkit/themes/linux/mozapps/passwordmgr/key.png Binary files differnew file mode 100644 index 000000000..b5e8afefc --- /dev/null +++ b/toolkit/themes/linux/mozapps/passwordmgr/key.png diff --git a/toolkit/themes/osx/mozapps/jar.mn b/toolkit/themes/osx/mozapps/jar.mn index 35927755b..f8ade11d9 100644 --- a/toolkit/themes/osx/mozapps/jar.mn +++ b/toolkit/themes/osx/mozapps/jar.mn @@ -83,6 +83,9 @@ toolkit.jar: skin/classic/mozapps/extensions/blocklist.css (extensions/blocklist.css) * skin/classic/mozapps/extensions/newaddon.css (extensions/newaddon.css) #endif + skin/classic/mozapps/passwordmgr/key.png (passwordmgr/key.png) + skin/classic/mozapps/passwordmgr/key-16.png (passwordmgr/key-16.png) + skin/classic/mozapps/passwordmgr/key-64.png (passwordmgr/key-64.png) skin/classic/mozapps/plugins/notifyPluginGeneric.png (plugins/notifyPluginGeneric.png) skin/classic/mozapps/plugins/pluginGeneric.png (plugins/pluginGeneric.png) skin/classic/mozapps/plugins/pluginBlocked.png (plugins/pluginBlocked.png) diff --git a/toolkit/themes/osx/mozapps/passwordmgr/key-16.png b/toolkit/themes/osx/mozapps/passwordmgr/key-16.png Binary files differnew file mode 100644 index 000000000..ac135b847 --- /dev/null +++ b/toolkit/themes/osx/mozapps/passwordmgr/key-16.png diff --git a/toolkit/themes/osx/mozapps/passwordmgr/key-64.png b/toolkit/themes/osx/mozapps/passwordmgr/key-64.png Binary files differnew file mode 100644 index 000000000..0fb69f382 --- /dev/null +++ b/toolkit/themes/osx/mozapps/passwordmgr/key-64.png diff --git a/toolkit/themes/osx/mozapps/passwordmgr/key.png b/toolkit/themes/osx/mozapps/passwordmgr/key.png Binary files differnew file mode 100644 index 000000000..b5e8afefc --- /dev/null +++ b/toolkit/themes/osx/mozapps/passwordmgr/key.png diff --git a/toolkit/themes/shared/non-mac.jar.inc.mn b/toolkit/themes/shared/non-mac.jar.inc.mn index a783bbb3c..637537d9d 100644 --- a/toolkit/themes/shared/non-mac.jar.inc.mn +++ b/toolkit/themes/shared/non-mac.jar.inc.mn @@ -77,6 +77,8 @@ skin/classic/global/icons/Landscape.png (../../windows/global/icons/Landscape.png) skin/classic/global/icons/Question.png (../../windows/global/icons/Question.png) skin/classic/global/icons/question-16.png (../../windows/global/icons/question-16.png) + skin/classic/global/icons/question-32.png (../../windows/global/icons/question-32.png) + skin/classic/global/icons/question-48.png (../../windows/global/icons/question-48.png) skin/classic/global/icons/question-64.png (../../windows/global/icons/question-64.png) skin/classic/global/icons/resizer-rtl.png (../../windows/global/icons/resizer-rtl.png) skin/classic/global/icons/Restore.gif (../../windows/global/icons/Restore.gif) diff --git a/toolkit/themes/windows/global/icons/question-32.png b/toolkit/themes/windows/global/icons/question-32.png Binary files differnew file mode 100644 index 000000000..7c80831b0 --- /dev/null +++ b/toolkit/themes/windows/global/icons/question-32.png diff --git a/toolkit/themes/windows/global/icons/question-48.png b/toolkit/themes/windows/global/icons/question-48.png Binary files differnew file mode 100644 index 000000000..dd2b21874 --- /dev/null +++ b/toolkit/themes/windows/global/icons/question-48.png diff --git a/toolkit/themes/windows/mozapps/jar.mn b/toolkit/themes/windows/mozapps/jar.mn index 29203811f..842c8a138 100644 --- a/toolkit/themes/windows/mozapps/jar.mn +++ b/toolkit/themes/windows/mozapps/jar.mn @@ -15,6 +15,7 @@ toolkit.jar: skin/classic/mozapps/extensions/category-recent.png (webextensions/category-recent.png) skin/classic/mozapps/extensions/category-available.png (webextensions/category-available.png) skin/classic/mozapps/extensions/extensionGeneric-16.png (webextensions/extensionGeneric-16.png) + skin/classic/mozapps/extensions/extensionGeneric-48.png (webextensions/extensionGeneric-48.png) skin/classic/mozapps/extensions/themeGeneric.png (webextensions/themeGeneric.png) skin/classic/mozapps/extensions/themeGeneric-16.png (webextensions/themeGeneric-16.png) skin/classic/mozapps/extensions/dictionaryGeneric.png (webextensions/dictionaryGeneric.png) @@ -68,9 +69,13 @@ toolkit.jar: * skin/classic/mozapps/xpinstall/xpinstallConfirm.css (extensions/xpinstallConfirm.css) skin/classic/mozapps/xpinstall/xpinstallItemGeneric.png (extensions/extensionGeneric.png) #endif + skin/classic/mozapps/passwordmgr/key.png (passwordmgr/key.png) + skin/classic/mozapps/passwordmgr/key-16.png (passwordmgr/key-16.png) + skin/classic/mozapps/passwordmgr/key-64.png (passwordmgr/key-64.png) skin/classic/mozapps/plugins/pluginGeneric.png (plugins/pluginGeneric.png) skin/classic/mozapps/plugins/pluginBlocked.png (plugins/pluginBlocked.png) skin/classic/mozapps/plugins/pluginGeneric-16.png (plugins/pluginGeneric-16.png) + skin/classic/mozapps/plugins/pluginGeneric-48.png (plugins/pluginGeneric-48.png) skin/classic/mozapps/profile/profileicon.png (profile/profileicon.png) skin/classic/mozapps/update/updates.css (update/updates.css) skin/classic/mozapps/viewsource/viewsource.css (viewsource/viewsource.css) diff --git a/toolkit/themes/windows/mozapps/passwordmgr/key-16.png b/toolkit/themes/windows/mozapps/passwordmgr/key-16.png Binary files differnew file mode 100644 index 000000000..ac135b847 --- /dev/null +++ b/toolkit/themes/windows/mozapps/passwordmgr/key-16.png diff --git a/toolkit/themes/windows/mozapps/passwordmgr/key-64.png b/toolkit/themes/windows/mozapps/passwordmgr/key-64.png Binary files differnew file mode 100644 index 000000000..0fb69f382 --- /dev/null +++ b/toolkit/themes/windows/mozapps/passwordmgr/key-64.png diff --git a/toolkit/themes/windows/mozapps/passwordmgr/key.png b/toolkit/themes/windows/mozapps/passwordmgr/key.png Binary files differnew file mode 100644 index 000000000..b5e8afefc --- /dev/null +++ b/toolkit/themes/windows/mozapps/passwordmgr/key.png diff --git a/toolkit/themes/windows/mozapps/plugins/pluginGeneric-16.png b/toolkit/themes/windows/mozapps/plugins/pluginGeneric-16.png Binary files differindex 5d796cc4c..080b0e502 100644 --- a/toolkit/themes/windows/mozapps/plugins/pluginGeneric-16.png +++ b/toolkit/themes/windows/mozapps/plugins/pluginGeneric-16.png diff --git a/toolkit/themes/windows/mozapps/plugins/pluginGeneric-48.png b/toolkit/themes/windows/mozapps/plugins/pluginGeneric-48.png Binary files differnew file mode 100644 index 000000000..173679448 --- /dev/null +++ b/toolkit/themes/windows/mozapps/plugins/pluginGeneric-48.png diff --git a/toolkit/themes/windows/mozapps/plugins/pluginGeneric.png b/toolkit/themes/windows/mozapps/plugins/pluginGeneric.png Binary files differindex d8b270ae5..1fcbf154e 100644 --- a/toolkit/themes/windows/mozapps/plugins/pluginGeneric.png +++ b/toolkit/themes/windows/mozapps/plugins/pluginGeneric.png diff --git a/toolkit/toolkit.mozbuild b/toolkit/toolkit.mozbuild index a782acd3a..3b3bf80ae 100644 --- a/toolkit/toolkit.mozbuild +++ b/toolkit/toolkit.mozbuild @@ -181,10 +181,6 @@ if CONFIG['ENABLE_TESTS']: '/testing/web-platform', ] - # The file id utility requires breakpad libraries. - if CONFIG['MOZ_CRASHREPORTER']: - DIRS += ['/testing/tools/fileid'] - if CONFIG['MOZ_MEMORY']: DIRS += ['/memory/gtest'] diff --git a/toolkit/xre/nsAndroidStartup.cpp b/toolkit/xre/nsAndroidStartup.cpp index a88c58e5d..47b9ec6e5 100644 --- a/toolkit/xre/nsAndroidStartup.cpp +++ b/toolkit/xre/nsAndroidStartup.cpp @@ -26,15 +26,6 @@ GeckoStart(JNIEnv* env, char* data, const nsXREAppData* appData) { mozilla::jni::SetGeckoThreadEnv(env); -#ifdef MOZ_CRASHREPORTER - const struct mapping_info *info = getLibraryMapping(); - while (info->name) { - CrashReporter::AddLibraryMapping(info->name, info->base, - info->len, info->offset); - info++; - } -#endif - if (!data) { LOG("Failed to get arguments for GeckoStart\n"); return; diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 1b5c2ed75..b65a4093f 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -190,17 +190,6 @@ #include "jprof.h" #endif -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#include "nsICrashReporter.h" -#define NS_CRASHREPORTER_CONTRACTID "@mozilla.org/toolkit/crash-reporter;1" -#include "nsIPrefService.h" -#include "nsIMemoryInfoDumper.h" -#if defined(XP_LINUX) && !defined(ANDROID) -#include "mozilla/widget/LSBUtils.h" -#endif -#endif - #include "base/command_line.h" #include "GTestRunner.h" @@ -646,10 +635,6 @@ class nsXULAppInfo : public nsIXULAppInfo, #ifdef XP_WIN public nsIWinAppHelper, #endif -#ifdef MOZ_CRASHREPORTER - public nsICrashReporter, - public nsIFinishDumpingCallback, -#endif public nsIXULRuntime { @@ -660,10 +645,6 @@ public: NS_DECL_NSIXULAPPINFO NS_DECL_NSIXULRUNTIME NS_DECL_NSIOBSERVER -#ifdef MOZ_CRASHREPORTER - NS_DECL_NSICRASHREPORTER - NS_DECL_NSIFINISHDUMPINGCALLBACK -#endif #ifdef XP_WIN NS_DECL_NSIWINAPPHELPER #endif @@ -676,10 +657,6 @@ NS_INTERFACE_MAP_BEGIN(nsXULAppInfo) #ifdef XP_WIN NS_INTERFACE_MAP_ENTRY(nsIWinAppHelper) #endif -#ifdef MOZ_CRASHREPORTER - NS_INTERFACE_MAP_ENTRY(nsICrashReporter) - NS_INTERFACE_MAP_ENTRY(nsIFinishDumpingCallback) -#endif NS_INTERFACE_MAP_ENTRY(nsIPlatformInfo) NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIXULAppInfo, gAppData || XRE_IsContentProcess()) @@ -1004,12 +981,7 @@ nsXULAppInfo::GetReplacedLockTime(PRTime *aReplacedLockTime) NS_IMETHODIMP nsXULAppInfo::GetLastRunCrashID(nsAString &aLastRunCrashID) { -#ifdef MOZ_CRASHREPORTER - CrashReporter::GetLastRunCrashID(aLastRunCrashID); - return NS_OK; -#else return NS_ERROR_NOT_IMPLEMENTED; -#endif } NS_IMETHODIMP @@ -1117,219 +1089,6 @@ nsXULAppInfo::GetUserCanElevate(bool *aUserCanElevate) } #endif -#ifdef MOZ_CRASHREPORTER -NS_IMETHODIMP -nsXULAppInfo::GetEnabled(bool *aEnabled) -{ - *aEnabled = CrashReporter::GetEnabled(); - return NS_OK; -} - -NS_IMETHODIMP -nsXULAppInfo::SetEnabled(bool aEnabled) -{ - if (aEnabled) { - if (CrashReporter::GetEnabled()) { - // no point in erroring for double-enabling - return NS_OK; - } - - nsCOMPtr<nsIFile> greBinDir; - NS_GetSpecialDirectory(NS_GRE_BIN_DIR, getter_AddRefs(greBinDir)); - if (!greBinDir) { - return NS_ERROR_FAILURE; - } - - nsCOMPtr<nsIFile> xreBinDirectory = do_QueryInterface(greBinDir); - if (!xreBinDirectory) { - return NS_ERROR_FAILURE; - } - - return CrashReporter::SetExceptionHandler(xreBinDirectory, true); - } - else { - if (!CrashReporter::GetEnabled()) { - // no point in erroring for double-disabling - return NS_OK; - } - - return CrashReporter::UnsetExceptionHandler(); - } -} - -NS_IMETHODIMP -nsXULAppInfo::GetServerURL(nsIURL** aServerURL) -{ - if (!CrashReporter::GetEnabled()) - return NS_ERROR_NOT_INITIALIZED; - - nsAutoCString data; - if (!CrashReporter::GetServerURL(data)) { - return NS_ERROR_FAILURE; - } - nsCOMPtr<nsIURI> uri; - NS_NewURI(getter_AddRefs(uri), data); - if (!uri) - return NS_ERROR_FAILURE; - - nsCOMPtr<nsIURL> url; - url = do_QueryInterface(uri); - NS_ADDREF(*aServerURL = url); - - return NS_OK; -} - -NS_IMETHODIMP -nsXULAppInfo::SetServerURL(nsIURL* aServerURL) -{ - bool schemeOk; - // only allow https or http URLs - nsresult rv = aServerURL->SchemeIs("https", &schemeOk); - NS_ENSURE_SUCCESS(rv, rv); - if (!schemeOk) { - rv = aServerURL->SchemeIs("http", &schemeOk); - NS_ENSURE_SUCCESS(rv, rv); - - if (!schemeOk) - return NS_ERROR_INVALID_ARG; - } - nsAutoCString spec; - rv = aServerURL->GetSpec(spec); - NS_ENSURE_SUCCESS(rv, rv); - - return CrashReporter::SetServerURL(spec); -} - -NS_IMETHODIMP -nsXULAppInfo::GetMinidumpPath(nsIFile** aMinidumpPath) -{ - if (!CrashReporter::GetEnabled()) - return NS_ERROR_NOT_INITIALIZED; - - nsAutoString path; - if (!CrashReporter::GetMinidumpPath(path)) - return NS_ERROR_FAILURE; - - nsresult rv = NS_NewLocalFile(path, false, aMinidumpPath); - NS_ENSURE_SUCCESS(rv, rv); - return NS_OK; -} - -NS_IMETHODIMP -nsXULAppInfo::SetMinidumpPath(nsIFile* aMinidumpPath) -{ - nsAutoString path; - nsresult rv = aMinidumpPath->GetPath(path); - NS_ENSURE_SUCCESS(rv, rv); - return CrashReporter::SetMinidumpPath(path); -} - -NS_IMETHODIMP -nsXULAppInfo::AnnotateCrashReport(const nsACString& key, - const nsACString& data) -{ - return CrashReporter::AnnotateCrashReport(key, data); -} - -NS_IMETHODIMP -nsXULAppInfo::AppendAppNotesToCrashReport(const nsACString& data) -{ - return CrashReporter::AppendAppNotesToCrashReport(data); -} - -NS_IMETHODIMP -nsXULAppInfo::RegisterAppMemory(uint64_t pointer, - uint64_t len) -{ - return CrashReporter::RegisterAppMemory((void *)pointer, len); -} - -NS_IMETHODIMP -nsXULAppInfo::WriteMinidumpForException(void* aExceptionInfo) -{ -#ifdef XP_WIN32 - return CrashReporter::WriteMinidumpForException(static_cast<EXCEPTION_POINTERS*>(aExceptionInfo)); -#else - return NS_ERROR_NOT_IMPLEMENTED; -#endif -} - -NS_IMETHODIMP -nsXULAppInfo::AppendObjCExceptionInfoToAppNotes(void* aException) -{ -#ifdef XP_MACOSX - return CrashReporter::AppendObjCExceptionInfoToAppNotes(aException); -#else - return NS_ERROR_NOT_IMPLEMENTED; -#endif -} - -NS_IMETHODIMP -nsXULAppInfo::GetSubmitReports(bool* aEnabled) -{ - return CrashReporter::GetSubmitReports(aEnabled); -} - -NS_IMETHODIMP -nsXULAppInfo::SetSubmitReports(bool aEnabled) -{ - return CrashReporter::SetSubmitReports(aEnabled); -} - -NS_IMETHODIMP -nsXULAppInfo::UpdateCrashEventsDir() -{ - CrashReporter::UpdateCrashEventsDir(); - return NS_OK; -} - -NS_IMETHODIMP -nsXULAppInfo::SaveMemoryReport() -{ - if (!CrashReporter::GetEnabled()) { - return NS_ERROR_NOT_INITIALIZED; - } - nsCOMPtr<nsIFile> file; - nsresult rv = CrashReporter::GetDefaultMemoryReportFile(getter_AddRefs(file)); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - nsString path; - file->GetPath(path); - - nsCOMPtr<nsIMemoryInfoDumper> dumper = - do_GetService("@mozilla.org/memory-info-dumper;1"); - if (NS_WARN_IF(!dumper)) { - return NS_ERROR_UNEXPECTED; - } - - rv = dumper->DumpMemoryReportsToNamedFile(path, this, file, true /* anonymize */); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - return NS_OK; -} - -NS_IMETHODIMP -nsXULAppInfo::SetTelemetrySessionId(const nsACString& id) -{ - CrashReporter::SetTelemetrySessionId(id); - return NS_OK; -} - -// This method is from nsIFInishDumpingCallback. -NS_IMETHODIMP -nsXULAppInfo::Callback(nsISupports* aData) -{ - nsCOMPtr<nsIFile> file = do_QueryInterface(aData); - MOZ_ASSERT(file); - - CrashReporter::SetMemoryReportFile(file); - return NS_OK; -} -#endif - static const nsXULAppInfo kAppInfo; static nsresult AppInfoConstructor(nsISupports* aOuter, REFNSIID aIID, void **aResult) @@ -1434,9 +1193,6 @@ static const mozilla::Module::CIDEntry kXRECIDs[] = { static const mozilla::Module::ContractIDEntry kXREContracts[] = { { XULAPPINFO_SERVICE_CONTRACTID, &kAPPINFO_CID }, { XULRUNTIME_SERVICE_CONTRACTID, &kAPPINFO_CID }, -#ifdef MOZ_CRASHREPORTER - { NS_CRASHREPORTER_CONTRACTID, &kAPPINFO_CID }, -#endif { NS_PROFILESERVICE_CONTRACTID, &kProfileServiceCID }, { NS_NATIVEAPPSUPPORT_CONTRACTID, &kNativeAppSupportCID }, { nullptr } @@ -2763,33 +2519,6 @@ static void RestoreStateForAppInitiatedRestart() } } -#ifdef MOZ_CRASHREPORTER -// When we first initialize the crash reporter we don't have a profile, -// so we set the minidump path to $TEMP. Once we have a profile, -// we set it to $PROFILE/minidumps, creating the directory -// if needed. -static void MakeOrSetMinidumpPath(nsIFile* profD) -{ - nsCOMPtr<nsIFile> dumpD; - profD->Clone(getter_AddRefs(dumpD)); - - if (dumpD) { - bool fileExists; - //XXX: do some more error checking here - dumpD->Append(NS_LITERAL_STRING("minidumps")); - dumpD->Exists(&fileExists); - if (!fileExists) { - nsresult rv = dumpD->Create(nsIFile::DIRECTORY_TYPE, 0700); - NS_ENSURE_SUCCESS_VOID(rv); - } - - nsAutoString pathStr; - if (NS_SUCCEEDED(dumpD->GetPath(pathStr))) - CrashReporter::SetMinidumpPath(pathStr); - } -} -#endif - const nsXREAppData* gAppData = nullptr; #ifdef MOZ_WIDGET_GTK @@ -3215,94 +2944,6 @@ XREMain::XRE_mainInit(bool* aExitFlag) if (NS_FAILED(rv)) return 1; -#ifdef MOZ_CRASHREPORTER - if (EnvHasValue("MOZ_CRASHREPORTER")) { - mAppData->flags |= NS_XRE_ENABLE_CRASH_REPORTER; - } - - nsCOMPtr<nsIFile> xreBinDirectory; - xreBinDirectory = mDirProvider.GetGREBinDir(); - - if ((mAppData->flags & NS_XRE_ENABLE_CRASH_REPORTER) && - NS_SUCCEEDED( - CrashReporter::SetExceptionHandler(xreBinDirectory))) { - nsCOMPtr<nsIFile> file; - rv = mDirProvider.GetUserAppDataDirectory(getter_AddRefs(file)); - if (NS_SUCCEEDED(rv)) { - CrashReporter::SetUserAppDataDirectory(file); - } - if (mAppData->crashReporterURL) - CrashReporter::SetServerURL(nsDependentCString(mAppData->crashReporterURL)); - - // We overwrite this once we finish starting up. - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("StartupCrash"), - NS_LITERAL_CSTRING("1")); - - // pass some basic info from the app data - if (mAppData->vendor) - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Vendor"), - nsDependentCString(mAppData->vendor)); - if (mAppData->name) - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProductName"), - nsDependentCString(mAppData->name)); - if (mAppData->ID) - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProductID"), - nsDependentCString(mAppData->ID)); - if (mAppData->version) - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Version"), - nsDependentCString(mAppData->version)); - if (mAppData->buildID) - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("BuildID"), - nsDependentCString(mAppData->buildID)); - - nsDependentCString releaseChannel(NS_STRINGIFY(MOZ_UPDATE_CHANNEL)); - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ReleaseChannel"), - releaseChannel); -#ifdef MOZ_LINKER - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("CrashAddressLikelyWrong"), - IsSignalHandlingBroken() ? NS_LITERAL_CSTRING("1") - : NS_LITERAL_CSTRING("0")); -#endif - -#ifdef XP_WIN - nsAutoString appInitDLLs; - if (widget::WinUtils::GetAppInitDLLs(appInitDLLs)) { - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AppInitDLLs"), - NS_ConvertUTF16toUTF8(appInitDLLs)); - } -#endif - - CrashReporter::SetRestartArgs(gArgc, gArgv); - - // annotate other data (user id etc) - nsCOMPtr<nsIFile> userAppDataDir; - if (NS_SUCCEEDED(mDirProvider.GetUserAppDataDirectory( - getter_AddRefs(userAppDataDir)))) { - CrashReporter::SetupExtraData(userAppDataDir, - nsDependentCString(mAppData->buildID)); - - // see if we have a crashreporter-override.ini in the application directory - nsCOMPtr<nsIFile> overrideini; - bool exists; - if (NS_SUCCEEDED(mDirProvider.GetAppDir()->Clone(getter_AddRefs(overrideini))) && - NS_SUCCEEDED(overrideini->AppendNative(NS_LITERAL_CSTRING("crashreporter-override.ini"))) && - NS_SUCCEEDED(overrideini->Exists(&exists)) && - exists) { -#ifdef XP_WIN - nsAutoString overridePathW; - overrideini->GetPath(overridePathW); - NS_ConvertUTF16toUTF8 overridePath(overridePathW); -#else - nsAutoCString overridePath; - overrideini->GetNativePath(overridePath); -#endif - - SaveWordToEnv("MOZ_CRASHREPORTER_STRINGS_OVERRIDE", overridePath); - } - } - } -#endif - #if defined(MOZ_SANDBOX) && defined(XP_WIN) if (mAppData->sandboxBrokerServices) { SandboxBroker::Initialize(mAppData->sandboxBrokerServices); @@ -3448,22 +3089,9 @@ XREMain::XRE_mainInit(bool* aExitFlag) } } -#ifdef MOZ_CRASHREPORTER - if (cpuUpdateRevision > 0) { - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("CPUMicrocodeVersion"), - nsPrintfCString("0x%x", - cpuUpdateRevision)); - } -#endif } #endif -#ifdef MOZ_CRASHREPORTER - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("SafeMode"), - gSafeMode ? NS_LITERAL_CSTRING("1") : - NS_LITERAL_CSTRING("0")); -#endif - // Handle --no-remote and --new-instance command line arguments. Setup // the environment to better accommodate other components and various // restart scenarios. @@ -3523,102 +3151,6 @@ XREMain::XRE_mainInit(bool* aExitFlag) return 0; } -#ifdef MOZ_CRASHREPORTER -#ifdef XP_WIN -/** - * Uses WMI to read some manufacturer information that may be useful for - * diagnosing hardware-specific crashes. This function is best-effort; failures - * shouldn't burden the caller. COM must be initialized before calling. - */ -static void AnnotateSystemManufacturer() -{ - RefPtr<IWbemLocator> locator; - - HRESULT hr = CoCreateInstance(CLSID_WbemLocator, nullptr, CLSCTX_INPROC_SERVER, - IID_IWbemLocator, getter_AddRefs(locator)); - - if (FAILED(hr)) { - return; - } - - RefPtr<IWbemServices> services; - - hr = locator->ConnectServer(_bstr_t(L"ROOT\\CIMV2"), nullptr, nullptr, nullptr, - 0, nullptr, nullptr, getter_AddRefs(services)); - - if (FAILED(hr)) { - return; - } - - hr = CoSetProxyBlanket(services, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, nullptr, - RPC_C_AUTHN_LEVEL_CALL, RPC_C_IMP_LEVEL_IMPERSONATE, - nullptr, EOAC_NONE); - - if (FAILED(hr)) { - return; - } - - RefPtr<IEnumWbemClassObject> enumerator; - - hr = services->ExecQuery(_bstr_t(L"WQL"), _bstr_t(L"SELECT * FROM Win32_BIOS"), - WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, - nullptr, getter_AddRefs(enumerator)); - - if (FAILED(hr) || !enumerator) { - return; - } - - RefPtr<IWbemClassObject> classObject; - ULONG results; - - hr = enumerator->Next(WBEM_INFINITE, 1, getter_AddRefs(classObject), &results); - - if (FAILED(hr) || results == 0) { - return; - } - - VARIANT value; - VariantInit(&value); - - hr = classObject->Get(L"Manufacturer", 0, &value, 0, 0); - - if (SUCCEEDED(hr) && V_VT(&value) == VT_BSTR) { - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("BIOS_Manufacturer"), - NS_ConvertUTF16toUTF8(V_BSTR(&value))); - } - - VariantClear(&value); -} - -static void PR_CALLBACK AnnotateSystemManufacturer_ThreadStart(void*) -{ - HRESULT hr = CoInitialize(nullptr); - - if (FAILED(hr)) { - return; - } - - AnnotateSystemManufacturer(); - - CoUninitialize(); -} -#endif // XP_WIN - -#if defined(XP_LINUX) && !defined(ANDROID) - -static void -AnnotateLSBRelease(void*) -{ - nsCString dist, desc, release, codename; - if (widget::lsb::GetLSBRelease(dist, desc, release, codename)) { - CrashReporter::AppendAppNotesToCrashReport(desc); - } -} - -#endif // defined(XP_LINUX) && !defined(ANDROID) - -#endif - namespace mozilla { ShutdownChecksMode gShutdownChecks = SCM_NOTHING; } // namespace mozilla @@ -4007,13 +3539,6 @@ XREMain::XRE_mainStartup(bool* aExitFlag) mozilla::Telemetry::SetProfileDir(mProfD); -#ifdef MOZ_CRASHREPORTER - if (mAppData->flags & NS_XRE_ENABLE_CRASH_REPORTER) - MakeOrSetMinidumpPath(mProfD); - - CrashReporter::SetProfileDirectory(mProfD); -#endif - nsAutoCString version; BuildVersion(version); @@ -4103,39 +3628,6 @@ XREMain::XRE_mainStartup(bool* aExitFlag) return 0; } -#if defined(MOZ_CRASHREPORTER) -#if defined(MOZ_CONTENT_SANDBOX) && !defined(MOZ_WIDGET_GONK) -void AddSandboxAnnotations() -{ - // Include the sandbox content level, regardless of platform - int level = Preferences::GetInt("security.sandbox.content.level"); - - nsAutoCString levelString; - levelString.AppendInt(level); - - CrashReporter::AnnotateCrashReport( - NS_LITERAL_CSTRING("ContentSandboxLevel"), levelString); - - // Include whether or not this instance is capable of content sandboxing - bool sandboxCapable = false; - -#if defined(XP_WIN) - // All supported Windows versions support some level of content sandboxing - sandboxCapable = true; -#elif defined(XP_MACOSX) - // All supported OS X versions are capable - sandboxCapable = true; -#elif defined(XP_LINUX) - sandboxCapable = SandboxInfo::Get().CanSandboxContent(); -#endif - - CrashReporter::AnnotateCrashReport( - NS_LITERAL_CSTRING("ContentSandboxCapable"), - sandboxCapable ? NS_LITERAL_CSTRING("1") : NS_LITERAL_CSTRING("0")); -} -#endif /* MOZ_CONTENT_SANDBOX && !MOZ_WIDGET_GONK */ -#endif /* MOZ_CRASHREPORTER */ - /* * XRE_mainRun - Command line startup, profile migration, and * the calling of appStartup->Run(). @@ -4169,40 +3661,6 @@ XREMain::XRE_mainRun() rv = mScopedXPCOM->SetWindowCreator(mNativeApp); NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); -#ifdef MOZ_CRASHREPORTER - // tell the crash reporter to also send the release channel - nsCOMPtr<nsIPrefService> prefs = do_GetService("@mozilla.org/preferences-service;1", &rv); - if (NS_SUCCEEDED(rv)) { - nsCOMPtr<nsIPrefBranch> defaultPrefBranch; - rv = prefs->GetDefaultBranch(nullptr, getter_AddRefs(defaultPrefBranch)); - - if (NS_SUCCEEDED(rv)) { - nsXPIDLCString sval; - rv = defaultPrefBranch->GetCharPref("app.update.channel", getter_Copies(sval)); - if (NS_SUCCEEDED(rv)) { - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ReleaseChannel"), - sval); - } - } - } - // Needs to be set after xpcom initialization. - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("FramePoisonBase"), - nsPrintfCString("%.16llx", uint64_t(gMozillaPoisonBase))); - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("FramePoisonSize"), - nsPrintfCString("%lu", uint32_t(gMozillaPoisonSize))); - -#ifdef XP_WIN - PR_CreateThread(PR_USER_THREAD, AnnotateSystemManufacturer_ThreadStart, 0, - PR_PRIORITY_LOW, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, 0); -#endif - -#if defined(XP_LINUX) && !defined(ANDROID) - PR_CreateThread(PR_USER_THREAD, AnnotateLSBRelease, 0, PR_PRIORITY_LOW, - PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, 0); -#endif - -#endif - if (mStartOffline) { nsCOMPtr<nsIIOService2> io (do_GetService("@mozilla.org/network/io-service;1")); NS_ENSURE_TRUE(io, NS_ERROR_FAILURE); @@ -4308,17 +3766,6 @@ XREMain::XRE_mainRun() OverrideDefaultLocaleIfNeeded(); -#ifdef MOZ_CRASHREPORTER - nsCString userAgentLocale; - // Try a localized string first. This pref is always a localized string in - // Fennec, and might be elsewhere, too. - if (NS_SUCCEEDED(Preferences::GetLocalizedCString("general.useragent.locale", &userAgentLocale))) { - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("useragent_locale"), userAgentLocale); - } else if (NS_SUCCEEDED(Preferences::GetCString("general.useragent.locale", &userAgentLocale))) { - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("useragent_locale"), userAgentLocale); - } -#endif - appStartup->GetShuttingDown(&mShuttingDown); nsCOMPtr<nsICommandLineRunner> cmdLine; @@ -4411,11 +3858,6 @@ XREMain::XRE_mainRun() (void)appStartup->DoneStartingUp(); -#ifdef MOZ_CRASHREPORTER - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("StartupCrash"), - NS_LITERAL_CSTRING("0")); -#endif - appStartup->GetShuttingDown(&mShuttingDown); } @@ -4466,21 +3908,8 @@ XREMain::XRE_mainRun() sandboxInfo.Test(SandboxInfo::kEnabledForContent)); Telemetry::Accumulate(Telemetry::SANDBOX_MEDIA_ENABLED, sandboxInfo.Test(SandboxInfo::kEnabledForMedia)); -#if defined(MOZ_CRASHREPORTER) - nsAutoCString flagsString; - flagsString.AppendInt(sandboxInfo.AsInteger()); - - CrashReporter::AnnotateCrashReport( - NS_LITERAL_CSTRING("ContentSandboxCapabilities"), flagsString); -#endif /* MOZ_CRASHREPORTER */ #endif /* MOZ_SANDBOX && XP_LINUX && !MOZ_WIDGET_GONK */ -#if defined(MOZ_CRASHREPORTER) -#if defined(MOZ_CONTENT_SANDBOX) && !defined(MOZ_WIDGET_GONK) - AddSandboxAnnotations(); -#endif /* MOZ_CONTENT_SANDBOX && !MOZ_WIDGET_GONK */ -#endif /* MOZ_CRASHREPORTER */ - { rv = appStartup->Run(); if (NS_FAILED(rv)) { @@ -4673,10 +4102,6 @@ XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData) rv = LaunchChild(mNativeApp, true); } -#ifdef MOZ_CRASHREPORTER - if (mAppData->flags & NS_XRE_ENABLE_CRASH_REPORTER) - CrashReporter::UnsetExceptionHandler(); -#endif return rv == NS_ERROR_LAUNCHED_CHILD_PROCESS ? 0 : 1; } @@ -4686,11 +4111,6 @@ XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData) MOZ_gdk_display_close(mGdkDisplay); #endif -#ifdef MOZ_CRASHREPORTER - if (mAppData->flags & NS_XRE_ENABLE_CRASH_REPORTER) - CrashReporter::UnsetExceptionHandler(); -#endif - XRE_DeinitCommandLine(); return NS_FAILED(rv) ? 1 : 0; @@ -4863,12 +4283,6 @@ MultiprocessBlockPolicy() { bool addonsCanDisable = Preferences::GetBool("extensions.e10sBlocksEnabling", false); bool disabledByAddons = Preferences::GetBool("extensions.e10sBlockedByAddons", false); -#ifdef MOZ_CRASHREPORTER - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AddonsShouldHaveBlockedE10s"), - disabledByAddons ? NS_LITERAL_CSTRING("1") - : NS_LITERAL_CSTRING("0")); -#endif - if (addonsCanDisable && disabledByAddons) { gMultiprocessBlockPolicy = kE10sDisabledForAddons; return gMultiprocessBlockPolicy; diff --git a/toolkit/xre/nsEmbedFunctions.cpp b/toolkit/xre/nsEmbedFunctions.cpp index 1e67ea7ce..4a612e495 100644 --- a/toolkit/xre/nsEmbedFunctions.cpp +++ b/toolkit/xre/nsEmbedFunctions.cpp @@ -239,30 +239,6 @@ XRE_SetProcessType(const char* aProcessTypeString) } } -#if defined(MOZ_CRASHREPORTER) -// FIXME/bug 539522: this out-of-place function is stuck here because -// IPDL wants access to this crashreporter interface, and -// crashreporter is built in such a way to make that awkward -bool -XRE_TakeMinidumpForChild(uint32_t aChildPid, nsIFile** aDump, - uint32_t* aSequence) -{ - return CrashReporter::TakeMinidumpForChild(aChildPid, aDump, aSequence); -} - -bool -XRE_SetRemoteExceptionHandler(const char* aPipe/*= 0*/) -{ -#if defined(XP_WIN) || defined(XP_MACOSX) - return CrashReporter::SetRemoteExceptionHandler(nsDependentCString(aPipe)); -#elif defined(OS_LINUX) - return CrashReporter::SetRemoteExceptionHandler(); -#else -# error "OOP crash reporter unsupported on this platform" -#endif -} -#endif // if defined(MOZ_CRASHREPORTER) - #if defined(XP_WIN) void SetTaskbarGroupId(const nsString& aId) @@ -273,22 +249,6 @@ SetTaskbarGroupId(const nsString& aId) } #endif -#if defined(MOZ_CRASHREPORTER) -#if defined(MOZ_CONTENT_SANDBOX) && !defined(MOZ_WIDGET_GONK) -void -AddContentSandboxLevelAnnotation() -{ - if (XRE_GetProcessType() == GeckoProcessType_Content) { - int level = Preferences::GetInt("security.sandbox.content.level"); - nsAutoCString levelString; - levelString.AppendInt(level); - CrashReporter::AnnotateCrashReport( - NS_LITERAL_CSTRING("ContentSandboxLevel"), levelString); - } -} -#endif /* MOZ_CONTENT_SANDBOX && !MOZ_WIDGET_GONK */ -#endif /* MOZ_CRASHREPORTER */ - nsresult XRE_InitChildProcess(int aArgc, char* aArgv[], @@ -442,33 +402,6 @@ XRE_InitChildProcess(int aArgc, SetupErrorHandling(aArgv[0]); -#if defined(MOZ_CRASHREPORTER) - if (aArgc < 1) - return NS_ERROR_FAILURE; - const char* const crashReporterArg = aArgv[--aArgc]; - -# if defined(XP_WIN) || defined(XP_MACOSX) - // on windows and mac, |crashReporterArg| is the named pipe on which the - // server is listening for requests, or "-" if crash reporting is - // disabled. - if (0 != strcmp("-", crashReporterArg) && - !XRE_SetRemoteExceptionHandler(crashReporterArg)) { - // Bug 684322 will add better visibility into this condition - NS_WARNING("Could not setup crash reporting\n"); - } -# elif defined(OS_LINUX) - // on POSIX, |crashReporterArg| is "true" if crash reporting is - // enabled, false otherwise - if (0 != strcmp("false", crashReporterArg) && - !XRE_SetRemoteExceptionHandler(nullptr)) { - // Bug 684322 will add better visibility into this condition - NS_WARNING("Could not setup crash reporting\n"); - } -# else -# error "OOP crash reporting unsupported on this platform" -# endif -#endif // if defined(MOZ_CRASHREPORTER) - gArgv = aArgv; gArgc = aArgc; @@ -647,12 +580,6 @@ XRE_InitChildProcess(int aArgc, return NS_ERROR_FAILURE; } -#ifdef MOZ_CRASHREPORTER -#if defined(XP_WIN) || defined(XP_MACOSX) - CrashReporter::InitChildProcessTmpDir(); -#endif -#endif - #if defined(XP_WIN) // Set child processes up such that they will get killed after the // chrome process is killed in cases where the user shuts the system @@ -668,12 +595,6 @@ XRE_InitChildProcess(int aArgc, OverrideDefaultLocaleIfNeeded(); -#if defined(MOZ_CRASHREPORTER) -#if defined(MOZ_CONTENT_SANDBOX) && !defined(MOZ_WIDGET_GONK) - AddContentSandboxLevelAnnotation(); -#endif -#endif - // Run the UI event loop on the main thread. uiMessageLoop.MessageLoop::Run(); diff --git a/toolkit/xre/nsWindowsWMain.cpp b/toolkit/xre/nsWindowsWMain.cpp index 788d25a90..e282374cc 100644 --- a/toolkit/xre/nsWindowsWMain.cpp +++ b/toolkit/xre/nsWindowsWMain.cpp @@ -18,10 +18,6 @@ #include "nsSetDllDirectory.h" #endif -#if defined(__GNUC__) -#define XRE_DONT_SUPPORT_XPSP2 -#endif - #ifdef __MINGW32__ /* MingW currently does not implement a wide version of the diff --git a/toolkit/xre/nsX11ErrorHandler.cpp b/toolkit/xre/nsX11ErrorHandler.cpp index 0db24e58b..0fb0d29c5 100644 --- a/toolkit/xre/nsX11ErrorHandler.cpp +++ b/toolkit/xre/nsX11ErrorHandler.cpp @@ -117,18 +117,6 @@ X11Error(Display *display, XErrorEvent *event) { } } -#ifdef MOZ_CRASHREPORTER - switch (XRE_GetProcessType()) { - case GeckoProcessType_Default: - case GeckoProcessType_Plugin: - case GeckoProcessType_Content: - CrashReporter::AppendAppNotesToCrashReport(notes); - break; - default: - ; // crash report notes not supported. - } -#endif - #ifdef DEBUG // The resource id is unlikely to be useful in a crash report without // context of other ids, but add it to the debug console output. |