diff --git a/b2g/chrome/content/settings.js b/b2g/chrome/content/settings.js index d57010b42a99..5c2d5e4f0219 100644 --- a/b2g/chrome/content/settings.js +++ b/b2g/chrome/content/settings.js @@ -611,6 +611,8 @@ var settingsToObserve = { }, 'app.update.interval': 86400, 'apz.overscroll.enabled': true, + 'browser.safebrowsing.enabled': true, + 'browser.safebrowsing.malware.enabled': true, 'debug.fps.enabled': { prefName: 'layers.acceleration.draw-fps', defaultValue: false diff --git a/b2g/config/aries-l/sources.xml b/b2g/config/aries-l/sources.xml index 74a5e7de67d1..5a3717d400ae 100644 --- a/b2g/config/aries-l/sources.xml +++ b/b2g/config/aries-l/sources.xml @@ -21,15 +21,15 @@ - - + + - + - + @@ -38,15 +38,17 @@ - + + + @@ -139,7 +141,7 @@ - + @@ -169,7 +171,7 @@ - + diff --git a/b2g/config/aries/sources.xml b/b2g/config/aries/sources.xml index 8269de90bb82..e0f83fc2406d 100644 --- a/b2g/config/aries/sources.xml +++ b/b2g/config/aries/sources.xml @@ -21,12 +21,12 @@ - - + + - + @@ -38,7 +38,7 @@ - + @@ -125,7 +125,7 @@ - + @@ -167,6 +167,7 @@ + diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 036cb1368e5e..60cf06fd10c8 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -21,12 +21,12 @@ - - + + - + @@ -38,7 +38,7 @@ - + @@ -131,7 +131,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index b46aa6c6905b..40743334ab98 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -21,12 +21,12 @@ - - + + - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 76081c837e55..8da32040df52 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -21,12 +21,12 @@ - - + + - + @@ -34,7 +34,7 @@ - + @@ -131,7 +131,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 7a16e737df47..1af03bf1023c 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -21,12 +21,12 @@ - - + + - + @@ -37,7 +37,7 @@ - + @@ -129,7 +129,7 @@ - + diff --git a/b2g/config/emulator-l/sources.xml b/b2g/config/emulator-l/sources.xml index e979ab148238..f47ef5b9d5fc 100644 --- a/b2g/config/emulator-l/sources.xml +++ b/b2g/config/emulator-l/sources.xml @@ -21,15 +21,15 @@ - - + + - + - + @@ -37,15 +37,17 @@ - + + + @@ -139,7 +141,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index b46aa6c6905b..40743334ab98 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -21,12 +21,12 @@ - - + + - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index e648cf29c05f..d4e5356b66e8 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -21,12 +21,12 @@ - - + + - + @@ -38,7 +38,7 @@ - + @@ -124,7 +124,7 @@ - + diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 6a1f29cfb969..f3d3c0b0bf04 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,9 +1,9 @@ { "git": { - "git_revision": "eeedf205f728573c570c3b86f71d51916288bd04", + "git_revision": "a954bd2954c422b7d24d92cfd73000cb455dce44", "remote": "https://git.mozilla.org/releases/gaia.git", "branch": "" }, - "revision": "8bec48f18dee7096595892f822f8807060999859", + "revision": "e9e8c44b43178139fca915cfe97ae3c52a9afe34", "repo_path": "integration/gaia-central" } diff --git a/b2g/config/nexus-4-kk/sources.xml b/b2g/config/nexus-4-kk/sources.xml index 4698633bb6ad..0b37e8658cfb 100644 --- a/b2g/config/nexus-4-kk/sources.xml +++ b/b2g/config/nexus-4-kk/sources.xml @@ -21,12 +21,12 @@ - - + + - + @@ -38,7 +38,7 @@ - + @@ -131,7 +131,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 6321288bae00..76c1d5bbd8b8 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -21,12 +21,12 @@ - - + + - + @@ -35,7 +35,7 @@ - + @@ -132,7 +132,7 @@ - + diff --git a/b2g/config/nexus-5-l/sources.xml b/b2g/config/nexus-5-l/sources.xml index d88738f81565..c381b7cfb235 100644 --- a/b2g/config/nexus-5-l/sources.xml +++ b/b2g/config/nexus-5-l/sources.xml @@ -21,15 +21,15 @@ - - + + - + - + @@ -38,15 +38,17 @@ - + + + @@ -140,7 +142,7 @@ - + @@ -154,7 +156,7 @@ - + diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index b2e8719a6069..206c250d0530 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -1018,6 +1018,11 @@ + + null + @@ -1033,11 +1038,23 @@ // Waiting until the next MozAfterPaint ensures that we capture // the time it takes to paint, upload the textures to the compositor, // and then composite. + if (this._tabSwitchID) { + TelemetryStopwatch.cancel("FX_TAB_SWITCH_TOTAL_MS"); + } + + let tabSwitchID = Symbol(); + TelemetryStopwatch.start("FX_TAB_SWITCH_TOTAL_MS"); - window.addEventListener("MozAfterPaint", function onMozAfterPaint() { - TelemetryStopwatch.finish("FX_TAB_SWITCH_TOTAL_MS"); + this._tabSwitchID = tabSwitchID; + + let onMozAfterPaint = () => { + if (this._tabSwitchID === tabSwitchID) { + TelemetryStopwatch.finish("FX_TAB_SWITCH_TOTAL_MS"); + this._tabSwitchID = null; + } window.removeEventListener("MozAfterPaint", onMozAfterPaint); - }); + } + window.addEventListener("MozAfterPaint", onMozAfterPaint); } } diff --git a/browser/components/customizableui/CustomizableWidgets.jsm b/browser/components/customizableui/CustomizableWidgets.jsm index 308bb37d9c8d..fbd7400219fa 100644 --- a/browser/components/customizableui/CustomizableWidgets.jsm +++ b/browser/components/customizableui/CustomizableWidgets.jsm @@ -286,7 +286,7 @@ const CustomizableWidgets = [ }, { id: "sync-button", label: "remotetabs-panelmenu.label", - tooltiptext: "remotetabs-panelmenu.tooltiptext", + tooltiptext: "remotetabs-panelmenu.tooltiptext2", type: "view", viewId: "PanelUI-remotetabs", defaultArea: CustomizableUI.AREA_PANEL, diff --git a/browser/components/preferences/in-content/main.js b/browser/components/preferences/in-content/main.js index cfaac9838222..7eaf93e82e7c 100644 --- a/browser/components/preferences/in-content/main.js +++ b/browser/components/preferences/in-content/main.js @@ -253,7 +253,7 @@ var gMainPane = { let win = wm.getMostRecentWindow("navigator:browser"); if (win) { - let accountsTab = win.gBrowser.addTab("about:accounts"); + let accountsTab = win.gBrowser.addTab("about:accounts?action=signin&entrypoint=dev-edition-setup"); win.gBrowser.selectedTab = accountsTab; } }, diff --git a/browser/locales/en-US/chrome/browser/customizableui/customizableWidgets.properties b/browser/locales/en-US/chrome/browser/customizableui/customizableWidgets.properties index 56cafaeca1f6..59626515f518 100644 --- a/browser/locales/en-US/chrome/browser/customizableui/customizableWidgets.properties +++ b/browser/locales/en-US/chrome/browser/customizableui/customizableWidgets.properties @@ -7,7 +7,7 @@ history-panelmenu.label = History history-panelmenu.tooltiptext2 = Show your history (%S) remotetabs-panelmenu.label = Synced Tabs -remotetabs-panelmenu.tooltiptext = Show your synced tabs from other devices +remotetabs-panelmenu.tooltiptext2 = Show tabs from other devices privatebrowsing-button.label = New Private Window # LOCALIZATION NOTE(privatebrowsing-button.tooltiptext): %S is the keyboard shortcut diff --git a/devtools/client/debugger/utils.js b/devtools/client/debugger/utils.js index e212c1cdba30..685b8e6e5d9e 100644 --- a/devtools/client/debugger/utils.js +++ b/devtools/client/debugger/utils.js @@ -315,7 +315,11 @@ var SourceUtils = { } // Prepend the hostname and port number. if (aSeq == 4) { - let host = aUrl.hostPort; + let host; + try { + // Bug 1261860: jar: URLs throw when accessing `hostPost` + host = aUrl.hostPort; + } catch(e) {} if (host) { return this.trimUrl(aUrl, host + "/" + aLabel, aSeq + 1); } diff --git a/devtools/client/framework/target.js b/devtools/client/framework/target.js index e56e0d6a0faf..878a95c65067 100644 --- a/devtools/client/framework/target.js +++ b/devtools/client/framework/target.js @@ -478,16 +478,18 @@ TabTarget.prototype = { this.client.addListener("tabDetached", this._onTabDetached); this._onTabNavigated = (aType, aPacket) => { - // Update the title and url on tabNavigated event. - this._url = aPacket.url; - this._title = aPacket.title; - let event = Object.create(null); event.url = aPacket.url; event.title = aPacket.title; event.nativeConsoleAPI = aPacket.nativeConsoleAPI; event.isFrameSwitching = aPacket.isFrameSwitching; + if (!aPacket.isFrameSwitching) { + // Update the title and url unless this is a frame switch. + this._url = aPacket.url; + this._title = aPacket.title; + } + // Send any stored event payload (DOMWindow or nsIRequest) for backwards // compatibility with non-remotable tools. if (aPacket.state == "start") { diff --git a/devtools/client/framework/test/browser.ini b/devtools/client/framework/test/browser.ini index a282c04a8552..d416f3aa5124 100644 --- a/devtools/client/framework/test/browser.ini +++ b/devtools/client/framework/test/browser.ini @@ -7,6 +7,7 @@ support-files = browser_toolbox_options_disable_cache.sjs browser_toolbox_sidebar_tool.xul browser_toolbox_window_title_changes_page.html + browser_toolbox_window_title_frame_select_page.html code_math.js code_ugly.js head.js @@ -74,6 +75,7 @@ skip-if = e10s # Bug 1069044 - destroyInspector may hang during shutdown [browser_toolbox_window_shortcuts.js] skip-if = os == "mac" && os_version == "10.8" || os == "win" && os_version == "5.1" # Bug 851129 - Re-enable browser_toolbox_window_shortcuts.js test after leaks are fixed [browser_toolbox_window_title_changes.js] +[browser_toolbox_window_title_frame_select.js] [browser_toolbox_zoom.js] [browser_two_tabs.js] skip-if = e10s && debug && os == 'win' # Bug 1231869 diff --git a/devtools/client/framework/test/browser_toolbox_window_title_frame_select.js b/devtools/client/framework/test/browser_toolbox_window_title_frame_select.js new file mode 100644 index 000000000000..9391b9bc146d --- /dev/null +++ b/devtools/client/framework/test/browser_toolbox_window_title_frame_select.js @@ -0,0 +1,72 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +/* import-globals-from shared-head.js */ + +"use strict"; + +/** + * Check that the detached devtools window title is not updated when switching + * the selected frame. + */ + +var {Toolbox} = require("devtools/client/framework/toolbox"); +const URL = URL_ROOT + "browser_toolbox_window_title_frame_select_page.html"; +const IFRAME_URL = URL_ROOT + "browser_toolbox_window_title_changes_page.html"; + +add_task(function* () { + Services.prefs.setBoolPref("devtools.command-button-frames.enabled", true); + + yield addTab(URL); + let target = TargetFactory.forTab(gBrowser.selectedTab); + let toolbox = yield gDevTools.showToolbox(target, null, + Toolbox.HostType.BOTTOM); + + yield toolbox.selectTool("inspector"); + yield toolbox.switchHost(Toolbox.HostType.WINDOW); + + is(getTitle(), "Inspector - Page title", + "Devtools title correct after switching to detached window host"); + + // Verify that the frame list button is visible and populated + let btn = toolbox.doc.getElementById("command-button-frames"); + let frames = Array.slice(btn.firstChild.querySelectorAll("[data-window-id]")); + is(frames.length, 2, "We have both frames in the list"); + + let topFrameBtn = frames.filter(b => b.getAttribute("label") == URL)[0]; + let iframeBtn = frames.filter(b => b.getAttribute("label") == IFRAME_URL)[0]; + ok(topFrameBtn, "Got top level document in the list"); + ok(iframeBtn, "Got iframe document in the list"); + + // Listen to will-navigate to check if the view is empty + let willNavigate = toolbox.target.once("will-navigate"); + + // Only select the iframe after we are able to select an element from the top + // level document. + let newRoot = toolbox.getPanel("inspector").once("new-root"); + info("Select the iframe"); + iframeBtn.click(); + + yield willNavigate; + yield newRoot; + + info("Navigation to the iframe is done, the inspector should be back up"); + is(getTitle(), "Inspector - Page title", + "Devtools title was not updated after changing inspected frame"); + + info("Cleanup toolbox and test preferences."); + yield toolbox.destroy(); + toolbox = null; + gBrowser.removeCurrentTab(); + Services.prefs.clearUserPref("devtools.toolbox.host"); + Services.prefs.clearUserPref("devtools.toolbox.selectedTool"); + Services.prefs.clearUserPref("devtools.toolbox.sideEnabled"); + Services.prefs.clearUserPref("devtools.command-button-frames.enabled"); + finish(); +}); + +function getTitle() { + return Services.wm.getMostRecentWindow("devtools:toolbox").document.title; +} diff --git a/devtools/client/framework/test/browser_toolbox_window_title_frame_select_page.html b/devtools/client/framework/test/browser_toolbox_window_title_frame_select_page.html new file mode 100644 index 000000000000..1eda94a9cf3c --- /dev/null +++ b/devtools/client/framework/test/browser_toolbox_window_title_frame_select_page.html @@ -0,0 +1,11 @@ + + + + + Page title + + + + + diff --git a/devtools/client/shared/browser-loader.js b/devtools/client/shared/browser-loader.js index 4bca0cec25b3..d2531e4cf1dc 100644 --- a/devtools/client/shared/browser-loader.js +++ b/devtools/client/shared/browser-loader.js @@ -79,7 +79,6 @@ function BrowserLoaderBuilder({ baseURI, window, useOnlyShared }) { const loaderOptions = devtools.require("@loader/options"); const dynamicPaths = {}; const componentProxies = new Map(); - const hotReloadEnabled = Services.prefs.getBoolPref("devtools.loader.hotreload"); if (AppConstants.DEBUG || AppConstants.DEBUG_JS_MODULES) { dynamicPaths["devtools/client/shared/vendor/react"] = @@ -134,7 +133,7 @@ function BrowserLoaderBuilder({ baseURI, window, useOnlyShared }) { } }; - if (hotReloadEnabled) { + if (Services.prefs.getBoolPref("devtools.loader.hotreload")) { opts.loadModuleHook = (module, require) => { const { uri, exports } = module; @@ -158,24 +157,19 @@ function BrowserLoaderBuilder({ baseURI, window, useOnlyShared }) { } return exports; } + const watcher = devtools.require("devtools/client/shared/devtools-file-watcher"); + let onFileChanged = (_, relativePath, path) => { + this.hotReloadFile(componentProxies, "resource://devtools/" + relativePath); + }; + watcher.on("file-changed", onFileChanged); + window.addEventListener("unload", () => { + watcher.off("file-changed", onFileChanged); + }); } const mainModule = loaders.Module(baseURI, joinURI(baseURI, "main.js")); this.loader = loaders.Loader(opts); this.require = loaders.Require(this.loader, mainModule); - - if (hotReloadEnabled) { - const watcher = devtools.require("devtools/client/shared/file-watcher"); - const onFileChanged = (_, relativePath) => { - this.hotReloadFile(window, componentProxies, - "resource://devtools/" + relativePath); - }; - watcher.on("file-changed", onFileChanged); - - window.addEventListener("unload", () => { - watcher.off("file-changed", onFileChanged); - }); - } } BrowserLoaderBuilder.prototype = { @@ -201,7 +195,7 @@ BrowserLoaderBuilder.prototype = { }); }, - hotReloadFile: function(window, componentProxies, fileURI) { + hotReloadFile: function(componentProxies, fileURI) { if (fileURI.match(/\.js$/)) { // Test for React proxy components const proxy = componentProxies.get(fileURI); diff --git a/devtools/client/shared/css-reload.js b/devtools/client/shared/css-reload.js index 919e416efb04..0ed7d0d3914a 100644 --- a/devtools/client/shared/css-reload.js +++ b/devtools/client/shared/css-reload.js @@ -103,7 +103,7 @@ function replaceCSSResource(window, fileURI) { function watchCSS(window) { if (Services.prefs.getBoolPref("devtools.loader.hotreload")) { - const watcher = require("devtools/client/shared/file-watcher"); + const watcher = require("devtools/client/shared/devtools-file-watcher"); function onFileChanged(_, relativePath) { if (relativePath.match(/\.css$/)) { diff --git a/devtools/client/shared/devtools-file-watcher.js b/devtools/client/shared/devtools-file-watcher.js new file mode 100644 index 000000000000..584a3dcaf0a5 --- /dev/null +++ b/devtools/client/shared/devtools-file-watcher.js @@ -0,0 +1,77 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +const { Ci } = require("chrome"); +const Services = require("Services"); +const EventEmitter = require("devtools/shared/event-emitter"); + +loader.lazyImporter(this, "OS", "resource://gre/modules/osfile.jsm"); + +const HOTRELOAD_PREF = "devtools.loader.hotreload"; + +function resolveResourcePath(uri) { + const handler = Services.io.getProtocolHandler("resource") + .QueryInterface(Ci.nsIResProtocolHandler); + const resolved = handler.resolveURI(Services.io.newURI(uri, null, null)); + return resolved.replace(/file:\/\//, ""); +} + +function findSourceDir(path) { + if (path === "" || path === "/") { + return Promise.resolve(null); + } + + return OS.File.exists( + OS.Path.join(path, "devtools/client/shared/file-watcher.js") + ).then(exists => { + if (exists) { + return path; + } else { + return findSourceDir(OS.Path.dirname(path)); + } + }); +} + +let worker = null; +const onPrefChange = function() { + // We need to figure out a src dir to watch. These are the actual + // files the user is working with, not the files in the obj dir. We + // do this by walking up the filesystem and looking for the devtools + // directories, and falling back to the raw path. This means none of + // this will work for users who store their obj dirs outside of the + // src dir. + // + // We take care not to mess with the `devtoolsPath` if that's what + // we end up using, because it might be intentionally mapped to a + // specific place on the filesystem for loading devtools externally. + // + // `devtoolsPath` is currently the devtools directory inside of the + // obj dir, and we search for `devtools/client`, so go up 2 levels + // to skip that devtools dir and start searching for the src dir. + if (Services.prefs.getBoolPref(HOTRELOAD_PREF) && !worker) { + const devtoolsPath = resolveResourcePath("resource://devtools") + .replace(/\/$/, ""); + const searchPoint = OS.Path.dirname(OS.Path.dirname(devtoolsPath)); + findSourceDir(searchPoint) + .then(srcPath => { + const rootPath = srcPath ? OS.Path.join(srcPath, "devtools") : devtoolsPath; + const watchPath = OS.Path.join(rootPath, "client"); + const { watchFiles } = require("devtools/client/shared/file-watcher"); + worker = watchFiles(watchPath, path => { + let relativePath = path.replace(rootPath + "/", ""); + module.exports.emit("file-changed", relativePath, path); + }); + }); + } else if (worker) { + worker.terminate(); + worker = null; + } +} +Services.prefs.addObserver(HOTRELOAD_PREF, { + observe: onPrefChange +}, false); +onPrefChange(); + +EventEmitter.decorate(module.exports); diff --git a/devtools/client/shared/file-watcher-worker.js b/devtools/client/shared/file-watcher-worker.js index 8ec5504899cd..8579fa2924ff 100644 --- a/devtools/client/shared/file-watcher-worker.js +++ b/devtools/client/shared/file-watcher-worker.js @@ -9,17 +9,6 @@ importScripts("resource://gre/modules/osfile.jsm"); const modifiedTimes = new Map(); -function findSourceDir(path) { - if (path === "" || path === "/") { - return null; - } else if (OS.File.exists( - OS.Path.join(path, "devtools/client/shared/file-watcher.js") - )) { - return path; - } - return findSourceDir(OS.Path.dirname(path)); -} - function gatherFiles(path, fileRegex) { let files = []; const iterator = new OS.File.DirectoryIterator(path); @@ -71,28 +60,8 @@ function scanFiles(files, onChangedFile) { onmessage = function(event) { const { path, fileRegex } = event.data; - const devtoolsPath = event.data.devtoolsPath.replace(/\/$/, ""); - // We need to figure out a src dir to watch. These are the actual - // files the user is working with, not the files in the obj dir. We - // do this by walking up the filesystem and looking for the devtools - // directories, and falling back to the raw path. This means none of - // this will work for users who store their obj dirs outside of the - // src dir. - // - // We take care not to mess with the `devtoolsPath` if that's what - // we end up using, because it might be intentionally mapped to a - // specific place on the filesystem for loading devtools externally. - // - // `devtoolsPath` is currently the devtools directory inside of the - // obj dir, and we search for `devtools/client`, so go up 2 levels - // to skip that devtools dir and start searching for the src dir. - const searchPoint = OS.Path.dirname(OS.Path.dirname(devtoolsPath)); - const srcPath = findSourceDir(searchPoint); - const rootPath = srcPath ? OS.Path.join(srcPath, "devtools") : devtoolsPath; - const watchPath = OS.Path.join(rootPath, path.replace(/^devtools\//, "")); - - const info = OS.File.stat(watchPath); + const info = OS.File.stat(path); if (!info.isDir) { throw new Error("Watcher expects a directory as root path"); } @@ -100,14 +69,13 @@ onmessage = function(event) { // We get a list of all the files upfront, which means we don't // support adding new files. But you need to rebuild Firefox when // adding a new file anyway. - const files = gatherFiles(watchPath, fileRegex || /.*/); + const files = gatherFiles(path, fileRegex || /.*/); // Every second, scan for file changes by stat-ing each of them and // comparing modification time. setInterval(() => { scanFiles(files, changedFile => { - postMessage({ fullPath: changedFile, - relativePath: changedFile.replace(rootPath + "/", "") }); + postMessage({ path: changedFile }); }); }, 1000); }; diff --git a/devtools/client/shared/file-watcher.js b/devtools/client/shared/file-watcher.js index e0a2bafc8390..545f3cbc3d04 100644 --- a/devtools/client/shared/file-watcher.js +++ b/devtools/client/shared/file-watcher.js @@ -5,22 +5,8 @@ const { Ci, ChromeWorker } = require("chrome"); const Services = require("Services"); -const EventEmitter = require("devtools/shared/event-emitter"); - -const HOTRELOAD_PREF = "devtools.loader.hotreload"; - -function resolveResourcePath(uri) { - const handler = Services.io.getProtocolHandler("resource") - .QueryInterface(Ci.nsIResProtocolHandler); - const resolved = handler.resolveURI(Services.io.newURI(uri, null, null)); - return resolved.replace(/file:\/\//, ""); -} function watchFiles(path, onFileChanged) { - if (!path.startsWith("devtools/")) { - throw new Error("`watchFiles` expects a devtools path"); - } - const watchWorker = new ChromeWorker( "resource://devtools/client/shared/file-watcher-worker.js" ); @@ -30,35 +16,14 @@ function watchFiles(path, onFileChanged) { // chrome). This means that this system will only work when built // files are symlinked, so that these URIs actually read from // local sources. There might be a better way to do this. - const { relativePath, fullPath } = event.data; - onFileChanged(relativePath, fullPath); + const { path } = event.data; + onFileChanged(path); }; watchWorker.postMessage({ - path: path, - // We must do this here because we can't access the needed APIs in - // a worker. - devtoolsPath: resolveResourcePath("resource://devtools"), - fileRegex: /\.(js|css|svg|png)$/ }); + path, + fileRegex: /\.(js|css|svg|png)$/ + }); return watchWorker; } - -EventEmitter.decorate(module.exports); - -let watchWorker; -function onPrefChange() { - if (Services.prefs.getBoolPref(HOTRELOAD_PREF) && !watchWorker) { - watchWorker = watchFiles("devtools/client", (relativePath, fullPath) => { - module.exports.emit("file-changed", relativePath, fullPath); - }); - } else if (watchWorker) { - watchWorker.terminate(); - watchWorker = null; - } -} - -Services.prefs.addObserver(HOTRELOAD_PREF, { - observe: onPrefChange -}, false); - -onPrefChange(); +exports.watchFiles = watchFiles; diff --git a/devtools/client/shared/inplace-editor.js b/devtools/client/shared/inplace-editor.js index 3da3224f8bae..35e593e1c5a5 100644 --- a/devtools/client/shared/inplace-editor.js +++ b/devtools/client/shared/inplace-editor.js @@ -382,7 +382,7 @@ InplaceEditor.prototype = { } } - copyTextStyles(this.input, this._measurement); + copyAllStyles(this.input, this._measurement); this._updateSize(); }, @@ -1367,6 +1367,17 @@ function copyTextStyles(from, to) { to.style.fontSize = getCssText("font-size"); to.style.fontWeight = getCssText("font-weight"); to.style.fontStyle = getCssText("font-style"); +} + +/** + * Copy all styles which could have an impact on the element size. + */ +function copyAllStyles(from, to) { + let win = from.ownerDocument.defaultView; + let style = win.getComputedStyle(from); + let getCssText = name => style.getPropertyCSSValue(name).cssText; + + copyTextStyles(from, to); to.style.lineHeight = getCssText("line-height"); // If box-sizing is set to border-box, box model styles also need to be diff --git a/devtools/client/shared/moz.build b/devtools/client/shared/moz.build index 21c69b12c4b6..0042a9bbf9e5 100644 --- a/devtools/client/shared/moz.build +++ b/devtools/client/shared/moz.build @@ -24,6 +24,7 @@ DevToolsModules( 'demangle.js', 'developer-toolbar.js', 'devices.js', + 'devtools-file-watcher.js', 'DOMHelpers.jsm', 'doorhanger.js', 'file-watcher-worker.js', diff --git a/devtools/client/shared/test/browser_inplace-editor_maxwidth.js b/devtools/client/shared/test/browser_inplace-editor_maxwidth.js index becfa81d9a04..1002e417eabc 100644 --- a/devtools/client/shared/test/browser_inplace-editor_maxwidth.js +++ b/devtools/client/shared/test/browser_inplace-editor_maxwidth.js @@ -6,7 +6,6 @@ var { editableField } = require("devtools/client/shared/inplace-editor"); -const LINE_HEIGHT = 15; const MAX_WIDTH = 300; const START_TEXT = "Start text"; const LONG_TEXT = "I am a long text and I will not fit in a 300px container. " + @@ -95,7 +94,10 @@ let testMaxWidth = Task.async(function* (editor) { * @return {Number} the number of lines */ function getLines(textarea) { - return Math.floor(textarea.clientHeight / LINE_HEIGHT); + let win = textarea.ownerDocument.defaultView; + let style = win.getComputedStyle(textarea); + let lineHeight = style.getPropertyCSSValue("line-height").cssText; + return Math.floor(textarea.clientHeight / parseFloat(lineHeight)); } /** @@ -125,7 +127,6 @@ function createSpan(doc) { info("Creating a new span element"); let span = doc.createElement("span"); span.setAttribute("tabindex", "0"); - span.style.lineHeight = LINE_HEIGHT + "px"; span.style.fontSize = "11px"; span.style.fontFamily = "monospace"; span.textContent = START_TEXT; diff --git a/devtools/docs/redux-guidelines.md b/devtools/docs/redux-guidelines.md index 2563ce4cbe74..1782a6de47b8 100644 --- a/devtools/docs/redux-guidelines.md +++ b/devtools/docs/redux-guidelines.md @@ -1,3 +1,45 @@ +### Getting data from the store + +To get data from the store, use `connect()`. + +When using connect, you'll break up your component into two parts: + +1. The part that displays the data (presentational component) + + // todos.js + const Todos = React.createClass({ + propTypes: { + todos: PropTypes.array.isRequired + } + + render: function() {...} + }) + + module.exports = Todos; + +2. The part that gets the data from the store (container component) + + // todos-container.js + const Todos = require("path/to/todos"); + + function mapStateToProps(state) { + return { + todos: state.todos + }; + } + + module.exports = connect(mapStateToProps)(Todos); + + +`connect()` generates the container component. It wraps around the presentational component that was passed in (e.g. Todos). + +The `mapStateToProps` is often called a selector. That's because it selects data from the state object. When the container component is rendering, the the selector will be called. It will pick out the data that the presentational component is going to need. Redux will take this object and pass it in to the presentational component as props. + +With this setup, a presentational component is easy to share across different apps. It doesn't have any dependencies on the app, or any hardcoded expectations about how to get data. It just gets props that are passed to it and renders them. + +For more advanced use cases, you can pass additional parameters into the selector and `connect()` functions. Read about those in the [`connect()`](https://github.com/reactjs/react-redux/blob/master/docs/api.md#connectmapstatetoprops-mapdispatchtoprops-mergeprops-options) docs. + +--- Need to answer the following questions: @@ -7,4 +49,4 @@ Need to answer the following questions: * What file structure should I use? * How do I test redux code? -And more. \ No newline at end of file +And more. diff --git a/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.cpp b/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.cpp index 98d806fd5409..4bf5ca13eb1c 100644 --- a/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.cpp +++ b/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.cpp @@ -222,7 +222,11 @@ public: { DaemonSocketPDU& pdu = GetPDU(); - aArg1 = pdu.AcquireFd(); + auto receiveFds = pdu.AcquireFds(); + if (NS_WARN_IF(receiveFds.Length() == 0)) { + return NS_ERROR_ILLEGAL_VALUE; + } + aArg1 = receiveFds[0]; if (NS_WARN_IF(aArg1 < 0)) { return NS_ERROR_ILLEGAL_VALUE; @@ -279,7 +283,14 @@ BluetoothDaemonSocketModule::ConnectRsp(const DaemonSocketPDUHeader& aHeader, BluetoothSocketResultHandler* aRes) { /* the file descriptor is attached in the PDU's ancillary data */ - int fd = aPDU.AcquireFd(); + auto receiveFds = aPDU.AcquireFds(); + if (receiveFds.Length() == 0) { + ErrorRunnable::Dispatch(aRes, &BluetoothSocketResultHandler::OnError, + ConstantInitOp1(STATUS_FAIL)); + return; + } + int fd = -1; + fd = receiveFds[0]; if (fd < 0) { ErrorRunnable::Dispatch(aRes, &BluetoothSocketResultHandler::OnError, ConstantInitOp1(STATUS_FAIL)); diff --git a/dom/nfc/gonk/NfcService.cpp b/dom/nfc/gonk/NfcService.cpp index b0303de27db1..e7430e4fce16 100644 --- a/dom/nfc/gonk/NfcService.cpp +++ b/dom/nfc/gonk/NfcService.cpp @@ -6,12 +6,12 @@ #include "NfcService.h" #include -#include #include "mozilla/ClearOnShutdown.h" #include "mozilla/dom/NfcOptionsBinding.h" #include "mozilla/dom/ToJSValue.h" #include "mozilla/dom/RootedDictionary.h" #include "mozilla/Endian.h" +#include "mozilla/Hal.h" #include "mozilla/ipc/ListenSocket.h" #include "mozilla/ipc/ListenSocketConsumer.h" #include "mozilla/ipc/NfcConnector.h" @@ -32,6 +32,7 @@ using namespace android; using namespace mozilla::dom; using namespace mozilla::ipc; +using namespace mozilla::hal; namespace mozilla { @@ -109,7 +110,7 @@ NfcConsumer::Start() // If we could not cleanup properly before and an old // instance of the daemon is still running, we kill it // here. - Unused << NS_WARN_IF(property_set("ctl.stop", "nfcd") < 0); + StopSystemService("nfcd"); mHandler = MakeUnique(); @@ -377,9 +378,10 @@ NfcConsumer::OnConnectSuccess(int aIndex) switch (aIndex) { case LISTEN_SOCKET: { - nsCString value("nfcd:-S -a "); - value.Append(mListenSocketName); - if (NS_WARN_IF(property_set("ctl.start", value.get()) < 0)) { + nsCString args("-S -a "); + args.Append(mListenSocketName); + nsresult rv = StartSystemService("nfcd", args.get()); + if (NS_FAILED(rv)) { OnConnectError(STREAM_SOCKET); } break; diff --git a/ipc/hal/DaemonSocketPDU.cpp b/ipc/hal/DaemonSocketPDU.cpp index 08184f872c29..e92d4cbcdc52 100644 --- a/ipc/hal/DaemonSocketPDU.cpp +++ b/ipc/hal/DaemonSocketPDU.cpp @@ -119,7 +119,7 @@ DaemonSocketPDU::Receive(int aFd) iv.iov_base = GetData(0); iv.iov_len = GetAvailableSpace(); - uint8_t cmsgbuf[CMSG_SPACE(sizeof(int))]; + uint8_t cmsgbuf[CMSG_SPACE(sizeof(int)* MAX_NFDS)]; struct msghdr msg; memset(&msg, 0, sizeof(msg)); @@ -140,24 +140,33 @@ DaemonSocketPDU::Receive(int aFd) SetRange(0, res); - struct cmsghdr *chdr = CMSG_FIRSTHDR(&msg); + struct cmsghdr* chdr = CMSG_FIRSTHDR(&msg); for (; chdr; chdr = CMSG_NXTHDR(&msg, chdr)) { if (NS_WARN_IF(!CMSGHDR_CONTAINS_FD(chdr))) { continue; } - // Retrieve sent file descriptor. If multiple file descriptors - // have been sent, we close all but the final one. - mReceivedFd = *(static_cast(CMSG_DATA(chdr))); + // Retrieve sent file descriptors. + size_t fdCount = (chdr->cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) / sizeof(int); + for (size_t i = 0; i < fdCount; i++) { + int* receivedFd = static_cast(CMSG_DATA(chdr)) + i; + mReceivedFds.AppendElement(ScopedClose(*receivedFd)); + } } return res; } -int -DaemonSocketPDU::AcquireFd() +nsTArray +DaemonSocketPDU::AcquireFds() { - return mReceivedFd.forget(); + // Forget all RAII object to avoid closing the fds. + nsTArray fds; + for (auto& fd : mReceivedFds) { + fds.AppendElement(fd.forget()); + } + mReceivedFds.Clear(); + return fds; } nsresult diff --git a/ipc/hal/DaemonSocketPDU.h b/ipc/hal/DaemonSocketPDU.h index 006b3ac3a2c8..ebc4e4419885 100644 --- a/ipc/hal/DaemonSocketPDU.h +++ b/ipc/hal/DaemonSocketPDU.h @@ -10,10 +10,12 @@ #include "mozilla/FileUtils.h" #include "mozilla/ipc/SocketBase.h" #include "mozilla/ipc/DaemonSocketMessageHandlers.h" +#include "nsTArray.h" namespace mozilla { namespace ipc { +static const size_t MAX_NFDS = 16; class DaemonSocketIOConsumer; /** @@ -72,7 +74,7 @@ public: ssize_t Send(int aFd) override; ssize_t Receive(int aFd) override; - int AcquireFd(); + nsTArray AcquireFds(); nsresult UpdateHeader(); @@ -82,7 +84,7 @@ private: DaemonSocketIOConsumer* mConsumer; RefPtr mRes; - ScopedClose mReceivedFd; + nsTArray mReceivedFds; }; } diff --git a/mobile/android/base/FennecManifest_permissions.xml.in b/mobile/android/base/FennecManifest_permissions.xml.in index 750d0c6d5b0c..362e30f1e418 100644 --- a/mobile/android/base/FennecManifest_permissions.xml.in +++ b/mobile/android/base/FennecManifest_permissions.xml.in @@ -10,9 +10,12 @@ #include ../search/manifests/SearchAndroidManifest_permissions.xml.in #endif -#ifdef MOZ_ANDROID_GCM + #include GcmAndroidManifest_permissions.xml.in -#endif + + + Test for Bug 1044556 + + + + + + + + +Mozilla Bug 1044556 +

+ +
+
+ + diff --git a/testing/docker/centos6-build-upd/Dockerfile b/testing/docker/centos6-build-upd/Dockerfile index a84fc4fc5972..a245bcbe54b5 100644 --- a/testing/docker/centos6-build-upd/Dockerfile +++ b/testing/docker/centos6-build-upd/Dockerfile @@ -1,4 +1,4 @@ -FROM taskcluster/centos6-build:0.1.5 +FROM taskcluster/centos6-build:0.1.6 MAINTAINER Dustin J. Mitchell ### update to latest from upstream repositories diff --git a/testing/docker/centos6-build-upd/VERSION b/testing/docker/centos6-build-upd/VERSION index c21c47a4ec35..01ae56f9e52a 100644 --- a/testing/docker/centos6-build-upd/VERSION +++ b/testing/docker/centos6-build-upd/VERSION @@ -1 +1 @@ -0.1.5.20160323120600 +0.1.6.20160329195300 diff --git a/testing/docker/centos6-build/VERSION b/testing/docker/centos6-build/VERSION index 9faa1b7a7339..c946ee6160c2 100644 --- a/testing/docker/centos6-build/VERSION +++ b/testing/docker/centos6-build/VERSION @@ -1 +1 @@ -0.1.5 +0.1.6 diff --git a/testing/docker/centos6-build/system-setup.sh b/testing/docker/centos6-build/system-setup.sh index e39a0c4ca58b..ddb529eed735 100644 --- a/testing/docker/centos6-build/system-setup.sh +++ b/testing/docker/centos6-build/system-setup.sh @@ -421,8 +421,8 @@ cat >requirements.txt <<'EOF' # sha256: 90pZQ6kAXB6Je8-H9-ivfgDAb6l3e5rWkfafn6VKh9g virtualenv==13.1.2 -# sha256: W6lDjWqw25P3sHhrpjITjrZKncDZPjDd4rF7Mo_cbXo -mercurial==3.7.2 +# sha256: wJnELXTi1SC2HdNyzZlrD6dgXAZheDT9exPHm5qaWzA +mercurial==3.7.3 EOF peep install -r requirements.txt diff --git a/testing/docker/desktop-build/Dockerfile b/testing/docker/desktop-build/Dockerfile index 03e6ef67b7ec..69ceca63a041 100644 --- a/testing/docker/desktop-build/Dockerfile +++ b/testing/docker/desktop-build/Dockerfile @@ -1,4 +1,4 @@ -FROM taskcluster/centos6-build-upd:0.1.5.20160323120600 +FROM taskcluster/centos6-build-upd:0.1.6.20160329195300 MAINTAINER Dustin J. Mitchell # Add build scripts; these are the entry points from the taskcluster worker, and diff --git a/testing/docker/desktop-test/Dockerfile b/testing/docker/desktop-test/Dockerfile index 3975a205876d..f210abbd1655 100644 --- a/testing/docker/desktop-test/Dockerfile +++ b/testing/docker/desktop-test/Dockerfile @@ -1,4 +1,4 @@ -FROM taskcluster/ubuntu1204-test-upd:0.1.8.20160218152601 +FROM taskcluster/ubuntu1204-test-upd:0.1.9.20160329211700 MAINTAINER Jonas Finnemann Jensen # Add utilities and configuration diff --git a/testing/docker/ubuntu1204-test-upd/Dockerfile b/testing/docker/ubuntu1204-test-upd/Dockerfile index afcc1ba4123f..5393c9d9a3f4 100644 --- a/testing/docker/ubuntu1204-test-upd/Dockerfile +++ b/testing/docker/ubuntu1204-test-upd/Dockerfile @@ -1,4 +1,4 @@ -FROM taskcluster/ubuntu1204-test:0.1.8 +FROM taskcluster/ubuntu1204-test:0.1.9 MAINTAINER Dustin J. Mitchell ### update to latest from upstream repositories diff --git a/testing/docker/ubuntu1204-test-upd/VERSION b/testing/docker/ubuntu1204-test-upd/VERSION index 08a5fdfce98c..ba014cd78a6c 100644 --- a/testing/docker/ubuntu1204-test-upd/VERSION +++ b/testing/docker/ubuntu1204-test-upd/VERSION @@ -1 +1 @@ -0.1.8.20160218152601 +0.1.9.20160329211700 diff --git a/testing/docker/ubuntu1204-test/VERSION b/testing/docker/ubuntu1204-test/VERSION index 699c6c6d4e07..1a030947e832 100644 --- a/testing/docker/ubuntu1204-test/VERSION +++ b/testing/docker/ubuntu1204-test/VERSION @@ -1 +1 @@ -0.1.8 +0.1.9 diff --git a/testing/docker/ubuntu1204-test/system-setup.sh b/testing/docker/ubuntu1204-test/system-setup.sh index ab96b2c72c9c..6a3ae1b4d461 100644 --- a/testing/docker/ubuntu1204-test/system-setup.sh +++ b/testing/docker/ubuntu1204-test/system-setup.sh @@ -155,8 +155,8 @@ cat >requirements.txt <<'EOF' # sha256: qryO8YzdvYoqnH-SvEPi_qVLEUczDWXbkg7zzpgS49w virtualenv==13.1.2 -# sha256: tQ9peOfTn-DLKY-j-j6c5B0jVnIdFV5SiPnFfl8T6ac -mercurial==3.5 +# sha256: wJnELXTi1SC2HdNyzZlrD6dgXAZheDT9exPHm5qaWzA +mercurial==3.7.3 EOF peep install -r requirements.txt diff --git a/testing/mozharness/configs/b2g/taskcluster-spark-dogfood.py b/testing/mozharness/configs/b2g/taskcluster-spark-dogfood.py index 2678b5883150..7ab6ccc26c61 100644 --- a/testing/mozharness/configs/b2g/taskcluster-spark-dogfood.py +++ b/testing/mozharness/configs/b2g/taskcluster-spark-dogfood.py @@ -14,7 +14,6 @@ config = { "GAIA_OPTIMIZE": "1", "B2G_UPDATER": "1", "LIGHTSABER": "1", - "DOGFOOD": "1", "BOWER_FLAGS": "--allow-root", "B2G_PATH": "%(work_dir)s", "GAIA_DISTRIBUTION_DIR": "%(work_dir)s/gaia/distros/spark", diff --git a/testing/taskcluster/scripts/builder/build-mulet-linux.sh b/testing/taskcluster/scripts/builder/build-mulet-linux.sh index e510fb37eaf1..a5b9e9d86bbb 100755 --- a/testing/taskcluster/scripts/builder/build-mulet-linux.sh +++ b/testing/taskcluster/scripts/builder/build-mulet-linux.sh @@ -7,6 +7,10 @@ PATH=$DIRNAME:$PATH . desktop-setup.sh +# use "simple" package names so that they can be hard-coded in the task's +# extras.locations +export MOZ_SIMPLE_PACKAGE_NAME=target + cd $GECKO_DIR ./mach build; @@ -20,22 +24,12 @@ cd $MOZ_OBJDIR/dist; ls -lah $MOZ_OBJDIR/dist/ -# Target names are cached so make sure we discard them first if found. -rm -f target.linux-x86_64.tar.bz2 target.linux-x86_64.json target*.tests.zip - # Artifacts folder is outside of the cache. mkdir -p $HOME/artifacts/ # Discard version numbers from packaged files, they just make it hard to write # the right filename in the task payload where artifacts are declared -mv *.linux-x86_64.tar.bz2 $HOME/artifacts/target.linux-x86_64.tar.bz2 -mv *.linux-x86_64.json $HOME/artifacts/target.linux-x86_64.json -for name in common cppunittest reftest mochitest xpcshell web-platform; do - mv *.$name.tests.zip $HOME/artifacts/target.$name.tests.zip ; -done -mv *.test_packages.json $HOME/artifacts/target.test_packages.json -mv *.crashreporter-symbols.zip $HOME/artifacts/target.crashreporter-symbols.zip -mv jsshell-linux-x86_64.zip $HOME/artifacts/jsshell-linux-x86_64.zip +mv target.* $HOME/artifacts mv mozharness.zip $HOME/artifacts/mozharness.zip ccache -s diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_dogfood.yml b/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_dogfood.yml new file mode 100644 index 000000000000..323e82ed3757 --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_dogfood.yml @@ -0,0 +1,31 @@ +$inherits: + from: 'tasks/builds/b2g_aries_spark_ota_base.yml' + variables: + build_name: 'aries-dogfood' + build_type: 'debug' +task: + metadata: + name: '[TC] B2G Aries Dogfood' + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-aries-spark-dogfood' + - 'docker-worker:cache:level-{{level}}-{{project}}-build-aries-spark-dogfood-objdir-gecko' + payload: + cache: + level-{{level}}-{{project}}-build-aries-spark-dogfood: /home/worker/workspace + level-{{level}}-{{project}}-build-aries-spark-dogfood-objdir-gecko: /home/worker/objdir-gecko + env: + VARIANT: userdebug + MOZHARNESS_CONFIG: b2g/taskcluster-spark-dogfood.py + B2G_UPDATE_CHANNEL: '{{b2g_update_channel}}' + extra: + treeherderEnv: + - production + - staging + treeherder: + symbol: B + groupSymbol: Aries-DogFood + groupName: Aries Device Image + machine: + platform: b2g-device-image + collection: + debug: true diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_noril_opt.yml b/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_noril_opt.yml new file mode 100644 index 000000000000..68cf4caf0d27 --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_noril_opt.yml @@ -0,0 +1,43 @@ +$inherits: + from: 'tasks/builds/b2g_phone_base.yml' + variables: + build_name: 'aries-noril' + build_type: 'opt' +task: + workerType: flame-kk + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-aries-opt' + - 'docker-worker:cache:level-{{level}}-{{project}}-build-aries-opt-objdir-gecko' + metadata: + name: '[TC] B2G Aries No RIL Opt' + + payload: + cache: + level-{{level}}-{{project}}-build-aries-opt: /home/worker/workspace + level-{{level}}-{{project}}-build-aries-opt-objdir-gecko: /home/worker/objdir-gecko + env: + TARGET: 'aries' + DEBUG: 0 + VARIANT: user + GAIA_OPTIMIZE: '1' + B2G_SYSTEM_APPS: '1' + MOZHARNESS_CONFIG: b2g/taskcluster-spark.py + GECKO_CONFIGURE_ARGS: "--disable-b2g-ril" + command: + - > + checkout-gecko workspace && + cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder && + buildbot_step 'Build' ./build-phone.sh $HOME/workspace + extra: + treeherderEnv: + - production + - staging + treeherder: + symbol: Bnr + groupSymbol: Aries + groupName: Aries Device Image + tier: 2 + machine: + platform: b2g-device-image + locations: + img: 'private/build/aries.zip' diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_opt.yml b/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_opt.yml new file mode 100644 index 000000000000..fb56e8c674af --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_opt.yml @@ -0,0 +1,41 @@ +$inherits: + from: 'tasks/builds/b2g_phone_base.yml' + variables: + build_name: 'aries' + build_type: 'opt' +task: + workerType: flame-kk + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-aries-opt' + - 'docker-worker:cache:level-{{level}}-{{project}}-build-aries-opt-objdir-gecko' + metadata: + name: '[TC] B2G Aries Opt' + + payload: + cache: + level-{{level}}-{{project}}-build-aries-opt: /home/worker/workspace + level-{{level}}-{{project}}-build-aries-opt-objdir-gecko: /home/worker/objdir-gecko + env: + TARGET: 'aries' + DEBUG: 0 + VARIANT: user + GAIA_OPTIMIZE: '1' + B2G_SYSTEM_APPS: '1' + MOZHARNESS_CONFIG: b2g/taskcluster-spark.py + command: + - > + checkout-gecko workspace && + cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder && + buildbot_step 'Build' ./build-phone.sh $HOME/workspace + extra: + treeherderEnv: + - production + - staging + treeherder: + symbol: B + groupSymbol: Aries + groupName: Aries Device Image + machine: + platform: b2g-device-image + locations: + img: 'private/build/aries.zip' diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_ota_balrog_debug.yml b/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_ota_balrog_debug.yml new file mode 100644 index 000000000000..5c892dbef42d --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_ota_balrog_debug.yml @@ -0,0 +1,6 @@ +$inherits: + from: 'tasks/builds/b2g_aries_spark_ota_debug.yml' +task: + payload: + env: + MOZHARNESS_CONFIG: b2g/taskcluster-spark-ota-balrog.py diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_ota_balrog_opt.yml b/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_ota_balrog_opt.yml new file mode 100644 index 000000000000..a2a7d1fd0fcb --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_ota_balrog_opt.yml @@ -0,0 +1,6 @@ +$inherits: + from: 'tasks/builds/b2g_aries_spark_ota_opt.yml' +task: + payload: + env: + MOZHARNESS_CONFIG: b2g/taskcluster-spark-ota-balrog.py diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_ota_base.yml b/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_ota_base.yml new file mode 100644 index 000000000000..96a1ecda8ce8 --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_ota_base.yml @@ -0,0 +1,25 @@ +$inherits: + from: 'tasks/builds/b2g_phone_base.yml' +task: + workerType: flame-kk + + payload: + env: + TARGET: 'aries' + DEBUG: 0 + MOZHARNESS_CONFIG: b2g/taskcluster-spark-ota.py + B2G_UPDATE_CHANNEL: '{{b2g_update_channel}}' + command: + - > + checkout-gecko workspace && + cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder && + buildbot_step 'Build' ./build-phone-ota.sh $HOME/workspace + + extra: + treeherder: + machine: + platform: b2g-device-image + locations: + img: 'private/build/aries.zip' + mar: 'public/build/b2g-aries-gecko-update.mar' + diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_ota_debug.yml b/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_ota_debug.yml new file mode 100644 index 000000000000..b0203e2e12e5 --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_ota_debug.yml @@ -0,0 +1,29 @@ +$inherits: + from: 'tasks/builds/b2g_aries_spark_ota_base.yml' + variables: + build_name: 'aries-ota' + build_type: 'debug' +task: + metadata: + name: '[TC] B2G Aries OTA (userdebug)' + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-aries-spark-ota-debug' + - 'docker-worker:cache:level-{{level}}-{{project}}-build-aries-spark-ota-debug-objdir-gecko' + payload: + cache: + level-{{level}}-{{project}}-build-aries-spark-ota-debug: /home/worker/workspace + level-{{level}}-{{project}}-build-aries-spark-ota-debug-objdir-gecko: /home/worker/objdir-gecko + env: + VARIANT: userdebug + B2G_DEBUG: 0 + extra: + treeherderEnv: + - staging + treeherder: + symbol: B + groupSymbol: Aries-Spark-OTA + groupName: Aries Device Image + machine: + platform: b2g-device-image + collection: + debug: true diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_ota_opt.yml b/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_ota_opt.yml new file mode 100644 index 000000000000..33e224b60068 --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_aries_spark_ota_opt.yml @@ -0,0 +1,26 @@ +$inherits: + from: 'tasks/builds/b2g_aries_spark_ota_base.yml' + variables: + build_name: 'aries-ota' + build_type: 'opt' +task: + metadata: + name: '[TC] B2G Aries OTA (user)' + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-aries-spark-ota-user' + - 'docker-worker:cache:level-{{level}}-{{project}}-build-aries-spark-ota-user-objdir-gecko' + payload: + cache: + level-{{level}}-{{project}}-build-aries-spark-ota-user: /home/worker/workspace + level-{{level}}-{{project}}-build-aries-spark-ota-user-objdir-gecko: /home/worker/objdir-gecko + env: + VARIANT: user + extra: + treeherderEnv: + - staging + treeherder: + symbol: B + groupSymbol: Aries-Spark-OTA + groupName: Aries Device Image + machine: + platform: b2g-device-image diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_dolphin_512_eng.yml b/testing/taskcluster/tasks/builds/legacy/b2g_dolphin_512_eng.yml new file mode 100644 index 000000000000..a2df9e4951fc --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_dolphin_512_eng.yml @@ -0,0 +1,26 @@ +$inherits: + from: 'tasks/builds/b2g_dolphin_base.yml' + variables: + build_name: 'dolphin-512-eng' + build_type: 'opt' +task: + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-dolphin-512-eng' + metadata: + name: '[TC] B2G Dolphin 512 Eng' + + extra: + treeherder: + symbol: Be + groupSymbol: Dolphin-512 + groupName: Dolphin 512 Device Image + machine: + platform: b2g-device-image + + payload: + cache: + level-{{level}}-{{project}}-build-dolphin-512-eng: /home/worker/workspace + env: + TARGET: 'dolphin-512' + VARIANT: eng + diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_dolphin_512_opt.yml b/testing/taskcluster/tasks/builds/legacy/b2g_dolphin_512_opt.yml new file mode 100644 index 000000000000..ec0340992d3d --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_dolphin_512_opt.yml @@ -0,0 +1,23 @@ +$inherits: + from: 'tasks/builds/b2g_dolphin_base.yml' + variables: + build_name: 'dolphin-512' + build_type: 'opt' +task: + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-dolphin-512-opt' + metadata: + name: '[TC] B2G Dolphin 512 Opt' + + extra: + treeherder: + groupSymbol: Dolphin-512 + groupName: Dolphin 512 Device Image + machine: + platform: b2g-device-image + + payload: + cache: + level-{{level}}-{{project}}-build-dolphin-512-opt: /home/worker/workspace + env: + TARGET: 'dolphin-512' diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_dolphin_base.yml b/testing/taskcluster/tasks/builds/legacy/b2g_dolphin_base.yml new file mode 100644 index 000000000000..2c177f9fc46b --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_dolphin_base.yml @@ -0,0 +1,31 @@ +$inherits: + from: 'tasks/phone_build.yml' +task: + workerType: dolphin + metadata: + description: | + Dolphin phones + b2g environment used in full stack testing. + payload: + env: + REPO_TRACE: 1 + VARIANT: user + DEBUG: 0 + + # Dolphin could take more than one hours to build! + maxRunTime: 7200 + + command: + - > + checkout-gecko workspace && + cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder && + buildbot_step 'Build' ./build-dolphin.sh $HOME/workspace + + extra: + # Rather then enforcing particular conventions we require that all build + # tasks provide the "build" extra field to specify where the build and tests + # files are located. + locations: + build: 'private/build/b2g-android-arm.tar.gz' + tests: 'private/build/gaia.zip' + symbols: 'private/build/b2g-crashreporter-symbols.zip' + sources: 'private/build/sources.xml' diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_dolphin_eng.yml b/testing/taskcluster/tasks/builds/legacy/b2g_dolphin_eng.yml new file mode 100644 index 000000000000..481bc20f40ea --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_dolphin_eng.yml @@ -0,0 +1,25 @@ +$inherits: + from: 'tasks/builds/b2g_dolphin_base.yml' + variables: + build_name: 'dolphin-eng' + build_type: 'opt' +task: + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-dolphin-eng' + metadata: + name: '[TC] B2G Dolphin Eng' + + extra: + treeherder: + symbol: Be + groupSymbol: Dolphin + groupName: Dolphin Device Image + machine: + platform: b2g-device-image + + payload: + cache: + level-{{level}}-{{project}}-build-dolphin-eng: /home/worker/workspace + env: + TARGET: 'dolphin' + VARIANT: eng diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_dolphin_opt.yml b/testing/taskcluster/tasks/builds/legacy/b2g_dolphin_opt.yml new file mode 100644 index 000000000000..f02b6a747ee0 --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_dolphin_opt.yml @@ -0,0 +1,24 @@ +$inherits: + from: 'tasks/builds/b2g_dolphin_base.yml' + variables: + build_name: 'dolphin' + build_type: 'opt' +task: + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-dolphin-opt' + metadata: + name: '[TC] B2G Dolphin Opt' + + extra: + treeherder: + groupSymbol: Dolphin + groupName: Dolphin Device Image + machine: + platform: b2g-device-image + + payload: + cache: + level-{{level}}-{{project}}-build-dolphin-opt: /home/worker/workspace + env: + TARGET: 'dolphin' + diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_debug.yml b/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_debug.yml new file mode 100644 index 000000000000..fa961ba18312 --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_debug.yml @@ -0,0 +1,40 @@ +$inherits: + from: 'tasks/builds/b2g_phone_base.yml' + variables: + build_name: 'flame-kk' + build_type: 'debug' +task: + workerType: flame-kk + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-flame-kk-debug' + - 'docker-worker:cache:level-{{level}}-{{project}}-build-flame-kk-debug-objdir-gecko' + metadata: + name: '[TC] B2G Flame KK Debug' + + payload: + cache: + level-{{level}}-{{project}}-build-flame-kk-debug: /home/worker/workspace + level-{{level}}-{{project}}-build-flame-kk-debug-objdir-gecko: /home/worker/objdir-gecko + env: + TARGET: 'flame-kk' + DEBUG: 0 + VARIANT: userdebug + command: + - > + checkout-gecko workspace && + cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder && + buildbot_step 'Build' ./build-phone.sh $HOME/workspace + extra: + treeherderEnv: + - production + - staging + treeherder: + symbol: B + groupSymbol: Flame-KK + groupName: Flame KitKat Device Image + machine: + platform: b2g-device-image + collection: + debug: true + locations: + img: 'private/build/flame-kk.zip' diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_eng.yml b/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_eng.yml new file mode 100644 index 000000000000..885dfbb01de7 --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_eng.yml @@ -0,0 +1,30 @@ +$inherits: + from: 'tasks/builds/b2g_phone_eng_base.yml' + variables: + build_name: 'flame-kk-eng' + build_type: 'opt' +task: + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-flame-kk-eng' + - 'docker-worker:cache:level-{{level}}-{{project}}-build-flame-kk-eng-objdir-gecko' + metadata: + name: '[TC] B2G Flame KK Eng' + + payload: + cache: + level-{{level}}-{{project}}-build-flame-kk-eng: /home/worker/workspace + level-{{level}}-{{project}}-build-flame-kk-eng-objdir-gecko: /home/worker/objdir-gecko + env: + TARGET: 'flame-kk' + extra: + treeherderEnv: + - production + - staging + treeherder: + symbol: Be + groupSymbol: Flame-KK + groupName: Flame KitKat Device Image + machine: + platform: b2g-device-image + locations: + img: 'private/build/flame-kk.zip' diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_opt.yml b/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_opt.yml new file mode 100644 index 000000000000..de9faa24aa8f --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_opt.yml @@ -0,0 +1,37 @@ +$inherits: + from: 'tasks/builds/b2g_phone_base.yml' + variables: + build_name: 'flame-kk' + build_type: 'opt' +task: + workerType: flame-kk + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-flame-kk-opt' + - 'docker-worker:cache:level-{{level}}-{{project}}-build-flame-kk-opt-objdir-gecko' + metadata: + name: '[TC] B2G Flame KK Opt' + + payload: + cache: + level-{{level}}-{{project}}-build-flame-kk-opt: /home/worker/workspace + level-{{level}}-{{project}}-build-flame-kk-opt-objdir-gecko: /home/worker/objdir-gecko + env: + TARGET: 'flame-kk' + DEBUG: 0 + command: + - > + checkout-gecko workspace && + cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder && + buildbot_step 'Build' ./build-phone.sh $HOME/workspace + extra: + treeherderEnv: + - production + - staging + treeherder: + symbol: B + groupSymbol: Flame-KK + groupName: Flame KitKat Device Image + machine: + platform: b2g-device-image + locations: + img: 'private/build/flame-kk.zip' diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_ota_base.yml b/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_ota_base.yml new file mode 100644 index 000000000000..78df46b33af8 --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_ota_base.yml @@ -0,0 +1,19 @@ +$inherits: + from: 'tasks/builds/b2g_phone_base.yml' +task: + workerType: flame-kk + payload: + env: + TARGET: 'flame-kk' + DEBUG: 0 + command: + - > + checkout-gecko workspace && + cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder && + buildbot_step 'Build' ./build-phone-ota.sh $HOME/workspace + + extra: + locations: + img: 'private/build/flame-kk.zip' + mar: 'public/build/b2g-flame-gecko-update.mar' + diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_ota_debug.yml b/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_ota_debug.yml new file mode 100644 index 000000000000..c708cfb09721 --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_ota_debug.yml @@ -0,0 +1,32 @@ +$inherits: + from: 'tasks/builds/b2g_flame_kk_ota_base.yml' + variables: + build_name: 'flame-kk-ota' + build_type: 'debug' +task: + metadata: + name: '[TC] B2G Flame KK OTA (userdebug)' + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-flame-kk-ota-debug' + - 'docker-worker:cache:level-{{level}}-{{project}}-build-flame-kk-ota-debug-objdir-gecko' + + payload: + cache: + level-{{level}}-{{project}}-build-flame-kk-ota-debug: /home/worker/workspace + level-{{level}}-{{project}}-build-flame-kk-ota-debug-objdir-gecko: /home/worker/objdir-gecko + env: + VARIANT: userdebug + B2G_DEBUG: 0 + MOZHARNESS_CONFIG: b2g/taskcluster-phone-fota.py + B2G_UPDATE_CHANNEL: '{{b2g_update_channel}}' + extra: + treeherderEnv: + - staging + treeherder: + symbol: B + groupSymbol: Flame-KK-OTA + groupName: Flame KitKat Device Image + machine: + platform: b2g-device-image + collection: + debug: true diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_ota_opt.yml b/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_ota_opt.yml new file mode 100644 index 000000000000..d30e573bc12f --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_ota_opt.yml @@ -0,0 +1,29 @@ +$inherits: + from: 'tasks/builds/b2g_flame_kk_ota_base.yml' + variables: + build_name: 'flame-kk-ota' + build_type: 'opt' +task: + metadata: + name: '[TC] B2G Flame KK OTA (user)' + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-flame-kk-ota-user' + - 'docker-worker:cache:level-{{level}}-{{project}}-build-flame-kk-ota-user-objdir-gecko' + + payload: + cache: + level-{{level}}-{{project}}-build-flame-kk-ota-user: /home/worker/workspace + level-{{level}}-{{project}}-build-flame-kk-ota-user-objdir-gecko: /home/worker/objdir-gecko + env: + VARIANT: user + MOZHARNESS_CONFIG: b2g/taskcluster-phone-fota.py + B2G_UPDATE_CHANNEL: '{{b2g_update_channel}}' + extra: + treeherderEnv: + - staging + treeherder: + symbol: B + groupSymbol: Flame-KK-OTA + groupName: Flame KitKat Device Image + machine: + platform: b2g-device-image diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_spark_eng.yml b/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_spark_eng.yml new file mode 100644 index 000000000000..dbe9017ad219 --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_flame_kk_spark_eng.yml @@ -0,0 +1,30 @@ +$inherits: + from: 'tasks/builds/b2g_phone_eng_base.yml' + variables: + build_name: 'flame-kk-spark-eng' + build_type: 'opt' +task: + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-flame-kk-spark-eng' + - 'docker-worker:cache:level-{{level}}-{{project}}-build-flame-kk-spark-eng-objdir-gecko' + metadata: + name: '[TC] B2G Flame KK Eng (spark)' + + payload: + cache: + level-{{level}}-{{project}}-build-flame-kk-spark-eng: /home/worker/workspace + level-{{level}}-{{project}}-build-flame-kk-spark-eng-objdir-gecko: /home/worker/objdir-gecko + env: + TARGET: 'flame-kk' + MOZHARNESS_CONFIG: b2g/taskcluster-spark.py + extra: + treeherderEnv: + - staging + treeherder: + symbol: Be + groupSymbol: Flame-KK-spark + groupName: Flame KitKat Device Image + machine: + platform: b2g-device-image + locations: + img: 'private/build/flame-kk.zip' diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_hamachi_eng.yml b/testing/taskcluster/tasks/builds/legacy/b2g_hamachi_eng.yml new file mode 100644 index 000000000000..fe96ecad66f6 --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_hamachi_eng.yml @@ -0,0 +1,20 @@ +$inherits: + from: 'tasks/builds/b2g_phone_base.yml' + variables: + build_name: 'hamachi-eng' + build_type: 'opt' +task: + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-hamachi-eng' + metadata: + name: B2G Hamachi Eng + payload: + cache: + level-{{level}}-{{project}}-build-hamachi-eng: /home/worker/object-folder + env: + TARGET: 'hamachi' + DEBUG: 0 + VARIANT: 'eng' + extra: + locations: + img: 'private/build/hamachi.zip' diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_hamachi_user.yml b/testing/taskcluster/tasks/builds/legacy/b2g_hamachi_user.yml new file mode 100644 index 000000000000..cbb4ca9d55e1 --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_hamachi_user.yml @@ -0,0 +1,19 @@ +$inherits: + from: 'tasks/builds/b2g_phone_base.yml' + variables: + build_name: 'hamachi' + build_type: 'opt' +task: + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-hamachi-user' + metadata: + name: B2G Hamachi User + payload: + cache: + level-{{level}}-{{project}}-build-hamachi-user: /home/worker/object-folder + env: + TARGET: 'hamachi' + DEBUG: 0 + extra: + locations: + img: 'private/build/hamachi.zip' diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_helix_user.yml b/testing/taskcluster/tasks/builds/legacy/b2g_helix_user.yml new file mode 100644 index 000000000000..70dcf1524ea8 --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_helix_user.yml @@ -0,0 +1,19 @@ +$inherits: + from: 'tasks/builds/b2g_phone_base.yml' + variables: + build_name: 'helix' + build_type: 'opt' +task: + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-helix-user' + metadata: + name: B2G Helix User + payload: + cache: + level-{{level}}-{{project}}-build-helix-user: /home/worker/object-folder + env: + TARGET: 'helix' + DEBUG: 0 + extra: + locations: + img: 'private/build/helix.zip' diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_nexus_4_kk_eng.yml b/testing/taskcluster/tasks/builds/legacy/b2g_nexus_4_kk_eng.yml new file mode 100644 index 000000000000..e6568f0802be --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_nexus_4_kk_eng.yml @@ -0,0 +1,36 @@ +$inherits: + from: 'tasks/builds/b2g_phone_eng_base.yml' + variables: + build_name: 'nexus-4-kk-eng' + build_type: 'opt' +task: + workerType: flame-kk + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-nexus-4-kk-eng' + - 'docker-worker:cache:level-{{level}}-{{project}}-build-nexus-4-kk-eng-objdir-gecko' + metadata: + name: '[TC] B2G Nexus 4 KK Eng' + payload: + cache: + level-{{level}}-{{project}}-build-nexus-4-kk-eng: /home/worker/workspace + level-{{level}}-{{project}}-build-nexus-4-kk-eng-objdir-gecko: /home/worker/objdir-gecko + env: + TARGET: 'nexus-4-kk' + DEBUG: 0 + command: + - > + checkout-gecko workspace && + cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder && + buildbot_step 'Build' ./build-phone.sh $HOME/workspace + extra: + treeherderEnv: + - production + - staging + treeherder: + symbol: Be + groupSymbol: Nexus 4 KK + groupName: Nexus 4 Kitkat Device Image + machine: + platform: b2g-device-image + locations: + img: 'private/build/nexus-4-kk.zip' diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_nexus_4_kk_ota_debug.yml b/testing/taskcluster/tasks/builds/legacy/b2g_nexus_4_kk_ota_debug.yml new file mode 100644 index 000000000000..863d2aebe4fe --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_nexus_4_kk_ota_debug.yml @@ -0,0 +1,42 @@ +$inherits: + from: 'tasks/builds/b2g_phone_base.yml' + variables: + build_name: 'nexus-4-kk-ota' + build_type: 'debug' +task: + workerType: flame-kk + metadata: + name: '[TC] B2G Nexus 4 KK OTA (userdebug)' + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-nexus-4-kk-ota-debug' + - 'docker-worker:cache:level-{{level}}-{{project}}-build-nexus-4-kk-ota-debug-objdir-gecko' + + payload: + features: + cache: + level-{{level}}-{{project}}-build-nexus-4-kk-ota-debug: /home/worker/workspace + level-{{level}}-{{project}}-build-nexus-4-kk-ota-debug-objdir-gecko: /home/worker/objdir-gecko + env: + VARIANT: userdebug + B2G_DEBUG: 0 + TARGET: 'nexus-4-kk' + DEBUG: 0 + B2G_UPDATE_CHANNEL: '{{b2g_update_channel}}' + command: + - > + checkout-gecko workspace && + cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder && + buildbot_step 'Build' ./build-phone-ota.sh $HOME/workspace + extra: + locations: + img: 'private/build/nexus-4-kk.zip' + treeherderEnv: + - staging + treeherder: + symbol: B + groupSymbol: Nexus-4-KK-OTA + groupName: Nexus 4 KitKat Device Image + machine: + platform: b2g-device-image + collection: + debug: true diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_nexus_4_kk_user.yml b/testing/taskcluster/tasks/builds/legacy/b2g_nexus_4_kk_user.yml new file mode 100644 index 000000000000..7f61ed698d83 --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_nexus_4_kk_user.yml @@ -0,0 +1,36 @@ +$inherits: + from: 'tasks/builds/b2g_phone_base.yml' + variables: + build_name: 'nexus-4-kk-user' + build_type: 'opt' +task: + workerType: flame-kk + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-nexus-4-kk-user' + - 'docker-worker:cache:level-{{level}}-{{project}}-build-nexus-4-kk-user-objdir-gecko' + metadata: + name: '[TC] B2G Nexus 4 KK User' + payload: + cache: + level-{{level}}-{{project}}-build-nexus-4-kk-user: /home/worker/workspace + level-{{level}}-{{project}}-build-nexus-4-kk-user-objdir-gecko: /home/worker/objdir-gecko + env: + TARGET: 'nexus-4-kk' + DEBUG: 0 + command: + - > + checkout-gecko workspace && + cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder && + buildbot_step 'Build' ./build-phone.sh $HOME/workspace + extra: + treeherderEnv: + - production + - staging + treeherder: + symbol: B + groupSymbol: Nexus 4 KK + groupName: Nexus 4 Kitkat Device Image + machine: + platform: b2g-device-image + locations: + img: 'private/build/nexus-4-kk.zip' diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_nexus_5l_ota_debug.yml b/testing/taskcluster/tasks/builds/legacy/b2g_nexus_5l_ota_debug.yml new file mode 100644 index 000000000000..f5c6c22aaa62 --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_nexus_5l_ota_debug.yml @@ -0,0 +1,43 @@ +$inherits: + from: 'tasks/builds/b2g_phone_base.yml' + variables: + build_name: 'nexus-5-l-ota' + build_type: 'debug' +task: + workerType: flame-kk + metadata: + name: '[TC] B2G Nexus 5L OTA (userdebug)' + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-nexus-5l-ota-debug' + - 'docker-worker:cache:level-{{level}}-{{project}}-build-nexus-5l-ota-debug-objdir-gecko' + + payload: + features: + cache: + level-{{level}}-{{project}}-build-nexus-5l-ota-debug: /home/worker/workspace + level-{{level}}-{{project}}-build-nexus-5l-ota-debug-objdir-gecko: /home/worker/objdir-gecko + env: + VARIANT: userdebug + B2G_DEBUG: 0 + TARGET: 'nexus-5-l' + DEBUG: 0 + MOZHARNESS_CONFIG: b2g/taskcluster-phone-fota.py + B2G_UPDATE_CHANNEL: '{{b2g_update_channel}}' + command: + - > + checkout-gecko workspace && + cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder && + buildbot_step 'Build' ./build-phone-ota.sh $HOME/workspace + extra: + locations: + img: 'private/build/nexus-5-l.zip' + treeherderEnv: + - staging + treeherder: + symbol: B + groupSymbol: Nexus-5L-OTA + groupName: Nexus 5 Lollipop Device Image + machine: + platform: b2g-device-image + collection: + debug: true diff --git a/testing/taskcluster/tasks/builds/legacy/b2g_nexus_5l_user.yml b/testing/taskcluster/tasks/builds/legacy/b2g_nexus_5l_user.yml new file mode 100644 index 000000000000..8ff7ac29c4db --- /dev/null +++ b/testing/taskcluster/tasks/builds/legacy/b2g_nexus_5l_user.yml @@ -0,0 +1,37 @@ +$inherits: + from: 'tasks/builds/b2g_phone_base.yml' + variables: + build_name: 'nexus-5-user' + build_type: 'opt' +task: + workerType: flame-kk + scopes: + - 'docker-worker:cache:level-{{level}}-{{project}}-build-nexus-5-l-user' + - 'docker-worker:cache:level-{{level}}-{{project}}-build-nexus-5-l-user-objdir-gecko' + metadata: + name: '[TC] B2G Nexus 5-L User' + + payload: + cache: + level-{{level}}-{{project}}-build-nexus-5-l-user: /home/worker/object-folder + level-{{level}}-{{project}}-build-nexus-5-l-user-objdir-gecko: /home/worker/objdir-gecko + env: + TARGET: 'nexus-5-l' + DEBUG: 0 + command: + - > + checkout-gecko workspace && + cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder && + buildbot_step 'Build' ./build-phone.sh $HOME/workspace + extra: + treeherderEnv: + - production + - staging + treeherder: + symbol: B + groupSymbol: Nexus 5-L + groupName: Nexus 5-L Device Image + machine: + platform: b2g-device-image + locations: + img: 'private/build/nexus-5-l.zip' diff --git a/testing/taskcluster/tasks/builds/mulet_linux.yml b/testing/taskcluster/tasks/builds/mulet_linux.yml index 1ec899f80d44..01cb29e16f64 100644 --- a/testing/taskcluster/tasks/builds/mulet_linux.yml +++ b/testing/taskcluster/tasks/builds/mulet_linux.yml @@ -54,5 +54,5 @@ task: # tasks provide the "build" extra field to specify where the build and tests # files are located. locations: - build: 'public/build/target.linux-x86_64.tar.bz2' + build: 'public/build/target.tar.bz2' test_packages: 'public/build/target.test_packages.json' diff --git a/toolkit/components/extensions/Extension.jsm b/toolkit/components/extensions/Extension.jsm index a1d75a5fbb95..2e722977c39f 100644 --- a/toolkit/components/extensions/Extension.jsm +++ b/toolkit/components/extensions/Extension.jsm @@ -671,34 +671,16 @@ ExtensionData.prototype = { }); }, - // Reads the extension's |manifest.json| file and optional |mozilla.json|, - // and stores the parsed and merged contents in |this.manifest|. + // Reads the extension's |manifest.json| file, and stores its + // parsed contents in |this.manifest|. readManifest() { return Promise.all([ this.readJSON("manifest.json"), - this.readJSON("mozilla.json").catch(err => null), Management.lazyInit(), - ]).then(([manifest, mozManifest]) => { + ]).then(([manifest]) => { this.manifest = manifest; this.rawManifest = manifest; - if (mozManifest) { - if (typeof mozManifest != "object") { - this.logger.warn(`Loading extension '${this.id}': mozilla.json has unexpected type ${typeof mozManifest}`); - } else { - Object.keys(mozManifest).forEach(key => { - if (key != "applications") { - throw new Error(`Illegal property "${key}" in mozilla.json`); - } - if (key in manifest) { - this.logger.warn(`Ignoring property "${key}" from mozilla.json`); - } else { - manifest[key] = mozManifest[key]; - } - }); - } - } - if (manifest && manifest.default_locale) { return this.initLocale(); } diff --git a/toolkit/components/extensions/ExtensionContent.jsm b/toolkit/components/extensions/ExtensionContent.jsm index c5a11df3439d..73f2c356d3f4 100644 --- a/toolkit/components/extensions/ExtensionContent.jsm +++ b/toolkit/components/extensions/ExtensionContent.jsm @@ -120,7 +120,7 @@ var api = context => { i18n: { getMessage: function(messageName, substitutions) { - return context.extension.localizeMessage(messageName, substitutions); + return context.extension.localizeMessage(messageName, substitutions, {cloneScope: context.cloneScope}); }, getAcceptLanguages: function(callback) { diff --git a/toolkit/components/extensions/ExtensionUtils.jsm b/toolkit/components/extensions/ExtensionUtils.jsm index 2e6bdf62dfd7..9c49bede08bc 100644 --- a/toolkit/components/extensions/ExtensionUtils.jsm +++ b/toolkit/components/extensions/ExtensionUtils.jsm @@ -317,6 +317,7 @@ function LocaleData(data) { this.defaultLocale = data.defaultLocale; this.selectedLocale = data.selectedLocale; this.locales = data.locales || new Map(); + this.warnedMissingKeys = new Set(); // Map(locale-name -> Map(message-key -> localized-string)) // @@ -348,8 +349,16 @@ LocaleData.prototype = { }, // https://developer.chrome.com/extensions/i18n - localizeMessage(message, substitutions = [], locale = this.selectedLocale, defaultValue = "??") { - let locales = new Set([this.BUILTIN, locale, this.defaultLocale] + localizeMessage(message, substitutions = [], options = {}) { + let defaultOptions = { + locale: this.selectedLocale, + defaultValue: "", + cloneScope: null, + }; + + options = Object.assign(defaultOptions, options); + + let locales = new Set([this.BUILTIN, options.locale, this.defaultLocale] .filter(locale => this.messages.has(locale))); // Message names are case-insensitive, so normalize them to lower-case. @@ -398,8 +407,15 @@ LocaleData.prototype = { } } - Cu.reportError(`Unknown localization message ${message}`); - return defaultValue; + if (!this.warnedMissingKeys.has(message)) { + let error = `Unknown localization message ${message}`; + if (options.cloneScope) { + error = new options.cloneScope.Error(error); + } + Cu.reportError(error); + this.warnedMissingKeys.add(message); + } + return options.defaultValue; }, // Localize a string, replacing all |__MSG_(.*)__| tokens with the @@ -414,7 +430,7 @@ LocaleData.prototype = { } return str.replace(/__MSG_([A-Za-z0-9@_]+?)__/g, (matched, message) => { - return this.localizeMessage(message, [], locale, matched); + return this.localizeMessage(message, [], {locale, defaultValue: matched}); }); }, diff --git a/toolkit/components/extensions/ext-i18n.js b/toolkit/components/extensions/ext-i18n.js index daa214e08f2b..53961de2724e 100644 --- a/toolkit/components/extensions/ext-i18n.js +++ b/toolkit/components/extensions/ext-i18n.js @@ -11,7 +11,7 @@ extensions.registerSchemaAPI("i18n", null, (extension, context) => { return { i18n: { getMessage: function(messageName, substitutions) { - return extension.localizeMessage(messageName, substitutions); + return extension.localizeMessage(messageName, substitutions, {cloneScope: context.cloneScope}); }, getAcceptLanguages: function() { diff --git a/toolkit/components/extensions/ext-webRequest.js b/toolkit/components/extensions/ext-webRequest.js index ac8555855965..d31cf779f5bc 100644 --- a/toolkit/components/extensions/ext-webRequest.js +++ b/toolkit/components/extensions/ext-webRequest.js @@ -34,6 +34,7 @@ function WebRequestEventManager(context, eventName) { let data2 = { requestId: data.requestId, url: data.url, + originUrl: data.originUrl, method: data.method, type: data.type, timeStamp: Date.now(), diff --git a/toolkit/components/extensions/test/mochitest/file_WebRequest_page1.html b/toolkit/components/extensions/test/mochitest/file_WebRequest_page1.html index 019eb77e545f..6477565fbcc4 100644 --- a/toolkit/components/extensions/test/mochitest/file_WebRequest_page1.html +++ b/toolkit/components/extensions/test/mochitest/file_WebRequest_page1.html @@ -28,5 +28,16 @@ +link +
+ diff --git a/toolkit/components/extensions/test/mochitest/file_WebRequest_page3.html b/toolkit/components/extensions/test/mochitest/file_WebRequest_page3.html new file mode 100644 index 000000000000..5807dd439f24 --- /dev/null +++ b/toolkit/components/extensions/test/mochitest/file_WebRequest_page3.html @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/toolkit/components/extensions/test/mochitest/mochitest.ini b/toolkit/components/extensions/test/mochitest/mochitest.ini index 22cb5c771c01..adceb6b4a887 100644 --- a/toolkit/components/extensions/test/mochitest/mochitest.ini +++ b/toolkit/components/extensions/test/mochitest/mochitest.ini @@ -4,6 +4,7 @@ support-files = head.js file_WebRequest_page1.html file_WebRequest_page2.html + file_WebRequest_page3.html file_WebNavigation_page1.html file_WebNavigation_page2.html file_WebNavigation_page3.html diff --git a/toolkit/components/extensions/test/mochitest/test_ext_i18n.html b/toolkit/components/extensions/test/mochitest/test_ext_i18n.html index 45c47abd2da3..06e73ad5ad92 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_i18n.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_i18n.html @@ -28,10 +28,10 @@ add_task(function* test_i18n() { assertEq("(bar)", _("bar"), "Simple message fallback in default locale."); - assertEq("??", _("some-unknown-locale-string"), "Unknown locale string."); + assertEq("", _("some-unknown-locale-string"), "Unknown locale string."); - assertEq("??", _("@@unknown_builtin_string"), "Unknown built-in string."); - assertEq("??", _("@@bidi_unknown_builtin_string"), "Unknown built-in bidi string."); + assertEq("", _("@@unknown_builtin_string"), "Unknown built-in string."); + assertEq("", _("@@bidi_unknown_builtin_string"), "Unknown built-in bidi string."); assertEq("Føo.", _("Föo"), "Multi-byte message in selected locale."); diff --git a/toolkit/components/extensions/test/mochitest/test_ext_webrequest.html b/toolkit/components/extensions/test/mochitest/test_ext_webrequest.html index 6fa864aced95..9883d563ad29 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest.html @@ -98,7 +98,8 @@ function backgroundScript() { let savedTabId = -1; function shouldRecord(url) { - return url.startsWith(BASE) || /^data:.*\bwebRequestTest|\/invalid\./.test(url); + return url.startsWith(BASE) && !url.includes("_page3.html") || + /^data:.*\bwebRequestTest|\/invalid\./.test(url); } let statuses = [ @@ -115,6 +116,12 @@ function backgroundScript() { } } + function checkOrigin(details) { + let isCorrectOrigin = details.url.includes("_page1.html") ? details.originUrl.endsWith("/test_ext_webrequest.html") + : /\/file_WebRequest_page\d\.html\b/.test(details.originUrl); + browser.test.assertTrue(isCorrectOrigin, `originUrl for ${details.url} is correct (${details.originUrl})`); + } + function checkType(details) { let expected_type = "???"; if (details.url.includes("style")) { @@ -280,6 +287,7 @@ function backgroundScript() { requestIDs.set(details.url, new Set([details.requestId])); } checkResourceType(details.type); + checkOrigin(details); if (shouldRecord(details.url)) { recorded.requested.push(details.url); @@ -311,6 +319,7 @@ function backgroundScript() { function onBeforeSendHeaders(details) { browser.test.log(`onBeforeSendHeaders ${details.url}`); checkRequestId(details); + checkOrigin(details); checkResourceType(details.type); processHeaders("request", details); if (shouldRecord(details.url)) { @@ -331,6 +340,7 @@ function backgroundScript() { function onBeforeRedirect(details) { browser.test.log(`onBeforeRedirect ${details.url} -> ${details.redirectUrl}`); checkRequestId(details, "redirect"); + checkOrigin(details); checkResourceType(details.type); if (shouldRecord(details.url)) { recorded.beforeRedirect.push(details.url); @@ -354,6 +364,7 @@ function backgroundScript() { browser.test.log(`${kind} ${details.requestId} ${details.url}`); checkResourceType(details.type); checkRequestId(details, kind); + checkOrigin(details); if (kind in recorded && shouldRecord(details.url)) { recorded[kind].push(details.url); } diff --git a/toolkit/components/maintenanceservice/workmonitor.cpp b/toolkit/components/maintenanceservice/workmonitor.cpp index d0b214b8cc8b..3b9547ede921 100644 --- a/toolkit/components/maintenanceservice/workmonitor.cpp +++ b/toolkit/components/maintenanceservice/workmonitor.cpp @@ -30,7 +30,7 @@ static const int TIME_TO_WAIT_ON_UPDATER = 15 * 60 * 1000; wchar_t* MakeCommandLine(int argc, wchar_t** argv); BOOL WriteStatusFailure(LPCWSTR updateDirPath, int errorCode); -BOOL PathGetSiblingFilePath(LPWSTR destinationBuffer, LPCWSTR siblingFilePath, +BOOL PathGetSiblingFilePath(LPWSTR destinationBuffer, LPCWSTR siblingFilePath, LPCWSTR newFileName); /* @@ -479,79 +479,6 @@ ProcessSoftwareUpdateCommand(DWORD argc, LPWSTR *argv) return result; } -/** - * Obtains the updater path alongside a subdir of the service binary. - * The purpose of this function is to return a path that is likely high - * integrity and therefore more safe to execute code from. - * - * @param serviceUpdaterPath Out parameter for the path where the updater - * should be copied to. - * @return TRUE if a file path was obtained. - */ -BOOL -GetSecureUpdaterPath(WCHAR serviceUpdaterPath[MAX_PATH + 1]) -{ - if (!GetModuleFileNameW(nullptr, serviceUpdaterPath, MAX_PATH)) { - LOG_WARN(("Could not obtain module filename when attempting to " - "use a secure updater path. (%d)", GetLastError())); - return FALSE; - } - - if (!PathRemoveFileSpecW(serviceUpdaterPath)) { - LOG_WARN(("Couldn't remove file spec when attempting to use a secure " - "updater path. (%d)", GetLastError())); - return FALSE; - } - - if (!PathAppendSafe(serviceUpdaterPath, L"update")) { - LOG_WARN(("Couldn't append file spec when attempting to use a secure " - "updater path. (%d)", GetLastError())); - return FALSE; - } - - CreateDirectoryW(serviceUpdaterPath, nullptr); - - if (!PathAppendSafe(serviceUpdaterPath, L"updater.exe")) { - LOG_WARN(("Couldn't append file spec when attempting to use a secure " - "updater path. (%d)", GetLastError())); - return FALSE; - } - - return TRUE; -} - -/** - * Deletes the passed in updater path and the associated updater.ini file. - * - * @param serviceUpdaterPath The path to delete. - * @return TRUE if a file was deleted. - */ -BOOL -DeleteSecureUpdater(WCHAR serviceUpdaterPath[MAX_PATH + 1]) -{ - BOOL result = FALSE; - if (serviceUpdaterPath[0]) { - result = DeleteFileW(serviceUpdaterPath); - if (!result && GetLastError() != ERROR_PATH_NOT_FOUND && - GetLastError() != ERROR_FILE_NOT_FOUND) { - LOG_WARN(("Could not delete service updater path: '%ls'.", - serviceUpdaterPath)); - } - - WCHAR updaterINIPath[MAX_PATH + 1] = { L'\0' }; - if (PathGetSiblingFilePath(updaterINIPath, serviceUpdaterPath, - L"updater.ini")) { - result = DeleteFileW(updaterINIPath); - if (!result && GetLastError() != ERROR_PATH_NOT_FOUND && - GetLastError() != ERROR_FILE_NOT_FOUND) { - LOG_WARN(("Could not delete service updater INI path: '%ls'.", - updaterINIPath)); - } - } - } - return result; -} - /** * Executes a service command. * @@ -584,52 +511,7 @@ ExecuteServiceCommand(int argc, LPWSTR *argv) BOOL result = FALSE; if (!lstrcmpi(argv[2], L"software-update")) { - - // Use the passed in command line arguments for the update, except for the - // path to updater.exe. We copy updater.exe to a the directory of the - // MozillaMaintenance service so that a low integrity process cannot - // replace the updater.exe at any point and use that for the update. - // It also makes DLL injection attacks harder. - LPWSTR oldUpdaterPath = argv[3]; - WCHAR secureUpdaterPath[MAX_PATH + 1] = { L'\0' }; - result = GetSecureUpdaterPath(secureUpdaterPath); // Does its own logging - if (result) { - LOG(("Passed in path: '%ls'; Using this path for updating: '%ls'.", - oldUpdaterPath, secureUpdaterPath)); - DeleteSecureUpdater(secureUpdaterPath); - result = CopyFileW(oldUpdaterPath, secureUpdaterPath, FALSE); - } - - if (!result) { - LOG_WARN(("Could not copy path to secure location. (%d)", - GetLastError())); - if (argc > 4 && !WriteStatusFailure(argv[4], - SERVICE_COULD_NOT_COPY_UPDATER)) { - LOG_WARN(("Could not write update.status could not copy updater error")); - } - } else { - - // We obtained the path and copied it successfully, update the path to - // use for the service update. - argv[3] = secureUpdaterPath; - - WCHAR oldUpdaterINIPath[MAX_PATH + 1] = { L'\0' }; - WCHAR secureUpdaterINIPath[MAX_PATH + 1] = { L'\0' }; - if (PathGetSiblingFilePath(secureUpdaterINIPath, secureUpdaterPath, - L"updater.ini") && - PathGetSiblingFilePath(oldUpdaterINIPath, oldUpdaterPath, - L"updater.ini")) { - // This is non fatal if it fails there is no real harm - if (!CopyFileW(oldUpdaterINIPath, secureUpdaterINIPath, FALSE)) { - LOG_WARN(("Could not copy updater.ini from: '%ls' to '%ls'. (%d)", - oldUpdaterINIPath, secureUpdaterINIPath, GetLastError())); - } - } - - result = ProcessSoftwareUpdateCommand(argc - 3, argv + 3); - DeleteSecureUpdater(secureUpdaterPath); - } - + result = ProcessSoftwareUpdateCommand(argc - 3, argv + 3); // We might not reach here if the service install succeeded // because the service self updates itself and the service // installer will stop the service. diff --git a/toolkit/components/passwordmgr/test/mochitest.ini b/toolkit/components/passwordmgr/test/mochitest.ini index 42c68db83fbd..3d1471ebfe9e 100644 --- a/toolkit/components/passwordmgr/test/mochitest.ini +++ b/toolkit/components/passwordmgr/test/mochitest.ini @@ -20,8 +20,6 @@ support-files = [test_basic_form_2pw_2.html] [test_basic_form_autocomplete.html] skip-if = toolkit == 'android' # Bug 1258975 on android. -[test_bug_627616.html] -skip-if = toolkit == 'android' # Bug 1258975 on android. [test_master_password.html] skip-if = toolkit == 'android' # Bug 1258975 on android. [test_master_password_cleanup.html] diff --git a/toolkit/components/passwordmgr/test/mochitest/mochitest.ini b/toolkit/components/passwordmgr/test/mochitest/mochitest.ini index cc20643ebe34..79aab4abde73 100644 --- a/toolkit/components/passwordmgr/test/mochitest/mochitest.ini +++ b/toolkit/components/passwordmgr/test/mochitest/mochitest.ini @@ -17,6 +17,8 @@ support-files = [test_basic_form_html5.html] [test_basic_form_pwevent.html] [test_basic_form_pwonly.html] +[test_bug_627616.html] +skip-if = toolkit == 'android' # Bug 1258975 on android. [test_bug_776171.html] [test_case_differences.html] skip-if = toolkit == 'android' # autocomplete diff --git a/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html b/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html new file mode 100644 index 000000000000..05e6ba0abe5b --- /dev/null +++ b/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html @@ -0,0 +1,151 @@ + + + + + Test bug 627616 related to proxy authentication + + + + + + + + diff --git a/toolkit/components/passwordmgr/test/test_bug_627616.html b/toolkit/components/passwordmgr/test/test_bug_627616.html deleted file mode 100644 index 4e216ce933b3..000000000000 --- a/toolkit/components/passwordmgr/test/test_bug_627616.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - Test bug 627616 related to proxy authentication - - - - - - - - diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 57c43f941762..565d3a4bab1e 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -5259,13 +5259,6 @@ "description": "Time for a URL bar DB search to return (ms)", "cpp_guard": "ANDROID" }, - "FENNEC_GECKOAPP_STARTUP_ACTION": { - "expires_in_version": "never", - "kind": "enumerated", - "n_values": 10, - "description": "The way the GeckoApp was launched. (Normal, URL, Prefetch, WebApp, Guest, Restricted, Shortcut)", - "cpp_guard": "ANDROID" - }, "FENNEC_RESTRICTED_PROFILE_RESTRICTIONS": { "expires_in_version": "50", "kind": "enumerated", @@ -9320,23 +9313,6 @@ "n_buckets": 10, "description": "The number of tabs queued when opened." }, - "FENNEC_TABQUEUE_PROMPT_ENABLE_YES" : { - "expires_in_version": "never", - "kind": "enumerated", - "n_values": 3, - "description": "The number of times the tab queue prompt was seen before the user selected YES." - }, - "FENNEC_TABQUEUE_PROMPT_ENABLE_NO" : { - "expires_in_version": "never", - "kind": "enumerated", - "n_values": 3, - "description": "The number of times the tab queue prompt was seen before the user selected NO." - }, - "FENNEC_TABQUEUE_ENABLED": { - "expires_in_version": "never", - "kind": "boolean", - "description": "Has the tab queue functionality been enabled." - }, "FENNEC_CUSTOM_HOMEPAGE": { "expires_in_version": "50", "alert_emails": ["mobile-frontend@mozilla.com"], diff --git a/toolkit/modules/addons/WebRequest.jsm b/toolkit/modules/addons/WebRequest.jsm index 4f5707d28608..42a8f8f4a407 100644 --- a/toolkit/modules/addons/WebRequest.jsm +++ b/toolkit/modules/addons/WebRequest.jsm @@ -125,6 +125,7 @@ var ContentPolicyManager = { receiveMessage(msg) { let browser = msg.target instanceof Ci.nsIDOMXULElement ? msg.target : null; + let requestId = RequestId.create(); for (let id of msg.data.ids) { let callback = this.policies.get(id); if (!callback) { @@ -134,14 +135,8 @@ var ContentPolicyManager = { } let response = null; let listenerKind = "onStop"; - let data = { - url: msg.data.url, - windowId: msg.data.windowId, - parentWindowId: msg.data.parentWindowId, - type: msg.data.type, - browser: browser, - requestId: RequestId.create(), - }; + let data = Object.assign({requestId, browser}, msg.data); + delete data.ids; try { response = callback(data); if (response) { @@ -515,32 +510,51 @@ HttpObserverManager = { kind === "onStart" || kind === "onStop"; + let commonData = null; + let uri = channel.URI; for (let [callback, opts] of listeners.entries()) { - if (!this.shouldRunListener(policyType, channel.URI, opts.filter)) { + if (!this.shouldRunListener(policyType, uri, opts.filter)) { continue; } - let data = { - requestId: RequestId.get(channel), - url: channel.URI.spec, - method: channel.requestMethod, - browser: browser, - type: WebRequestCommon.typeForPolicyType(policyType), - windowId: loadInfo ? loadInfo.outerWindowID : 0, - parentWindowId: loadInfo ? loadInfo.parentOuterWindowID : 0, - }; + if (!commonData) { + commonData = { + requestId: RequestId.get(channel), + url: uri.spec, + method: channel.requestMethod, + browser: browser, + type: WebRequestCommon.typeForPolicyType(policyType), + }; - let httpChannel = channel.QueryInterface(Ci.nsIHttpChannelInternal); - try { - data.ip = httpChannel.remoteAddress; - } catch (e) { - // The remoteAddress getter throws if the address is unavailable, - // but ip is an optional property so just ignore the exception. - } + if (loadInfo) { + let originPrincipal = loadInfo.triggeringPrincipal || loadInfo.loadingPrincipal; + if (originPrincipal && originPrincipal.URI) { + commonData.originUrl = originPrincipal.URI.spec; + } + Object.assign(commonData, { + windowId: loadInfo.outerWindowID, + parentWindowId: loadInfo.parentOuterWindowID, + }); + } else { + Object.assign(commonData, { + windowId: 0, + parentWindowId: 0, + }); + } - if (extraData) { - Object.assign(data, extraData); + if (channel instanceof Ci.nsIHttpChannelInternal) { + try { + commonData.ip = channel.remoteAddress; + } catch (e) { + // The remoteAddress getter throws if the address is unavailable, + // but ip is an optional property so just ignore the exception. + } + } + if (extraData) { + Object.assign(commonData, extraData); + } } + let data = Object.assign({}, commonData); if (opts.requestHeaders) { data.requestHeaders = this.getHeaders(channel, "visitRequestHeaders", kind); requestHeaderNames = data.requestHeaders.map(h => h.name); diff --git a/toolkit/modules/addons/WebRequestContent.js b/toolkit/modules/addons/WebRequestContent.js index fc947be199a6..193e44a04606 100644 --- a/toolkit/modules/addons/WebRequestContent.js +++ b/toolkit/modules/addons/WebRequestContent.js @@ -158,7 +158,9 @@ var ContentPolicy = { type: WebRequestCommon.typeForPolicyType(policyType), windowId, parentWindowId}; - + if (requestOrigin) { + data.originUrl = requestOrigin.spec; + } if (block) { let rval = mm.sendSyncMessage("WebRequest:ShouldLoad", data); if (rval.length == 1 && rval[0].cancel) { diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.jsm b/toolkit/mozapps/extensions/internal/XPIProvider.jsm index 98f805a68de4..66006488b589 100644 --- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm +++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm @@ -3381,9 +3381,11 @@ this.XPIProvider = { * @param aManifests * A dictionary to add new install manifests to to save having to * reload them later + * @param aAppChanged + * See checkForChanges * @return true if any new add-ons were installed */ - installDistributionAddons: function(aManifests) { + installDistributionAddons: function(aManifests, aAppChanged) { let distroDir; try { distroDir = FileUtils.getDir(KEY_APP_DISTRIBUTION, [DIR_EXTENSIONS]); @@ -3429,6 +3431,12 @@ this.XPIProvider = { continue; } + /* If this is not an upgrade and we've already handled this extension + * just continue */ + if (!aAppChanged && Preferences.isSet(PREF_BRANCH_INSTALLED_ADDON + id)) { + continue; + } + let addon; try { addon = syncLoadManifestFromFile(entry, profileLocation); @@ -3560,10 +3568,9 @@ this.XPIProvider = { } // If the application has changed then check for new distribution add-ons - if (aAppChanged !== false && - Preferences.get(PREF_INSTALL_DISTRO_ADDONS, true)) + if (Preferences.get(PREF_INSTALL_DISTRO_ADDONS, true)) { - updated = this.installDistributionAddons(manifests); + updated = this.installDistributionAddons(manifests, aAppChanged); if (updated) { updateReasons.push("installDistributionAddons"); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js index 095ea63e2d8b..9d5854718f3b 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js +++ b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js @@ -273,17 +273,16 @@ function createAppInfo(ID, name, version, platformVersion="1.0") { gAppInfo = tmp.getAppInfo(); } -function getManifestURIForBundle(file, manifest="manifest.json") { +function getManifestURIForBundle(file) { if (file.isDirectory()) { - let path = file.clone(); - path.append("install.rdf"); - if (path.exists()) { - return NetUtil.newURI(path); + file.append("install.rdf"); + if (file.exists()) { + return NetUtil.newURI(file); } - path.leafName = manifest; - if (path.exists()) { - return NetUtil.newURI(path); + file.leafName = "manifest.json"; + if (file.exists()) { + return NetUtil.newURI(file); } throw new Error("No manifest file present"); @@ -299,8 +298,8 @@ function getManifestURIForBundle(file, manifest="manifest.json") { return NetUtil.newURI("jar:" + uri.spec + "!/" + "install.rdf"); } - if (zip.hasEntry(manifest)) { - return NetUtil.newURI("jar:" + uri.spec + "!/" + manifest); + if (zip.hasEntry("manifest.json")) { + return NetUtil.newURI("jar:" + uri.spec + "!/" + "manifest.json"); } throw new Error("No manifest file present"); @@ -342,12 +341,8 @@ let getIDForManifest = Task.async(function*(manifestURI) { return rdfID.QueryInterface(AM_Ci.nsIRDFLiteral).Value; } else { - try { - let manifest = JSON.parse(data); - return manifest.applications.gecko.id; - } catch (err) { - return null; - } + let manifest = JSON.parse(data); + return manifest.applications.gecko.id; } }); @@ -385,15 +380,6 @@ function overrideCertDB(handler) { let id = yield getIDForManifest(manifestURI); - if (!id) { - manifestURI = getManifestURIForBundle(file, "mozilla.json"); - id = yield getIDForManifest(manifestURI); - } - - if (!id) { - throw new Error("Cannot find addon ID"); - } - // Make sure to close the open zip file or it will be locked. if (file.isFile()) { Services.obs.notifyObservers(file, "flush-cache-entry", "cert-override"); @@ -1126,7 +1112,7 @@ function writeInstallRDFForExtension(aData, aDir, aId, aExtraFile) { * An optional string to override the default installation aId * @return A file pointing to where the extension was installed */ -function writeWebManifestForExtension(aData, aDir, aId = undefined, aMozData = undefined) { +function writeWebManifestForExtension(aData, aDir, aId = undefined) { if (!aId) aId = aData.applications.gecko.id; @@ -1136,26 +1122,19 @@ function writeWebManifestForExtension(aData, aDir, aId = undefined, aMozData = u if (!dir.exists()) dir.create(AM_Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY); - function writeOne(filename, raw) { - let file = dir.clone(); - file.append(filename); - if (file.exists()) - file.remove(true); + let file = dir.clone(); + file.append("manifest.json"); + if (file.exists()) + file.remove(true); - let data = JSON.stringify(raw); - let fos = AM_Cc["@mozilla.org/network/file-output-stream;1"]. - createInstance(AM_Ci.nsIFileOutputStream); - fos.init(file, - FileUtils.MODE_WRONLY | FileUtils.MODE_CREATE | FileUtils.MODE_TRUNCATE, - FileUtils.PERMS_FILE, 0); - fos.write(data, data.length); - fos.close(); - } - - writeOne("manifest.json", aData); - if (aMozData) { - writeOne("mozilla.json", aMozData); - } + let data = JSON.stringify(aData); + let fos = AM_Cc["@mozilla.org/network/file-output-stream;1"]. + createInstance(AM_Ci.nsIFileOutputStream); + fos.init(file, + FileUtils.MODE_WRONLY | FileUtils.MODE_CREATE | FileUtils.MODE_TRUNCATE, + FileUtils.PERMS_FILE, 0); + fos.write(data, data.length); + fos.close(); return dir; } @@ -1171,13 +1150,6 @@ function writeWebManifestForExtension(aData, aDir, aId = undefined, aMozData = u zipW.open(file, FileUtils.MODE_WRONLY | FileUtils.MODE_CREATE | FileUtils.MODE_TRUNCATE); zipW.addEntryStream("manifest.json", 0, AM_Ci.nsIZipWriter.COMPRESSION_NONE, stream, false); - if (aMozData) { - let mozStream = AM_Cc["@mozilla.org/io/string-input-stream;1"]. - createInstance(AM_Ci.nsIStringInputStream); - mozStream.setData(JSON.stringify(aMozData), -1); - zipW.addEntryStream("mozilla.json", 0, AM_Ci.nsIZipWriter.COMPRESSION_NONE, - mozStream, false); - } zipW.close(); return file; diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_webextension.js b/toolkit/mozapps/extensions/test/xpcshell/test_webextension.js index c4bcee2f4c12..99a0ba8a6bce 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_webextension.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_webextension.js @@ -159,41 +159,6 @@ add_task(function*() { yield promiseRestartManager(); }); -// applications.gecko.id may be in mozilla.json -add_task(function* test_mozilla_json() { - writeWebManifestForExtension({ - name: "Web Extension Name", - version: "1.0", - manifest_version: 2, - }, profileDir, ID, { - applications: { - gecko: { - id: ID - } - } - }); - - yield promiseRestartManager(); - - let addon = yield promiseAddonByID(ID); - do_check_neq(addon, null); - do_check_eq(addon.version, "1.0"); - do_check_eq(addon.name, "Web Extension Name"); - do_check_true(addon.isCompatible); - do_check_false(addon.appDisabled); - do_check_true(addon.isActive); - do_check_false(addon.isSystem); - do_check_eq(addon.type, "extension"); - do_check_eq(addon.signedState, mozinfo.addon_signing ? AddonManager.SIGNEDSTATE_SIGNED : AddonManager.SIGNEDSTATE_NOT_REQUIRED); - - let file = getFileForAddon(profileDir, ID); - do_check_true(file.exists()); - - addon.uninstall(); - - yield promiseRestartManager(); -}); - add_task(function* test_manifest_localization() { const ID = "webextension3@tests.mozilla.org";