mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Merge m-c to autoland. a=merge
This commit is contained in:
commit
fbad48acb5
@ -296,13 +296,11 @@ services/sync/modules/constants.js
|
||||
services/sync/services-sync.js
|
||||
|
||||
# testing/ exclusions
|
||||
testing/firefox-ui/**
|
||||
testing/marionette/**
|
||||
testing/mochitest/**
|
||||
testing/modules/**
|
||||
testing/mozbase/**
|
||||
testing/profiles/**
|
||||
testing/specialpowers/**
|
||||
# octothorpe used for pref file comment causes parsing error
|
||||
testing/mozbase/mozprofile/tests/files/prefs_with_comments.js
|
||||
testing/talos/**
|
||||
testing/web-platform/**
|
||||
testing/xpcshell/moz-http2/**
|
||||
|
@ -32,7 +32,8 @@ TEST_DIRS += ['tests/mochitest']
|
||||
|
||||
BROWSER_CHROME_MANIFESTS += [
|
||||
'tests/browser/browser.ini',
|
||||
'tests/browser/e10s/browser.ini'
|
||||
'tests/browser/e10s/browser.ini',
|
||||
'tests/browser/states/browser.ini'
|
||||
]
|
||||
|
||||
with Files("**"):
|
||||
|
@ -1,6 +1,7 @@
|
||||
[DEFAULT]
|
||||
|
||||
support-files =
|
||||
events.js
|
||||
head.js
|
||||
shared-head.js
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
[DEFAULT]
|
||||
support-files =
|
||||
events.js
|
||||
head.js
|
||||
doc_treeupdate_ariadialog.html
|
||||
doc_treeupdate_ariaowns.html
|
||||
@ -8,6 +7,7 @@ support-files =
|
||||
doc_treeupdate_removal.xhtml
|
||||
doc_treeupdate_visibility.html
|
||||
doc_treeupdate_whitespace.html
|
||||
!/accessible/tests/browser/events.js
|
||||
!/accessible/tests/browser/shared-head.js
|
||||
!/accessible/tests/mochitest/*.js
|
||||
!/accessible/tests/mochitest/letters.gif
|
||||
|
@ -4,122 +4,12 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* exported addAccessibleTask, findAccessibleChildByID, isDefunct */
|
||||
|
||||
// Load the shared-head file first.
|
||||
/* import-globals-from ../shared-head.js */
|
||||
Services.scriptloader.loadSubScript(
|
||||
'chrome://mochitests/content/browser/accessible/tests/browser/shared-head.js',
|
||||
this);
|
||||
|
||||
/**
|
||||
* A wrapper around browser test add_task that triggers an accessible test task
|
||||
* as a new browser test task with given document, data URL or markup snippet.
|
||||
* @param {String} doc URL (relative to current directory) or
|
||||
* data URL or markup snippet that is used
|
||||
* to test content with
|
||||
* @param {Function|AsyncFunction} task a generator or a function with tests to
|
||||
* run
|
||||
*/
|
||||
function addAccessibleTask(doc, task) {
|
||||
add_task(async function() {
|
||||
let url;
|
||||
if (doc.includes('doc_')) {
|
||||
url = `${CURRENT_CONTENT_DIR}e10s/${doc}`;
|
||||
} else {
|
||||
// Assume it's a markup snippet.
|
||||
url = `data:text/html,
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Accessibility Test</title>
|
||||
</head>
|
||||
<body id="body">${doc}</body>
|
||||
</html>`;
|
||||
}
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
let observers = Services.obs.enumerateObservers('accessible-event');
|
||||
while (observers.hasMoreElements()) {
|
||||
Services.obs.removeObserver(
|
||||
observers.getNext().QueryInterface(Ci.nsIObserver),
|
||||
'accessible-event');
|
||||
}
|
||||
});
|
||||
|
||||
let onDocLoad = waitForEvent(EVENT_DOCUMENT_LOAD_COMPLETE, 'body');
|
||||
|
||||
await BrowserTestUtils.withNewTab({
|
||||
gBrowser,
|
||||
url: url
|
||||
}, async function(browser) {
|
||||
registerCleanupFunction(() => {
|
||||
if (browser) {
|
||||
let tab = gBrowser.getTabForBrowser(browser);
|
||||
if (tab && !tab.closing && tab.linkedBrowser) {
|
||||
gBrowser.removeTab(tab);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
await SimpleTest.promiseFocus(browser);
|
||||
|
||||
loadFrameScripts(browser,
|
||||
'let { document, window, navigator } = content;',
|
||||
{ name: 'common.js', dir: MOCHITESTS_DIR });
|
||||
|
||||
Logger.log(
|
||||
`e10s enabled: ${Services.appinfo.browserTabsRemoteAutostart}`);
|
||||
Logger.log(`Actually remote browser: ${browser.isRemoteBrowser}`);
|
||||
|
||||
let event = await onDocLoad;
|
||||
await task(browser, event.accessible);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an accessible object has a defunct test.
|
||||
* @param {nsIAccessible} accessible object to test defunct state for
|
||||
* @return {Boolean} flag indicating defunct state
|
||||
*/
|
||||
function isDefunct(accessible) {
|
||||
let defunct = false;
|
||||
try {
|
||||
let extState = {};
|
||||
accessible.getState({}, extState);
|
||||
defunct = extState.value & Ci.nsIAccessibleStates.EXT_STATE_DEFUNCT;
|
||||
} catch (x) {
|
||||
defunct = true;
|
||||
} finally {
|
||||
if (defunct) {
|
||||
Logger.log(`Defunct accessible: ${prettyName(accessible)}`);
|
||||
}
|
||||
}
|
||||
return defunct;
|
||||
}
|
||||
|
||||
/**
|
||||
* Traverses the accessible tree starting from a given accessible as a root and
|
||||
* looks for an accessible that matches based on its DOMNode id.
|
||||
* @param {nsIAccessible} accessible root accessible
|
||||
* @param {String} id id to look up accessible for
|
||||
* @return {nsIAccessible?} found accessible if any
|
||||
*/
|
||||
function findAccessibleChildByID(accessible, id) {
|
||||
if (getAccessibleDOMNodeID(accessible) === id) {
|
||||
return accessible;
|
||||
}
|
||||
for (let i = 0; i < accessible.children.length; ++i) {
|
||||
let found = findAccessibleChildByID(accessible.getChildAt(i), id);
|
||||
if (found) {
|
||||
return found;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Loading and common.js from accessible/tests/mochitest/ for all tests, as
|
||||
// well as events.js.
|
||||
/* import-globals-from ../../mochitest/common.js */
|
||||
/* import-globals-from events.js */
|
||||
loadScripts({ name: 'common.js', dir: MOCHITESTS_DIR }, 'e10s/events.js');
|
||||
loadScripts({ name: 'common.js', dir: MOCHITESTS_DIR }, 'events.js');
|
||||
|
@ -6,7 +6,8 @@
|
||||
|
||||
// This is loaded by head.js, so has the same globals, hence we import the
|
||||
// globals from there.
|
||||
/* import-globals-from head.js */
|
||||
/* import-globals-from shared-head.js */
|
||||
/* import-globals-from ../mochitest/common.js */
|
||||
|
||||
/* exported EVENT_REORDER, EVENT_SHOW, EVENT_TEXT_INSERTED, EVENT_TEXT_REMOVED,
|
||||
EVENT_DOCUMENT_LOAD_COMPLETE, EVENT_HIDE, EVENT_TEXT_CARET_MOVED,
|
@ -110,7 +110,7 @@ function shutdownPromise(contentBrowser) {
|
||||
|
||||
/**
|
||||
* Simpler verions of waitForEvent defined in
|
||||
* accessible/tests/browser/e10s/events.js
|
||||
* accessible/tests/browser/events.js
|
||||
*/
|
||||
function waitForEvent(eventType, expectedId) {
|
||||
return new Promise(resolve => {
|
||||
|
@ -4,8 +4,12 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* import-globals-from ../mochitest/common.js */
|
||||
/* import-globals-from events.js */
|
||||
|
||||
/* exported Logger, MOCHITESTS_DIR, invokeSetAttribute, invokeFocus,
|
||||
invokeSetStyle, getAccessibleDOMNodeID,
|
||||
addAccessibleTask, findAccessibleChildByID, isDefunct,
|
||||
CURRENT_CONTENT_DIR, loadScripts, loadFrameScripts, Cc, Cu */
|
||||
|
||||
const { interfaces: Ci, utils: Cu, classes: Cc } = Components;
|
||||
@ -187,3 +191,109 @@ function loadFrameScripts(browser, ...scripts) {
|
||||
mm.loadFrameScript(frameScript, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A wrapper around browser test add_task that triggers an accessible test task
|
||||
* as a new browser test task with given document, data URL or markup snippet.
|
||||
* @param {String} doc URL (relative to current directory) or
|
||||
* data URL or markup snippet that is used
|
||||
* to test content with
|
||||
* @param {Function|AsyncFunction} task a generator or a function with tests to
|
||||
* run
|
||||
*/
|
||||
function addAccessibleTask(doc, task) {
|
||||
add_task(async function() {
|
||||
let url;
|
||||
if (doc.includes('doc_')) {
|
||||
url = `${CURRENT_CONTENT_DIR}e10s/${doc}`;
|
||||
} else {
|
||||
// Assume it's a markup snippet.
|
||||
url = `data:text/html,
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Accessibility Test</title>
|
||||
</head>
|
||||
<body id="body">${doc}</body>
|
||||
</html>`;
|
||||
}
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
let observers = Services.obs.enumerateObservers('accessible-event');
|
||||
while (observers.hasMoreElements()) {
|
||||
Services.obs.removeObserver(
|
||||
observers.getNext().QueryInterface(Ci.nsIObserver),
|
||||
'accessible-event');
|
||||
}
|
||||
});
|
||||
|
||||
let onDocLoad = waitForEvent(EVENT_DOCUMENT_LOAD_COMPLETE, 'body');
|
||||
|
||||
await BrowserTestUtils.withNewTab({
|
||||
gBrowser,
|
||||
url: url
|
||||
}, async function(browser) {
|
||||
registerCleanupFunction(() => {
|
||||
if (browser) {
|
||||
let tab = gBrowser.getTabForBrowser(browser);
|
||||
if (tab && !tab.closing && tab.linkedBrowser) {
|
||||
gBrowser.removeTab(tab);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
await SimpleTest.promiseFocus(browser);
|
||||
|
||||
loadFrameScripts(browser,
|
||||
'let { document, window, navigator } = content;',
|
||||
{ name: 'common.js', dir: MOCHITESTS_DIR });
|
||||
|
||||
Logger.log(
|
||||
`e10s enabled: ${Services.appinfo.browserTabsRemoteAutostart}`);
|
||||
Logger.log(`Actually remote browser: ${browser.isRemoteBrowser}`);
|
||||
|
||||
let event = await onDocLoad;
|
||||
await task(browser, event.accessible);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an accessible object has a defunct test.
|
||||
* @param {nsIAccessible} accessible object to test defunct state for
|
||||
* @return {Boolean} flag indicating defunct state
|
||||
*/
|
||||
function isDefunct(accessible) {
|
||||
let defunct = false;
|
||||
try {
|
||||
let extState = {};
|
||||
accessible.getState({}, extState);
|
||||
defunct = extState.value & Ci.nsIAccessibleStates.EXT_STATE_DEFUNCT;
|
||||
} catch (x) {
|
||||
defunct = true;
|
||||
} finally {
|
||||
if (defunct) {
|
||||
Logger.log(`Defunct accessible: ${prettyName(accessible)}`);
|
||||
}
|
||||
}
|
||||
return defunct;
|
||||
}
|
||||
|
||||
/**
|
||||
* Traverses the accessible tree starting from a given accessible as a root and
|
||||
* looks for an accessible that matches based on its DOMNode id.
|
||||
* @param {nsIAccessible} accessible root accessible
|
||||
* @param {String} id id to look up accessible for
|
||||
* @return {nsIAccessible?} found accessible if any
|
||||
*/
|
||||
function findAccessibleChildByID(accessible, id) {
|
||||
if (getAccessibleDOMNodeID(accessible) === id) {
|
||||
return accessible;
|
||||
}
|
||||
for (let i = 0; i < accessible.children.length; ++i) {
|
||||
let found = findAccessibleChildByID(accessible.getChildAt(i), id);
|
||||
if (found) {
|
||||
return found;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
8
accessible/tests/browser/states/browser.ini
Normal file
8
accessible/tests/browser/states/browser.ini
Normal file
@ -0,0 +1,8 @@
|
||||
[DEFAULT]
|
||||
support-files =
|
||||
head.js
|
||||
!/accessible/tests/browser/events.js
|
||||
!/accessible/tests/browser/shared-head.js
|
||||
!/accessible/tests/mochitest/*.js
|
||||
|
||||
[browser_test_link.js]
|
38
accessible/tests/browser/states/browser_test_link.js
Normal file
38
accessible/tests/browser/states/browser_test_link.js
Normal file
@ -0,0 +1,38 @@
|
||||
/* 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';
|
||||
|
||||
/* import-globals-from ../../mochitest/role.js */
|
||||
/* import-globals-from ../../mochitest/states.js */
|
||||
loadScripts({ name: 'role.js', dir: MOCHITESTS_DIR },
|
||||
{ name: 'states.js', dir: MOCHITESTS_DIR });
|
||||
|
||||
async function runTests(browser, accDoc) {
|
||||
let getAcc = id => findAccessibleChildByID(accDoc, id);
|
||||
|
||||
// a: no traversed state
|
||||
testStates(getAcc("link_traversed"), 0, 0, STATE_TRAVERSED);
|
||||
|
||||
let onStateChanged = waitForEvent(EVENT_STATE_CHANGE, "link_traversed");
|
||||
let newWinOpened = BrowserTestUtils.waitForNewWindow();
|
||||
|
||||
await BrowserTestUtils.synthesizeMouse('#link_traversed',
|
||||
1, 1, { shiftKey: true }, browser);
|
||||
|
||||
await onStateChanged;
|
||||
testStates(getAcc("link_traversed"), STATE_TRAVERSED);
|
||||
|
||||
let newWin = await newWinOpened;
|
||||
await BrowserTestUtils.closeWindow(newWin);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test caching of accessible object states
|
||||
*/
|
||||
addAccessibleTask(`
|
||||
<a id="link_traversed" href="http://www.example.com" target="_top">
|
||||
example.com
|
||||
</a>`, runTests
|
||||
);
|
15
accessible/tests/browser/states/head.js
Normal file
15
accessible/tests/browser/states/head.js
Normal file
@ -0,0 +1,15 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
'use strict';
|
||||
|
||||
// Load the shared-head file first.
|
||||
/* import-globals-from ../shared-head.js */
|
||||
Services.scriptloader.loadSubScript(
|
||||
'chrome://mochitests/content/browser/accessible/tests/browser/shared-head.js',
|
||||
this);
|
||||
|
||||
// Loading and common.js from accessible/tests/mochitest/ for all tests, as
|
||||
// well as events.js.
|
||||
loadScripts({ name: 'common.js', dir: MOCHITESTS_DIR }, 'events.js');
|
@ -21,45 +21,6 @@
|
||||
src="../events.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
//gA11yEventDumpToConsole = true; // debug stuff
|
||||
|
||||
var gLinkWindow = null;
|
||||
function closeDocChecker()
|
||||
{
|
||||
this.__proto__ = new asyncInvokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE);
|
||||
|
||||
this.check = function closeDocChecker_check(aEvent)
|
||||
{
|
||||
gLinkWindow = aEvent.accessible.rootDocument.window;
|
||||
}
|
||||
|
||||
this.match = function closeDocChecker_match(aEvent)
|
||||
{
|
||||
// A temporary about:blank document gets loaded before 'example.com'
|
||||
// document.
|
||||
return aEvent.DOMNode.URL == "http://www.example.com/";
|
||||
}
|
||||
}
|
||||
|
||||
function clickLink(aID)
|
||||
{
|
||||
this.eventSeq = [
|
||||
new stateChangeChecker(STATE_TRAVERSED, false, true, "link_traversed"),
|
||||
new closeDocChecker()
|
||||
];
|
||||
|
||||
this.invoke = function clickLink_invoke()
|
||||
{
|
||||
synthesizeMouse(getNode("link_traversed"), 1, 1, { shiftKey: true });
|
||||
}
|
||||
|
||||
this.getID = function clickLink_getID()
|
||||
{
|
||||
return "link + '" + aID + "' clicked.";
|
||||
}
|
||||
}
|
||||
|
||||
var gQueue = null;
|
||||
function doTest()
|
||||
{
|
||||
// a@href and its text node
|
||||
@ -84,22 +45,7 @@
|
||||
// a (no @href, no click event listener)
|
||||
testStates("link_notlink", 0, 0, STATE_LINKED);
|
||||
|
||||
// a: no traversed state
|
||||
testStates("link_traversed", 0, 0, STATE_TRAVERSED);
|
||||
|
||||
// a: traversed state
|
||||
//enableLogging("docload"); // debug stuff
|
||||
|
||||
gQueue = new eventQueue();
|
||||
gQueue.push(new clickLink("link_traversed"));
|
||||
gQueue.onFinish =
|
||||
function()
|
||||
{
|
||||
gLinkWindow.close();
|
||||
//disableLogging(); // debug stuff
|
||||
}
|
||||
|
||||
gQueue.invoke(); // will call SimpleTest.finsih();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
@ -138,7 +84,5 @@
|
||||
<a id="link_ariabutton" role="button">aria button</a>
|
||||
<a id="link_notlink">not link</a>
|
||||
|
||||
<a id="link_traversed" href="http://www.example.com" target="_top">example.com</a>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -52,7 +52,6 @@ module.exports = createClass({
|
||||
onToggleShowInfiniteLines,
|
||||
onShowGridAreaHighlight,
|
||||
onShowGridCellHighlight,
|
||||
onShowGridLineNamesHighlight,
|
||||
} = this.props;
|
||||
|
||||
return grids.length ?
|
||||
@ -84,7 +83,6 @@ module.exports = createClass({
|
||||
grids,
|
||||
onShowGridAreaHighlight,
|
||||
onShowGridCellHighlight,
|
||||
onShowGridLineNamesHighlight,
|
||||
})
|
||||
:
|
||||
null
|
||||
|
@ -10,9 +10,6 @@ const { addons, createClass, DOM: dom, PropTypes } =
|
||||
const Types = require("../types");
|
||||
const { getStr } = require("../utils/l10n");
|
||||
|
||||
const COLUMNS = "cols";
|
||||
const ROWS = "rows";
|
||||
|
||||
// The delay prior to executing the grid cell highlighting.
|
||||
const GRID_HIGHLIGHTING_DEBOUNCE = 50;
|
||||
|
||||
@ -38,7 +35,6 @@ module.exports = createClass({
|
||||
grids: PropTypes.arrayOf(PropTypes.shape(Types.grid)).isRequired,
|
||||
onShowGridAreaHighlight: PropTypes.func.isRequired,
|
||||
onShowGridCellHighlight: PropTypes.func.isRequired,
|
||||
onShowGridLineNamesHighlight: PropTypes.func.isRequired,
|
||||
},
|
||||
|
||||
mixins: [ addons.PureRenderMixin ],
|
||||
@ -317,104 +313,6 @@ module.exports = createClass({
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Renders the grid line of a grid fragment.
|
||||
*
|
||||
* @param {Number} id
|
||||
* The grid id stored on the grid fragment
|
||||
* @param {Number} gridFragmentIndex
|
||||
* The index of the grid fragment rendered to the document.
|
||||
* @param {String} color
|
||||
* The color of the grid.
|
||||
* @param {Number} x1
|
||||
* The starting x-coordinate of the grid line.
|
||||
* @param {Number} y1
|
||||
* The starting y-coordinate of the grid line.
|
||||
* @param {Number} x2
|
||||
* The ending x-coordinate of the grid line.
|
||||
* @param {Number} y2
|
||||
* The ending y-coordinate of the grid line.
|
||||
* @param {Number} gridLineNumber
|
||||
* The grid line number of the line being rendered.
|
||||
* @param {String} lineType
|
||||
* The grid line name(s) of the line being rendered.
|
||||
*/
|
||||
renderGridLine(id, gridFragmentIndex, color, x1, y1, x2, y2,
|
||||
gridLineNumber, lineType) {
|
||||
return dom.line(
|
||||
{
|
||||
key: `${id}-${lineType}-${gridLineNumber}`,
|
||||
className: "grid-outline-line",
|
||||
"data-grid-fragment-index": gridFragmentIndex,
|
||||
"data-grid-id": id,
|
||||
"data-grid-line-color": color,
|
||||
"data-grid-line-number": gridLineNumber,
|
||||
"data-grid-line-type": lineType,
|
||||
x1,
|
||||
y1,
|
||||
x2,
|
||||
y2,
|
||||
onMouseOver: this.onMouseOverLine,
|
||||
onMouseOut: this.onMouseLeaveLine,
|
||||
stroke: "#000000",
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
renderGridLines(grid) {
|
||||
return dom.g(
|
||||
{
|
||||
className: "grid-outline-lines",
|
||||
},
|
||||
this.renderLines(grid)
|
||||
);
|
||||
},
|
||||
|
||||
renderLines(grid) {
|
||||
const { id, color, gridFragments } = grid;
|
||||
const { width, height } = this.state;
|
||||
let gridFragmentIndex = 0;
|
||||
const { rows, cols } = gridFragments[gridFragmentIndex];
|
||||
const numberOfColumns = cols.lines.length - 1;
|
||||
const numberOfRows = rows.lines.length - 1;
|
||||
const lines = [];
|
||||
|
||||
let x = 1;
|
||||
let y = 1;
|
||||
let rowBreadth = 0;
|
||||
let colBreadth = 0;
|
||||
|
||||
if (width > 0 && height > 0) {
|
||||
for (let row = 0; row <= numberOfRows; row++) {
|
||||
if (row < numberOfRows) {
|
||||
rowBreadth = GRID_CELL_SCALE_FACTOR * (rows.tracks[row].breadth / 100);
|
||||
}
|
||||
const { number } = rows.lines[row];
|
||||
const rowLine = this.renderGridLine(id, gridFragmentIndex, color,
|
||||
x, y, width - 20, y, number, ROWS);
|
||||
|
||||
lines.push(rowLine);
|
||||
y += rowBreadth;
|
||||
}
|
||||
|
||||
y = 1;
|
||||
|
||||
for (let col = 0; col <= numberOfColumns; col++) {
|
||||
if (col < numberOfColumns) {
|
||||
colBreadth = GRID_CELL_SCALE_FACTOR * (cols.tracks[col].breadth / 100);
|
||||
}
|
||||
const { number } = cols.lines[col];
|
||||
const colLine = this.renderGridLine(id, gridFragmentIndex, color,
|
||||
x, y, x, height - 20, number, COLUMNS);
|
||||
|
||||
lines.push(colLine);
|
||||
x += colBreadth;
|
||||
}
|
||||
}
|
||||
|
||||
return lines;
|
||||
},
|
||||
|
||||
onMouseLeaveCell({ target }) {
|
||||
const {
|
||||
grids,
|
||||
@ -433,27 +331,6 @@ module.exports = createClass({
|
||||
this.highlightCell(event);
|
||||
},
|
||||
|
||||
onMouseLeaveLine({ target }) {
|
||||
const { grids, onShowGridLineNamesHighlight } = this.props;
|
||||
const fragmentIndex = target.dataset.gridFragmentIndex;
|
||||
const id = target.dataset.gridId;
|
||||
const color = target.closest(".grid-cell-group").dataset.gridLineColor;
|
||||
|
||||
onShowGridLineNamesHighlight(grids[id].nodeFront, fragmentIndex, color);
|
||||
},
|
||||
|
||||
onMouseOverLine({ target }) {
|
||||
const { grids, onShowGridLineNamesHighlight } = this.props;
|
||||
const fragmentIndex = target.dataset.gridFragmentIndex;
|
||||
const id = target.dataset.gridId;
|
||||
const lineNumber = target.dataset.gridLineNumber;
|
||||
const type = target.dataset.gridLineType;
|
||||
const color = target.closest(".grid-cell-group").dataset.gridLineColor;
|
||||
|
||||
onShowGridLineNamesHighlight(grids[id].nodeFront, fragmentIndex, color,
|
||||
lineNumber, type);
|
||||
},
|
||||
|
||||
renderOutline() {
|
||||
const {
|
||||
height,
|
||||
@ -469,8 +346,7 @@ module.exports = createClass({
|
||||
height: this.getHeight(),
|
||||
viewBox: `${TRANSLATE_X} ${TRANSLATE_Y} ${width} ${height}`,
|
||||
},
|
||||
this.renderGridOutline(selectedGrid),
|
||||
this.renderGridLines(selectedGrid)
|
||||
this.renderGridOutline(selectedGrid)
|
||||
)
|
||||
:
|
||||
this.renderCannotShowOutlineText();
|
||||
|
@ -255,6 +255,12 @@ EdgeInclusiveIntersection(const nsRect& aRect, const nsRect& aOtherRect)
|
||||
return Some(nsRect(left, top, right - left, bottom - top));
|
||||
}
|
||||
|
||||
enum class BrowsingContextInfo {
|
||||
SimilarOriginBrowsingContext,
|
||||
DifferentOriginBrowsingContext,
|
||||
UnknownBrowsingContext
|
||||
};
|
||||
|
||||
void
|
||||
DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time)
|
||||
{
|
||||
@ -374,11 +380,22 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time
|
||||
}
|
||||
}
|
||||
|
||||
nsRect rootIntersectionRect = rootRect;
|
||||
bool isInSimilarOriginBrowsingContext = rootFrame && targetFrame &&
|
||||
CheckSimilarOrigin(root, target);
|
||||
nsRect rootIntersectionRect;
|
||||
BrowsingContextInfo isInSimilarOriginBrowsingContext =
|
||||
BrowsingContextInfo::UnknownBrowsingContext;
|
||||
|
||||
if (isInSimilarOriginBrowsingContext) {
|
||||
if (rootFrame && targetFrame) {
|
||||
rootIntersectionRect = rootRect;
|
||||
}
|
||||
|
||||
if (root && target) {
|
||||
isInSimilarOriginBrowsingContext = CheckSimilarOrigin(root, target) ?
|
||||
BrowsingContextInfo::SimilarOriginBrowsingContext :
|
||||
BrowsingContextInfo::DifferentOriginBrowsingContext;
|
||||
}
|
||||
|
||||
if (isInSimilarOriginBrowsingContext ==
|
||||
BrowsingContextInfo::SimilarOriginBrowsingContext) {
|
||||
rootIntersectionRect.Inflate(rootMargin);
|
||||
}
|
||||
|
||||
@ -428,7 +445,9 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time
|
||||
if (target->UpdateIntersectionObservation(this, threshold)) {
|
||||
QueueIntersectionObserverEntry(
|
||||
target, time,
|
||||
isInSimilarOriginBrowsingContext ? Some(rootIntersectionRect) : Nothing(),
|
||||
isInSimilarOriginBrowsingContext ==
|
||||
BrowsingContextInfo::DifferentOriginBrowsingContext ?
|
||||
Nothing() : Some(rootIntersectionRect),
|
||||
targetRect, intersectionRect, intersectionRatio
|
||||
);
|
||||
}
|
||||
|
@ -2187,7 +2187,7 @@ imgLoader::LoadImage(nsIURI* aURI,
|
||||
"Proxyless entry's request has cache entry!");
|
||||
request->SetCacheEntry(entry);
|
||||
|
||||
if (mCacheTracker) {
|
||||
if (mCacheTracker && entry->GetExpirationState()->IsTracked()) {
|
||||
mCacheTracker->MarkUsed(entry);
|
||||
}
|
||||
}
|
||||
@ -2454,7 +2454,7 @@ imgLoader::LoadImageWithChannel(nsIChannel* channel,
|
||||
"Proxyless entry's request has cache entry!");
|
||||
request->SetCacheEntry(entry);
|
||||
|
||||
if (mCacheTracker) {
|
||||
if (mCacheTracker && entry->GetExpirationState()->IsTracked()) {
|
||||
mCacheTracker->MarkUsed(entry);
|
||||
}
|
||||
}
|
||||
|
@ -9134,8 +9134,6 @@ BytecodeEmitter::emitStatement(ParseNode* pn)
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
current->currentLine = parser.tokenStream().srcCoords.lineNum(pn2->pn_pos.begin);
|
||||
current->lastColumn = 0;
|
||||
if (!reportExtraWarning(pn2, JSMSG_USELESS_EXPR))
|
||||
return false;
|
||||
}
|
||||
|
@ -191,9 +191,20 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||
BytecodeVector code; /* bytecode */
|
||||
SrcNotesVector notes; /* source notes, see below */
|
||||
ptrdiff_t lastNoteOffset; /* code offset for last source note */
|
||||
uint32_t currentLine; /* line number for tree-based srcnote gen */
|
||||
uint32_t lastColumn; /* zero-based column index on currentLine of
|
||||
last SRC_COLSPAN-annotated opcode */
|
||||
|
||||
// Line number for srcnotes.
|
||||
//
|
||||
// WARNING: If this becomes out of sync with already-emitted srcnotes,
|
||||
// we can get undefined behavior.
|
||||
uint32_t currentLine;
|
||||
|
||||
// Zero-based column index on currentLine of last SRC_COLSPAN-annotated
|
||||
// opcode.
|
||||
//
|
||||
// WARNING: If this becomes out of sync with already-emitted srcnotes,
|
||||
// we can get undefined behavior.
|
||||
uint32_t lastColumn;
|
||||
|
||||
JumpTarget lastTarget; // Last jump target emitted.
|
||||
|
||||
EmitSection(JSContext* cx, uint32_t lineNum)
|
||||
|
8
js/src/jit-test/tests/parser/bug-1355046.js
Normal file
8
js/src/jit-test/tests/parser/bug-1355046.js
Normal file
@ -0,0 +1,8 @@
|
||||
// |jit-test| error: ReferenceError
|
||||
|
||||
var localstr = "";
|
||||
for (var i = 0; i < 0xFFFC; ++i)
|
||||
localstr += ('\f') + i + "; ";
|
||||
var arg = "x";
|
||||
var body = localstr + "for (var i = 0; i < 4; ++i) arr[i](x-1);";
|
||||
(new Function(arg, body))(1000);
|
@ -64,7 +64,7 @@ addLoadEvent(function test() {
|
||||
setTimeout(cont1, timeout)
|
||||
function cont1() {
|
||||
// Move the mouse over option 3 (90 = 3 (rows) * 24 (row height) + 18).
|
||||
WinUtils.sendMouseEvent("mousemove", 355, 90, 0, 0, 0, true)
|
||||
WinUtils.sendMouseEvent("mousemove", 355, 92, 0, 0, 0, true)
|
||||
setTimeout(cont2, timeout)
|
||||
}
|
||||
function cont2() {
|
||||
|
@ -1727,7 +1727,7 @@ function RecordResult(testRunTime, errorMsg, scriptResults)
|
||||
throw "Inconsistent result from compareCanvases.";
|
||||
}
|
||||
equal = expected == EXPECTED_FUZZY;
|
||||
logger.info("REFTEST fuzzy match");
|
||||
logger.info(`REFTEST fuzzy match (${maxDifference.value}, ${differences}) <= (${gURLs[0].fuzzyMaxDelta}, ${gURLs[0].fuzzyMaxPixels})`);
|
||||
}
|
||||
|
||||
var failedExtraCheck = gFailedNoPaint || gFailedOpaqueLayer || gFailedAssignedLayer;
|
||||
|
@ -4654,7 +4654,7 @@ pref("network.tcp.keepalive.retry_interval", 1); // seconds
|
||||
pref("network.tcp.keepalive.probe_count", 4);
|
||||
#endif
|
||||
|
||||
pref("network.tcp.tcp_fastopen_enable", false);
|
||||
pref("network.tcp.tcp_fastopen_enable", true);
|
||||
pref("network.tcp.tcp_fastopen_consecutive_failure_limit", 5);
|
||||
|
||||
// Whether to disable acceleration for all widgets.
|
||||
|
@ -27,6 +27,7 @@ jobs:
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-android
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
os: linux
|
||||
docker-image: {in-tree: android-gradle-build}
|
||||
env:
|
||||
GRADLE_USER_HOME: "/home/worker/workspace/build/src/dotgradle-online"
|
||||
@ -72,6 +73,7 @@ jobs:
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-android
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
os: linux
|
||||
docker-image: {in-tree: desktop-build}
|
||||
env:
|
||||
GRADLE_USER_HOME: "/home/worker/workspace/build/src/dotgradle"
|
||||
@ -118,6 +120,7 @@ jobs:
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-android
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
os: linux
|
||||
docker-image: {in-tree: desktop-build}
|
||||
env:
|
||||
GRADLE_USER_HOME: "/home/worker/workspace/build/src/dotgradle"
|
||||
@ -186,6 +189,7 @@ jobs:
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-android
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
os: linux
|
||||
docker-image: {in-tree: desktop-build}
|
||||
env:
|
||||
GRADLE_USER_HOME: "/home/worker/workspace/build/src/dotgradle"
|
||||
@ -235,6 +239,7 @@ jobs:
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-android
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
os: linux
|
||||
docker-image: {in-tree: desktop-build}
|
||||
env:
|
||||
GRADLE_USER_HOME: "/home/worker/workspace/build/src/dotgradle"
|
||||
|
@ -22,7 +22,6 @@ jobs:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: desktop-build}
|
||||
max-run-time: 36000
|
||||
run:
|
||||
|
@ -8,7 +8,6 @@ android-api-15/debug:
|
||||
symbol: tc(B)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-android
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
@ -32,7 +31,6 @@ android-x86/opt:
|
||||
symbol: tc(B)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-android
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
@ -59,7 +57,6 @@ android-x86-nightly/opt:
|
||||
symbol: tc(N)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-android
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
@ -84,7 +81,6 @@ android-api-15/opt:
|
||||
symbol: tc(B)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-android
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
@ -111,7 +107,6 @@ android-api-15-nightly/opt:
|
||||
symbol: tc(N)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-android
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
@ -136,7 +131,6 @@ android-x86-old-id/opt:
|
||||
symbol: tc(B)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-android
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
@ -164,7 +158,6 @@ android-x86-old-id-nightly/opt:
|
||||
symbol: tc(N)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-android
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
@ -190,7 +183,6 @@ android-api-15-old-id/opt:
|
||||
symbol: tc(B)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-android
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
@ -218,7 +210,6 @@ android-api-15-old-id-nightly/opt:
|
||||
symbol: tc(N)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-android
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
@ -245,7 +236,6 @@ android-api-15-gradle/opt:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-android
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 7200
|
||||
env:
|
||||
# Bug 1292762 - Set GRADLE_USER_HOME to avoid sdk-manager-plugin intermittent
|
||||
@ -282,7 +272,6 @@ android-aarch64/opt:
|
||||
symbol: tc(B)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-android
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
@ -309,7 +298,6 @@ android-aarch64-nightly/opt:
|
||||
symbol: tc(N)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-android
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
|
@ -8,7 +8,6 @@ linux64/opt:
|
||||
symbol: tc(B)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
run:
|
||||
using: mozharness
|
||||
@ -31,7 +30,6 @@ linux64/pgo:
|
||||
symbol: tc(B)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
coalesce-name: linux64-pgo
|
||||
run:
|
||||
@ -56,7 +54,6 @@ linux64/debug:
|
||||
symbol: tc(B)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
run:
|
||||
using: mozharness
|
||||
@ -83,7 +80,6 @@ linux64-devedition-nightly/opt:
|
||||
symbol: tc(N)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
run:
|
||||
using: mozharness
|
||||
@ -109,7 +105,6 @@ linux/opt:
|
||||
symbol: tc(B)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
coalesce-name: opt_linux32
|
||||
run:
|
||||
@ -133,7 +128,6 @@ linux/debug:
|
||||
symbol: tc(B)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
coalesce-name: dbg_linux32
|
||||
run:
|
||||
@ -158,7 +152,6 @@ linux/pgo:
|
||||
symbol: tc(B)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
coalesce-name: linux32-pgo
|
||||
run:
|
||||
@ -186,7 +179,6 @@ linux-devedition-nightly/opt:
|
||||
symbol: tc(N)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
run:
|
||||
using: mozharness
|
||||
@ -215,7 +207,6 @@ linux-nightly/opt:
|
||||
symbol: tc(N)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
run:
|
||||
using: mozharness
|
||||
@ -240,7 +231,6 @@ linux64-asan/opt:
|
||||
symbol: tc(Bo)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
run:
|
||||
using: mozharness
|
||||
@ -265,7 +255,6 @@ linux64-asan-fuzzing/opt:
|
||||
symbol: tc(Bof)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
run:
|
||||
using: mozharness
|
||||
@ -289,7 +278,6 @@ linux64-asan/debug:
|
||||
symbol: tc(Bd)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
run:
|
||||
using: mozharness
|
||||
@ -316,7 +304,6 @@ linux64-nightly/opt:
|
||||
symbol: tc(N)
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
run:
|
||||
using: mozharness
|
||||
@ -341,7 +328,6 @@ linux64-stylo/opt:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 3600
|
||||
run:
|
||||
using: mozharness
|
||||
@ -367,7 +353,6 @@ linux64-stylo/debug:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 3600
|
||||
run:
|
||||
using: mozharness
|
||||
@ -394,7 +379,6 @@ linux64-jsdcov/opt:
|
||||
run-on-projects: [ ]
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
run:
|
||||
using: mozharness
|
||||
@ -420,7 +404,6 @@ linux64-ccov/opt:
|
||||
run-on-projects: [ ]
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
run:
|
||||
using: mozharness
|
||||
@ -445,7 +428,6 @@ linux64-add-on-devel/opt:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
run:
|
||||
using: mozharness
|
||||
|
@ -9,7 +9,6 @@ macosx64/debug:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
run:
|
||||
using: mozharness
|
||||
@ -32,8 +31,6 @@ macosx64/opt:
|
||||
symbol: tc(B)
|
||||
tier: 2
|
||||
worker-type: buildbot-bridge/buildbot-bridge
|
||||
worker:
|
||||
implementation: buildbot-bridge
|
||||
run:
|
||||
using: mozharness
|
||||
actions: [get-secrets build generate-build-stats update]
|
||||
@ -55,7 +52,6 @@ macosx64-add-on-devel/opt:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
run:
|
||||
using: mozharness
|
||||
@ -83,7 +79,6 @@ macosx64-nightly/opt:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
run:
|
||||
using: mozharness
|
||||
|
@ -9,7 +9,6 @@ win32/debug:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
|
||||
worker:
|
||||
implementation: generic-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
@ -28,7 +27,6 @@ win32/opt:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
|
||||
worker:
|
||||
implementation: generic-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
@ -47,7 +45,6 @@ win32/pgo:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
|
||||
worker:
|
||||
implementation: generic-worker
|
||||
max-run-time: 9000
|
||||
run:
|
||||
using: mozharness
|
||||
@ -67,7 +64,6 @@ win64/debug:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
|
||||
worker:
|
||||
implementation: generic-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
@ -86,7 +82,6 @@ win64/opt:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
|
||||
worker:
|
||||
implementation: generic-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
@ -108,7 +103,6 @@ win64-nightly/opt:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
|
||||
worker:
|
||||
implementation: generic-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
@ -129,7 +123,6 @@ win64/pgo:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
|
||||
worker:
|
||||
implementation: generic-worker
|
||||
max-run-time: 10800
|
||||
run:
|
||||
using: mozharness
|
||||
@ -149,7 +142,6 @@ win32-add-on-devel/opt:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
|
||||
worker:
|
||||
implementation: generic-worker
|
||||
max-run-time: 10800
|
||||
run:
|
||||
using: mozharness
|
||||
@ -170,7 +162,6 @@ win64-add-on-devel/opt:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
|
||||
worker:
|
||||
implementation: generic-worker
|
||||
max-run-time: 10800
|
||||
run:
|
||||
using: mozharness
|
||||
@ -191,7 +182,6 @@ win64-asan/debug:
|
||||
tier: 3
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
|
||||
worker:
|
||||
implementation: generic-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
@ -211,7 +201,6 @@ win64-asan/opt:
|
||||
tier: 3
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
|
||||
worker:
|
||||
implementation: generic-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
|
@ -15,7 +15,6 @@ job-defaults:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
docker-image: {in-tree: desktop-build}
|
||||
|
||||
|
@ -7,7 +7,6 @@ sphinx:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-t-linux-xlarge
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: "lint"}
|
||||
max-run-time: 1800
|
||||
artifacts:
|
||||
|
@ -7,7 +7,6 @@ mozlint-eslint:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-t-linux-xlarge
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: "lint"}
|
||||
max-run-time: 1800
|
||||
run:
|
||||
@ -51,7 +50,6 @@ mozlint-flake8:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-t-linux-xlarge
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: "lint"}
|
||||
max-run-time: 1800
|
||||
run:
|
||||
@ -76,7 +74,6 @@ wptlint-gecko:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-t-linux-xlarge
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: "lint"}
|
||||
max-run-time: 1800
|
||||
run:
|
||||
|
@ -7,7 +7,6 @@ taskgraph-tests:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-t-linux-xlarge
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: "lint"}
|
||||
max-run-time: 1800
|
||||
run:
|
||||
@ -35,7 +34,6 @@ marionette-harness:
|
||||
worker:
|
||||
by-platform:
|
||||
linux64.*:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: "lint"}
|
||||
max-run-time: 3600
|
||||
run:
|
||||
@ -66,7 +64,6 @@ mozbase:
|
||||
worker:
|
||||
by-platform:
|
||||
linux64.*:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: "lint"}
|
||||
max-run-time: 3600
|
||||
run:
|
||||
@ -90,7 +87,6 @@ mozharness:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-t-linux-xlarge
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: "lint"}
|
||||
max-run-time: 1800
|
||||
run:
|
||||
@ -119,7 +115,6 @@ mozlint:
|
||||
worker:
|
||||
by-platform:
|
||||
linux64.*:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: "lint"}
|
||||
max-run-time: 3600
|
||||
run:
|
||||
|
@ -7,7 +7,6 @@ webidl-test:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-t-linux-xlarge
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: "lint"}
|
||||
max-run-time: 1800
|
||||
run:
|
||||
|
@ -18,7 +18,6 @@ job-defaults:
|
||||
product: firefox
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 36000
|
||||
docker-image: {in-tree: desktop-build}
|
||||
run:
|
||||
|
@ -26,7 +26,6 @@ jobs:
|
||||
platform: osx-10-7/debug
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: desktop-build}
|
||||
max-run-time: 36000
|
||||
run:
|
||||
@ -49,7 +48,6 @@ jobs:
|
||||
platform: osx-10-7/opt
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: desktop-build}
|
||||
max-run-time: 36000
|
||||
run:
|
||||
@ -72,7 +70,6 @@ jobs:
|
||||
platform: linux64/debug
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: desktop-build}
|
||||
max-run-time: 36000
|
||||
run:
|
||||
@ -93,7 +90,6 @@ jobs:
|
||||
platform: linux64/opt
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: desktop-build}
|
||||
max-run-time: 36000
|
||||
run:
|
||||
@ -117,7 +113,6 @@ jobs:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
|
||||
worker:
|
||||
implementation: generic-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
@ -136,7 +131,6 @@ jobs:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
|
||||
worker:
|
||||
implementation: generic-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
@ -155,7 +149,6 @@ jobs:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
|
||||
worker:
|
||||
implementation: generic-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
@ -174,7 +167,6 @@ jobs:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
|
||||
worker:
|
||||
implementation: generic-worker
|
||||
max-run-time: 7200
|
||||
run:
|
||||
using: mozharness
|
||||
|
@ -11,7 +11,6 @@ linux64-clang:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: desktop-build}
|
||||
max-run-time: 36000
|
||||
run:
|
||||
@ -34,7 +33,6 @@ linux64-clang-tidy:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: desktop-build}
|
||||
max-run-time: 36000
|
||||
run:
|
||||
@ -55,7 +53,6 @@ linux64-gcc:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: desktop-build}
|
||||
max-run-time: 36000
|
||||
run:
|
||||
@ -73,7 +70,6 @@ linux64-binutils:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: desktop-build}
|
||||
max-run-time: 36000
|
||||
run:
|
||||
@ -91,7 +87,6 @@ linux64-cctools-port:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: desktop-build}
|
||||
max-run-time: 36000
|
||||
run:
|
||||
@ -110,7 +105,6 @@ linux64-hfsplus:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: desktop-build}
|
||||
max-run-time: 36000
|
||||
run:
|
||||
@ -130,7 +124,6 @@ linux64-libdmg:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: desktop-build}
|
||||
max-run-time: 36000
|
||||
run:
|
||||
|
@ -11,7 +11,6 @@ macosx64-clang:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: desktop-build}
|
||||
max-run-time: 36000
|
||||
run:
|
||||
@ -34,7 +33,6 @@ macosx64-clang-tidy:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: desktop-build}
|
||||
max-run-time: 36000
|
||||
run:
|
||||
@ -55,7 +53,6 @@ macosx64-cctools-port:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: desktop-build}
|
||||
max-run-time: 36000
|
||||
run:
|
||||
|
@ -11,7 +11,6 @@ win32-clang-cl:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
|
||||
worker:
|
||||
implementation: generic-worker
|
||||
max-run-time: 36000
|
||||
run:
|
||||
using: toolchain-script
|
||||
@ -29,7 +28,6 @@ win64-clang-cl:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
|
||||
worker:
|
||||
implementation: generic-worker
|
||||
max-run-time: 36000
|
||||
run:
|
||||
using: toolchain-script
|
||||
@ -50,7 +48,6 @@ win32-clang-tidy:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
|
||||
worker:
|
||||
implementation: generic-worker
|
||||
max-run-time: 36000
|
||||
run:
|
||||
using: toolchain-script
|
||||
@ -71,7 +68,6 @@ win64-clang-tidy:
|
||||
tier: 2
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
|
||||
worker:
|
||||
implementation: generic-worker
|
||||
max-run-time: 36000
|
||||
run:
|
||||
using: toolchain-script
|
||||
|
@ -37,6 +37,7 @@ job-template:
|
||||
worker-type: aws-provisioner-v1/gecko-symbol-upload
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
os: linux
|
||||
max-run-time: 600
|
||||
command: ["/bin/bash", "bin/upload.sh"]
|
||||
docker-image: taskclusterprivate/upload_symbols:0.0.4
|
||||
|
@ -22,7 +22,6 @@ jobs:
|
||||
tier: 1
|
||||
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
docker-image: {in-tree: desktop-build}
|
||||
max-run-time: 72000
|
||||
run:
|
||||
|
@ -9,6 +9,7 @@ kind.
|
||||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
from taskgraph.transforms.base import TransformSequence
|
||||
from taskgraph.util.workertypes import worker_type_implementation
|
||||
|
||||
transforms = TransformSequence()
|
||||
|
||||
@ -20,16 +21,19 @@ def set_defaults(config, jobs):
|
||||
job['treeherder'].setdefault('kind', 'build')
|
||||
job['treeherder'].setdefault('tier', 1)
|
||||
job.setdefault('needs-sccache', True)
|
||||
if job['worker']['implementation'] in ('docker-worker', 'docker-engine'):
|
||||
job['worker'].setdefault('docker-image', {'in-tree': 'desktop-build'})
|
||||
job['worker']['chain-of-trust'] = True
|
||||
job.setdefault('extra', {})
|
||||
job['extra'].setdefault('chainOfTrust', {})
|
||||
job['extra']['chainOfTrust'].setdefault('inputs', {})
|
||||
job['extra']['chainOfTrust']['inputs']['docker-image'] = {
|
||||
_, worker_os = worker_type_implementation(job['worker-type'])
|
||||
if worker_os == "linux":
|
||||
worker = job.setdefault('worker')
|
||||
worker.setdefault('docker-image', {'in-tree': 'desktop-build'})
|
||||
worker['chain-of-trust'] = True
|
||||
extra = job.setdefault('extra', {})
|
||||
extra.setdefault('chainOfTrust', {})
|
||||
extra['chainOfTrust'].setdefault('inputs', {})
|
||||
extra['chainOfTrust']['inputs']['docker-image'] = {
|
||||
"task-reference": "<docker-image>"
|
||||
}
|
||||
job['worker'].setdefault('env', {})
|
||||
elif worker_os in set(["macosx", "windows"]):
|
||||
job['worker'].setdefault('env', {})
|
||||
yield job
|
||||
|
||||
|
||||
|
@ -94,6 +94,7 @@ def fill_template(config, tasks):
|
||||
# this image..
|
||||
'worker': {
|
||||
'implementation': 'docker-worker',
|
||||
'os': 'linux',
|
||||
'docker-image': docker_image('image_builder'),
|
||||
'caches': [{
|
||||
'type': 'persistent',
|
||||
|
@ -19,8 +19,8 @@ from taskgraph.transforms.base import TransformSequence
|
||||
from taskgraph.util.schema import (
|
||||
validate_schema,
|
||||
Schema,
|
||||
optionally_keyed_by,
|
||||
)
|
||||
from taskgraph.util.workertypes import worker_type_implementation
|
||||
from taskgraph.transforms.task import task_description_schema
|
||||
from voluptuous import (
|
||||
Any,
|
||||
@ -81,17 +81,11 @@ job_description_schema = Schema({
|
||||
Extra: object,
|
||||
},
|
||||
|
||||
Required('worker-type'): optionally_keyed_by(
|
||||
'platform',
|
||||
task_description_schema['worker-type']),
|
||||
Required('worker-type'): task_description_schema['worker-type'],
|
||||
|
||||
# for `worker`, all we need is the implementation; the rest will be verified
|
||||
# by the task description schema
|
||||
Required('worker'): optionally_keyed_by(
|
||||
'platform', {
|
||||
Required('implementation'): basestring,
|
||||
Extra: object,
|
||||
}),
|
||||
# This object will be passed through to the task description, with additions
|
||||
# provided by the job's run-using function
|
||||
Optional('worker'): dict,
|
||||
})
|
||||
|
||||
transforms = TransformSequence()
|
||||
@ -118,7 +112,7 @@ def rewrite_when_to_optimization(config, jobs):
|
||||
'{}/**'.format(config.path),
|
||||
'taskcluster/taskgraph/**',
|
||||
])
|
||||
if 'in-tree' in job['worker'].get('docker-image', {}):
|
||||
if 'in-tree' in job.get('worker', {}).get('docker-image', {}):
|
||||
files_changed.append('taskcluster/docker/{}/**'.format(
|
||||
job['worker']['docker-image']['in-tree']))
|
||||
|
||||
@ -141,6 +135,14 @@ def make_task_description(config, jobs):
|
||||
job['label'] = '{}-{}'.format(config.kind, job['name'])
|
||||
if job['name']:
|
||||
del job['name']
|
||||
|
||||
impl, os = worker_type_implementation(job['worker-type'])
|
||||
worker = job.setdefault('worker', {})
|
||||
assert 'implementation' not in worker
|
||||
worker['implementation'] = impl
|
||||
if os:
|
||||
worker['os'] = os
|
||||
|
||||
taskdesc = copy.deepcopy(job)
|
||||
|
||||
# fill in some empty defaults to make run implementations easier
|
||||
@ -152,7 +154,7 @@ def make_task_description(config, jobs):
|
||||
|
||||
# give the function for job.run.using on this worker implementation a
|
||||
# chance to set up the task description.
|
||||
configure_taskdesc_for_run(config, job, taskdesc)
|
||||
configure_taskdesc_for_run(config, job, taskdesc, impl)
|
||||
del taskdesc['run']
|
||||
|
||||
# yield only the task description, discarding the job description
|
||||
@ -180,7 +182,7 @@ def run_job_using(worker_implementation, run_using, schema=None):
|
||||
return wrap
|
||||
|
||||
|
||||
def configure_taskdesc_for_run(config, job, taskdesc):
|
||||
def configure_taskdesc_for_run(config, job, taskdesc, worker_implementation):
|
||||
"""
|
||||
Run the appropriate function for this job against the given task
|
||||
description.
|
||||
@ -192,7 +194,6 @@ def configure_taskdesc_for_run(config, job, taskdesc):
|
||||
if run_using not in registry:
|
||||
raise Exception("no functions for run.using {!r}".format(run_using))
|
||||
|
||||
worker_implementation = job['worker']['implementation']
|
||||
if worker_implementation not in registry[run_using]:
|
||||
raise Exception("no functions for run.using {!r} on {!r}".format(
|
||||
run_using, worker_implementation))
|
||||
|
@ -105,6 +105,7 @@ def mozharness_on_docker_worker_setup(config, job, taskdesc):
|
||||
'MH_BUILD_POOL': 'taskcluster',
|
||||
'MOZ_BUILD_DATE': config.params['moz_build_date'],
|
||||
'MOZ_SCM_LEVEL': config.params['level'],
|
||||
'MOZ_AUTOMATION': '1',
|
||||
})
|
||||
|
||||
if 'actions' in run:
|
||||
@ -169,9 +170,10 @@ def mozharness_on_docker_worker_setup(config, job, taskdesc):
|
||||
worker['command'] = command
|
||||
|
||||
|
||||
# We use the generic worker to run tasks on Windows
|
||||
@run_job_using("generic-worker", "mozharness", schema=mozharness_run_schema)
|
||||
def mozharness_on_generic_worker(config, job, taskdesc):
|
||||
assert job['worker']['os'] == 'windows', 'only supports windows right now'
|
||||
|
||||
run = job['run']
|
||||
|
||||
# fail if invalid run options are included
|
||||
@ -201,6 +203,7 @@ def mozharness_on_generic_worker(config, job, taskdesc):
|
||||
'MOZ_BUILD_DATE': config.params['moz_build_date'],
|
||||
'MOZ_SCM_LEVEL': config.params['level'],
|
||||
'MOZ_SIMPLE_PACKAGE_NAME': 'target',
|
||||
'MOZ_AUTOMATION': '1',
|
||||
})
|
||||
|
||||
if not job['attributes']['build_platform'].startswith('win'):
|
||||
|
@ -41,6 +41,20 @@ mozharness_test_run_schema = Schema({
|
||||
})
|
||||
|
||||
|
||||
def test_packages_url(taskdesc):
|
||||
"""Account for different platforms that name their test packages differently"""
|
||||
build_platform = taskdesc['attributes']['build_platform']
|
||||
build_type = taskdesc['attributes']['build_type']
|
||||
|
||||
if build_platform == 'macosx64' and build_type == 'opt':
|
||||
target = 'firefox-{}.en-US.{}'.format(get_firefox_version(), 'mac')
|
||||
else:
|
||||
target = 'target'
|
||||
|
||||
return get_artifact_url(
|
||||
'<build>', 'public/build/{}.test_packages.json'.format(target))
|
||||
|
||||
|
||||
@run_job_using('docker-engine', 'mozharness-test', schema=mozharness_test_run_schema)
|
||||
@run_job_using('docker-worker', 'mozharness-test', schema=mozharness_test_run_schema)
|
||||
def mozharness_test_on_docker(config, job, taskdesc):
|
||||
@ -48,6 +62,14 @@ def mozharness_test_on_docker(config, job, taskdesc):
|
||||
mozharness = test['mozharness']
|
||||
worker = taskdesc['worker']
|
||||
|
||||
# apply some defaults
|
||||
worker['docker-image'] = test['docker-image']
|
||||
worker['allow-ptrace'] = True # required for all tests, for crashreporter
|
||||
worker['loopback-video'] = test['loopback-video']
|
||||
worker['loopback-audio'] = test['loopback-audio']
|
||||
worker['max-run-time'] = test['max-run-time']
|
||||
worker['retry-exit-status'] = test['retry-exit-status']
|
||||
|
||||
artifacts = [
|
||||
# (artifact name prefix, in-image path)
|
||||
("public/logs/", "/home/worker/workspace/build/upload/logs/"),
|
||||
@ -56,8 +78,6 @@ def mozharness_test_on_docker(config, job, taskdesc):
|
||||
]
|
||||
|
||||
installer_url = get_artifact_url('<build>', mozharness['build-artifact-name'])
|
||||
test_packages_url = get_artifact_url('<build>',
|
||||
'public/build/target.test_packages.json')
|
||||
mozharness_url = get_artifact_url('<build>',
|
||||
'public/build/mozharness.zip')
|
||||
|
||||
@ -81,6 +101,7 @@ def mozharness_test_on_docker(config, job, taskdesc):
|
||||
'NEED_PULSEAUDIO': 'true',
|
||||
'NEED_WINDOW_MANAGER': 'true',
|
||||
'ENABLE_E10S': str(bool(test.get('e10s'))).lower(),
|
||||
'MOZ_AUTOMATION': '1',
|
||||
}
|
||||
|
||||
if mozharness.get('mochitest-flavor'):
|
||||
@ -140,7 +161,7 @@ def mozharness_test_on_docker(config, job, taskdesc):
|
||||
command.append("--no-read-buildbot-config")
|
||||
command.extend([
|
||||
{"task-reference": "--installer-url=" + installer_url},
|
||||
{"task-reference": "--test-packages-url=" + test_packages_url},
|
||||
{"task-reference": "--test-packages-url=" + test_packages_url(taskdesc)},
|
||||
])
|
||||
command.extend(mozharness.get('extra-options', []))
|
||||
|
||||
@ -170,6 +191,10 @@ def mozharness_test_on_generic_worker(config, job, taskdesc):
|
||||
mozharness = test['mozharness']
|
||||
worker = taskdesc['worker']
|
||||
|
||||
is_macosx = worker['os'] == 'macosx'
|
||||
is_windows = worker['os'] == 'windows'
|
||||
assert is_macosx or is_windows
|
||||
|
||||
artifacts = [
|
||||
{
|
||||
'name': 'public/logs',
|
||||
@ -186,19 +211,8 @@ def mozharness_test_on_generic_worker(config, job, taskdesc):
|
||||
'type': 'directory'
|
||||
})
|
||||
|
||||
build_platform = taskdesc['attributes']['build_platform']
|
||||
build_type = taskdesc['attributes']['build_type']
|
||||
|
||||
if build_platform == 'macosx64' and build_type == 'opt':
|
||||
target = 'firefox-{}.en-US.{}'.format(get_firefox_version(), 'mac')
|
||||
else:
|
||||
target = 'target'
|
||||
|
||||
installer_url = get_artifact_url('<build>', mozharness['build-artifact-name'])
|
||||
|
||||
test_packages_url = get_artifact_url(
|
||||
'<build>', 'public/build/{}.test_packages.json'.format(target))
|
||||
|
||||
taskdesc['scopes'].extend(
|
||||
['generic-worker:os-group:{}'.format(group) for group in test['os-groups']])
|
||||
|
||||
@ -210,9 +224,12 @@ def mozharness_test_on_generic_worker(config, job, taskdesc):
|
||||
worker['max-run-time'] = test['max-run-time']
|
||||
worker['artifacts'] = artifacts
|
||||
|
||||
env = worker.setdefault('env', {})
|
||||
env['MOZ_AUTOMATION'] = '1'
|
||||
|
||||
# this list will get cleaned up / reduced / removed in bug 1354088
|
||||
if build_platform.startswith('macosx'):
|
||||
worker['env'] = {
|
||||
if is_macosx:
|
||||
env.update({
|
||||
'IDLEIZER_DISABLE_SHUTDOWN': 'true',
|
||||
'LANG': 'en_US.UTF-8',
|
||||
'LC_ALL': 'en_US.UTF-8',
|
||||
@ -225,38 +242,32 @@ def mozharness_test_on_generic_worker(config, job, taskdesc):
|
||||
'SHELL': '/bin/bash',
|
||||
'XPCOM_DEBUG_BREAK': 'warn',
|
||||
'XPC_FLAGS': '0x0',
|
||||
'XPC_SERVICE_NAME': '0'
|
||||
}
|
||||
'XPC_SERVICE_NAME': '0',
|
||||
})
|
||||
|
||||
if build_platform.startswith('macosx'):
|
||||
if is_macosx:
|
||||
mh_command = [
|
||||
'python2.7',
|
||||
'-u',
|
||||
'mozharness/scripts/' + mozharness['script']
|
||||
]
|
||||
elif build_platform.startswith('win'):
|
||||
elif is_windows:
|
||||
mh_command = [
|
||||
'c:\\mozilla-build\\python\\python.exe',
|
||||
'-u',
|
||||
'mozharness\\scripts\\' + normpath(mozharness['script'])
|
||||
]
|
||||
else:
|
||||
mh_command = [
|
||||
'python',
|
||||
'-u',
|
||||
'mozharness/scripts/' + mozharness['script']
|
||||
]
|
||||
|
||||
for mh_config in mozharness['config']:
|
||||
cfg_path = 'mozharness/configs/' + mh_config
|
||||
if build_platform.startswith('win'):
|
||||
if is_windows:
|
||||
cfg_path = normpath(cfg_path)
|
||||
mh_command.extend(['--cfg', cfg_path])
|
||||
mh_command.extend(mozharness.get('extra-options', []))
|
||||
if mozharness.get('no-read-buildbot-config'):
|
||||
mh_command.append('--no-read-buildbot-config')
|
||||
mh_command.extend(['--installer-url', installer_url])
|
||||
mh_command.extend(['--test-packages-url', test_packages_url])
|
||||
mh_command.extend(['--test-packages-url', test_packages_url(taskdesc)])
|
||||
if mozharness.get('download-symbols'):
|
||||
if isinstance(mozharness['download-symbols'], basestring):
|
||||
mh_command.extend(['--download-symbols', mozharness['download-symbols']])
|
||||
@ -289,11 +300,11 @@ def mozharness_test_on_generic_worker(config, job, taskdesc):
|
||||
'format': 'zip'
|
||||
}]
|
||||
|
||||
if build_platform.startswith('win'):
|
||||
if is_windows:
|
||||
worker['command'] = [
|
||||
{'task-reference': ' '.join(mh_command)}
|
||||
]
|
||||
else:
|
||||
else: # is_macosx
|
||||
mh_command_task_ref = []
|
||||
for token in mh_command:
|
||||
mh_command_task_ref.append({'task-reference': token})
|
||||
@ -309,14 +320,9 @@ def mozharness_test_on_native_engine(config, job, taskdesc):
|
||||
worker = taskdesc['worker']
|
||||
is_talos = test['suite'] == 'talos'
|
||||
|
||||
build_platform = taskdesc['attributes']['build_platform']
|
||||
build_type = taskdesc['attributes']['build_type']
|
||||
target = 'firefox-{}.en-US.{}'.format(get_firefox_version(), 'mac') \
|
||||
if build_platform == 'macosx64' and build_type == 'opt' else 'target'
|
||||
assert worker['os'] == 'macosx'
|
||||
|
||||
installer_url = get_artifact_url('<build>', mozharness['build-artifact-name'])
|
||||
test_packages_url = get_artifact_url('<build>',
|
||||
'public/build/{}.test_packages.json'.format(target))
|
||||
mozharness_url = get_artifact_url('<build>',
|
||||
'public/build/mozharness.zip')
|
||||
|
||||
@ -347,6 +353,7 @@ def mozharness_test_on_native_engine(config, job, taskdesc):
|
||||
"NO_FAIL_ON_TEST_ERRORS": '1',
|
||||
"MOZ_HIDE_RESULTS_TABLE": '1',
|
||||
"MOZ_NODE_PATH": "/usr/local/bin/node",
|
||||
'MOZ_AUTOMATION': '1',
|
||||
}
|
||||
# talos tests don't need Xvfb
|
||||
if is_talos:
|
||||
@ -362,7 +369,7 @@ def mozharness_test_on_native_engine(config, job, taskdesc):
|
||||
command.append("--no-read-buildbot-config")
|
||||
command.extend([
|
||||
{"task-reference": "--installer-url=" + installer_url},
|
||||
{"task-reference": "--test-packages-url=" + test_packages_url},
|
||||
{"task-reference": "--test-packages-url=" + test_packages_url(taskdesc)},
|
||||
])
|
||||
if mozharness.get('include-blob-upload-branch'):
|
||||
command.append('--blob-upload-branch=' + config.params['project'])
|
||||
|
@ -91,6 +91,7 @@ def docker_worker_toolchain(config, job, taskdesc):
|
||||
'MOZ_BUILD_DATE': config.params['moz_build_date'],
|
||||
'MOZ_SCM_LEVEL': config.params['level'],
|
||||
'TOOLS_DISABLE': 'true',
|
||||
'MOZ_AUTOMATION': '1',
|
||||
})
|
||||
|
||||
# tooltool downloads. By default we download using the API endpoint, but
|
||||
@ -158,6 +159,7 @@ def windows_toolchain(config, job, taskdesc):
|
||||
env.update({
|
||||
'MOZ_BUILD_DATE': config.params['moz_build_date'],
|
||||
'MOZ_SCM_LEVEL': config.params['level'],
|
||||
'MOZ_AUTOMATION': '1',
|
||||
})
|
||||
|
||||
hg = r'c:\Program Files\Mercurial\hg.exe'
|
||||
|
@ -348,7 +348,6 @@ def make_job_description(config, jobs):
|
||||
job_description = {
|
||||
'name': job['name'],
|
||||
'worker': {
|
||||
'implementation': 'docker-worker',
|
||||
'docker-image': {'in-tree': 'desktop-build'},
|
||||
'max-run-time': job['run-time'],
|
||||
'chain-of-trust': True,
|
||||
|
@ -130,6 +130,7 @@ def make_task_description(config, jobs):
|
||||
'docker-worker:relengapi-proxy:tooltool.download.public',
|
||||
'project:releng:signing:format:dmg'],
|
||||
'worker': {'implementation': 'docker-worker',
|
||||
'os': 'linux',
|
||||
'docker-image': {"in-tree": "desktop-build"},
|
||||
'caches': [{
|
||||
'type': 'persistent',
|
||||
|
@ -154,6 +154,7 @@ task_description_schema = Schema({
|
||||
# information specific to the worker implementation that will run this task
|
||||
'worker': Any({
|
||||
Required('implementation'): Any('docker-worker', 'docker-engine'),
|
||||
Required('os'): 'linux',
|
||||
|
||||
# For tasks that will run in docker-worker or docker-engine, this is the
|
||||
# name of the docker image or in-tree docker image to run the task in. If
|
||||
@ -215,9 +216,10 @@ task_description_schema = Schema({
|
||||
Optional('retry-exit-status'): int,
|
||||
|
||||
}, {
|
||||
Required('implementation'): 'generic-worker',
|
||||
Required('os'): Any('windows', 'macosx'),
|
||||
# see http://schemas.taskcluster.net/generic-worker/v1/payload.json
|
||||
# and https://docs.taskcluster.net/reference/workers/generic-worker/payload
|
||||
Required('implementation'): 'generic-worker',
|
||||
|
||||
# command is a list of commands to run, sequentially
|
||||
# on Windows, each command is a string, on OS X and Linux, each command is
|
||||
@ -308,6 +310,7 @@ task_description_schema = Schema({
|
||||
},
|
||||
}, {
|
||||
Required('implementation'): 'native-engine',
|
||||
Required('os'): Any('macosx', 'linux'),
|
||||
|
||||
# A link for an executable to download
|
||||
Optional('context'): basestring,
|
||||
@ -396,6 +399,12 @@ task_description_schema = Schema({
|
||||
Required('implementation'): 'push-apk-breakpoint',
|
||||
Required('payload'): object,
|
||||
|
||||
}, {
|
||||
Required('implementation'): 'invalid',
|
||||
# an invalid task is one which should never actually be created; this is used in
|
||||
# release automation on branches where the task just doesn't make sense
|
||||
Extra: object,
|
||||
|
||||
}, {
|
||||
Required('implementation'): 'push-apk',
|
||||
|
||||
@ -741,6 +750,11 @@ def build_push_apk_breakpoint_payload(config, task, task_def):
|
||||
task_def['payload'] = task['worker']['payload']
|
||||
|
||||
|
||||
@payload_builder('invalid')
|
||||
def build_invalid_payload(config, task, task_def):
|
||||
task_def['payload'] = 'invalid task - should never be created'
|
||||
|
||||
|
||||
@payload_builder('native-engine')
|
||||
def build_macosx_engine_payload(config, task, task_def):
|
||||
worker = task['worker']
|
||||
|
@ -38,13 +38,16 @@ import logging
|
||||
import requests
|
||||
from collections import defaultdict
|
||||
|
||||
WORKER_TYPE = {
|
||||
# default worker types keyed by instance-size
|
||||
# default worker types keyed by instance-size
|
||||
LINUX_WORKER_TYPES = {
|
||||
'large': 'aws-provisioner-v1/gecko-t-linux-large',
|
||||
'xlarge': 'aws-provisioner-v1/gecko-t-linux-xlarge',
|
||||
'legacy': 'aws-provisioner-v1/gecko-t-linux-medium',
|
||||
'default': 'aws-provisioner-v1/gecko-t-linux-large',
|
||||
# windows / os x worker types keyed by test-platform
|
||||
}
|
||||
|
||||
# windows / os x worker types keyed by test-platform
|
||||
WINDOWS_WORKER_TYPES = {
|
||||
'windows7-32-vm': 'aws-provisioner-v1/gecko-t-win7-32',
|
||||
'windows7-32': 'aws-provisioner-v1/gecko-t-win7-32-gpu',
|
||||
'windows10-64-vm': 'aws-provisioner-v1/gecko-t-win10-64',
|
||||
@ -150,23 +153,12 @@ test_description_schema = Schema({
|
||||
# unit tests on linux platforms and false otherwise
|
||||
Optional('allow-software-gl-layers'): bool,
|
||||
|
||||
# The worker implementation for this test, as dictated by policy and by the
|
||||
# test platform.
|
||||
Optional('worker-implementation'): Any(
|
||||
'docker-worker',
|
||||
'native-engine',
|
||||
'generic-worker',
|
||||
# coming soon:
|
||||
'docker-engine',
|
||||
'buildbot-bridge',
|
||||
),
|
||||
|
||||
# For tasks that will run in docker-worker or docker-engine, this is the
|
||||
# name of the docker image or in-tree docker image to run the task in. If
|
||||
# in-tree, then a dependency will be created automatically. This is
|
||||
# generally `desktop-test`, or an image that acts an awful lot like it.
|
||||
Required('docker-image', default={'in-tree': 'desktop-test'}): optionally_keyed_by(
|
||||
'test-platform', 'test-platform-phylum',
|
||||
'test-platform',
|
||||
Any(
|
||||
# a raw Docker image path (repo/image:tag)
|
||||
basestring,
|
||||
@ -193,7 +185,7 @@ test_description_schema = Schema({
|
||||
|
||||
# What to run
|
||||
Required('mozharness'): optionally_keyed_by(
|
||||
'test-platform', 'test-platform-phylum', {
|
||||
'test-platform', {
|
||||
# the mozharness script used to run this task
|
||||
Required('script'): basestring,
|
||||
|
||||
@ -427,29 +419,6 @@ def set_treeherder_machine_platform(config, tests):
|
||||
yield test
|
||||
|
||||
|
||||
@transforms.add
|
||||
def set_worker_implementation(config, tests):
|
||||
"""Set the worker implementation based on the test platform."""
|
||||
for test in tests:
|
||||
test_platform = test['test-platform']
|
||||
if test_platform.startswith('macosx'):
|
||||
if config.config['args'].taskcluster_worker:
|
||||
test['worker-implementation'] = 'native-engine'
|
||||
else:
|
||||
test['worker-implementation'] = 'generic-worker'
|
||||
elif test.get('suite', '') == 'talos':
|
||||
if config.config['args'].taskcluster_worker:
|
||||
test['worker-implementation'] = 'native-engine'
|
||||
else:
|
||||
test['worker-implementation'] = 'buildbot-bridge'
|
||||
elif test_platform.startswith('win'):
|
||||
test['worker-implementation'] = 'generic-worker'
|
||||
else:
|
||||
test['worker-implementation'] = 'docker-worker'
|
||||
|
||||
yield test
|
||||
|
||||
|
||||
@transforms.add
|
||||
def set_tier(config, tests):
|
||||
"""Set the tier based on policy for all test descriptions that do not
|
||||
@ -474,8 +443,6 @@ def set_tier(config, tests):
|
||||
'android-4.3-arm7-api-15/debug',
|
||||
'android-4.2-x86/opt']:
|
||||
test['tier'] = 1
|
||||
elif test['worker-implementation'] == 'native-engine':
|
||||
test['tier'] = 3
|
||||
else:
|
||||
test['tier'] = 2
|
||||
yield test
|
||||
@ -722,6 +689,35 @@ def parallel_stylo_tests(config, tests):
|
||||
yield test
|
||||
|
||||
|
||||
@transforms.add
|
||||
def set_worker_type(config, tests):
|
||||
"""Set the worker type based on the test platform."""
|
||||
for test in tests:
|
||||
# during the taskcluuster migration, this is a bit tortured, but it
|
||||
# will get simpler eventually!
|
||||
test_platform = test['test-platform']
|
||||
if test_platform.startswith('macosx'):
|
||||
# note that some portion of these will be allocated to BBB below
|
||||
test['worker-type'] = 'tc-worker-provisioner/gecko-t-osx-10-10'
|
||||
elif test_platform.startswith('win'):
|
||||
if test.get('suite', '') == 'talos':
|
||||
test['worker-type'] = 'buildbot-bridge/buildbot-bridge'
|
||||
else:
|
||||
test['worker-type'] = WINDOWS_WORKER_TYPES[test_platform.split('/')[0]]
|
||||
elif test_platform.startswith('linux') or test_platform.startswith('android'):
|
||||
if test.get('suite', '') == 'talos':
|
||||
if config.config['args'].taskcluster_worker:
|
||||
test['worker-type'] = 'releng-hardware/gecko-t-linux-talos'
|
||||
else:
|
||||
test['worker-type'] = 'buildbot-bridge/buildbot-bridge'
|
||||
else:
|
||||
test['worker-type'] = LINUX_WORKER_TYPES[test['instance-size']]
|
||||
else:
|
||||
raise Exception("unknown test_platform {}".format(test_platform))
|
||||
|
||||
yield test
|
||||
|
||||
|
||||
@transforms.add
|
||||
def allocate_to_bbb(config, tests):
|
||||
"""Make the load balancing between taskcluster and buildbot"""
|
||||
@ -743,7 +739,7 @@ def allocate_to_bbb(config, tests):
|
||||
if not (test_platform.startswith('mac')
|
||||
and config.config['args'].taskcluster_worker):
|
||||
for i in range(int(n * len(t)), len(t)):
|
||||
t[i]['worker-implementation'] = 'buildbot-bridge'
|
||||
t[i]['worker-type'] = 'buildbot-bridge/buildbot-bridge'
|
||||
|
||||
for y in t:
|
||||
yield y
|
||||
@ -824,29 +820,9 @@ def make_job_description(config, tests):
|
||||
run = jobdesc['run'] = {}
|
||||
run['using'] = 'mozharness-test'
|
||||
run['test'] = test
|
||||
worker = jobdesc['worker'] = {}
|
||||
implementation = worker['implementation'] = test['worker-implementation']
|
||||
|
||||
# TODO: need some better way to express this...
|
||||
if implementation == 'buildbot-bridge':
|
||||
jobdesc['worker-type'] = 'buildbot-bridge/buildbot-bridge'
|
||||
elif implementation == 'native-engine':
|
||||
if test['test-platform'].startswith('linux'):
|
||||
jobdesc['worker-type'] = 'releng-hardware/gecko-t-linux-talos'
|
||||
else:
|
||||
jobdesc['worker-type'] = 'tc-worker-provisioner/gecko-t-osx-10-10'
|
||||
elif implementation == 'generic-worker':
|
||||
test_platform = test['test-platform'].split('/')[0]
|
||||
jobdesc['worker-type'] = WORKER_TYPE[test_platform]
|
||||
elif implementation == 'docker-worker' or implementation == 'docker-engine':
|
||||
jobdesc['worker-type'] = WORKER_TYPE[test['instance-size']]
|
||||
worker = jobdesc['worker']
|
||||
worker['docker-image'] = test['docker-image']
|
||||
worker['allow-ptrace'] = True # required for all tests, for crashreporter
|
||||
worker['loopback-video'] = test['loopback-video']
|
||||
worker['loopback-audio'] = test['loopback-audio']
|
||||
worker['max-run-time'] = test['max-run-time']
|
||||
worker['retry-exit-status'] = test['retry-exit-status']
|
||||
jobdesc['worker-type'] = test.pop('worker-type')
|
||||
|
||||
yield jobdesc
|
||||
|
||||
|
||||
|
49
taskcluster/taskgraph/util/workertypes.py
Normal file
49
taskcluster/taskgraph/util/workertypes.py
Normal file
@ -0,0 +1,49 @@
|
||||
# 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/.
|
||||
|
||||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
WORKER_TYPES = {
|
||||
'aws-provisioner-v1/gecko-images': ('docker-worker', 'linux'),
|
||||
'aws-provisioner-v1/gecko-1-b-android': ('docker-worker', 'linux'),
|
||||
'aws-provisioner-v1/gecko-1-b-linux': ('docker-worker', 'linux'),
|
||||
'aws-provisioner-v1/gecko-1-b-macosx64': ('docker-worker', 'linux'),
|
||||
'aws-provisioner-v1/gecko-1-b-win2012': ('generic-worker', 'windows'),
|
||||
'aws-provisioner-v1/gecko-2-b-android': ('docker-worker', 'linux'),
|
||||
'aws-provisioner-v1/gecko-2-b-linux': ('docker-worker', 'linux'),
|
||||
'aws-provisioner-v1/gecko-2-b-macosx64': ('docker-worker', 'linux'),
|
||||
'aws-provisioner-v1/gecko-2-b-win2012': ('generic-worker', 'windows'),
|
||||
'aws-provisioner-v1/gecko-3-b-android': ('docker-worker', 'linux'),
|
||||
'aws-provisioner-v1/gecko-3-b-linux': ('docker-worker', 'linux'),
|
||||
'aws-provisioner-v1/gecko-3-b-macosx64': ('docker-worker', 'linux'),
|
||||
'aws-provisioner-v1/gecko-3-b-win2012': ('generic-worker', 'windows'),
|
||||
'aws-provisioner-v1/gecko-symbol-upload': ('docker-worker', 'linux'),
|
||||
'aws-provisioner-v1/gecko-t-linux-large': ('docker-worker', 'linux'),
|
||||
'aws-provisioner-v1/gecko-t-linux-medium': ('docker-worker', 'linux'),
|
||||
'aws-provisioner-v1/gecko-t-linux-xlarge': ('docker-worker', 'linux'),
|
||||
'aws-provisioner-v1/gecko-t-win10-64': ('generic-worker', 'windows'),
|
||||
'aws-provisioner-v1/gecko-t-win10-64-gpu': ('generic-worker', 'windows'),
|
||||
'aws-provisioner-v1/gecko-t-win7-32': ('generic-worker', 'windows'),
|
||||
'aws-provisioner-v1/gecko-t-win7-32-gpu': ('generic-worker', 'windows'),
|
||||
'aws-provisioner-v1/taskcluster-generic': ('docker-worker', 'linux'),
|
||||
'buildbot-bridge/buildbot-bridge': ('buildbot-bridge', None),
|
||||
'invalid/invalid': ('invalid', None),
|
||||
'null-provisioner/human-breakpoint': ('push-apk-breakpoint', None),
|
||||
'null-provisioner/human-breakpoint': ('push-apk-breakpoint', None),
|
||||
'releng-hardware/gecko-t-linux-talos': ('native-engine', 'linux'),
|
||||
'scriptworker-prov-v1/balrogworker-v1': ('balrog', None),
|
||||
'scriptworker-prov-v1/beetmoverworker-v1': ('beetmover', None),
|
||||
'scriptworker-prov-v1/pushapk-v1': ('push-apk', None),
|
||||
"scriptworker-prov-v1/signing-linux-v1": ('scriptworker-signing', None),
|
||||
'tc-worker-provisioner/gecko-t-osx-10-10': ('native-engine', 'macosx'),
|
||||
}
|
||||
|
||||
|
||||
def worker_type_implementation(worker_type):
|
||||
"""Get the worker implementation and OS for the given workerType, where the
|
||||
OS represents the host system, not the target OS, in the case of
|
||||
cross-compiles."""
|
||||
# assume that worker types for all levels are the same implementation
|
||||
worker_type = worker_type.replace('{level}', '1')
|
||||
return WORKER_TYPES[worker_type]
|
@ -2,8 +2,7 @@
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
function setCookie()
|
||||
{
|
||||
function setCookie() {
|
||||
var date = new Date();
|
||||
date.setDate(new Date().getDate() + 36);
|
||||
document.cookie = "litmus_1=true;expires=" + date.toGMTString();
|
||||
|
@ -6,10 +6,10 @@
|
||||
function init() {
|
||||
var result = document.getElementById("result");
|
||||
try {
|
||||
/* globals netscape */
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
result.textContent = "FAIL";
|
||||
}
|
||||
catch (ex) {
|
||||
} catch (ex) {
|
||||
result.textContent = "PASS";
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ mochikit.jar:
|
||||
content/tests/SimpleTest/MozillaLogger.js (../specialpowers/content/MozillaLogger.js)
|
||||
content/tests/SimpleTest/specialpowers.js (../specialpowers/content/specialpowers.js)
|
||||
content/tests/SimpleTest/SpecialPowersObserverAPI.js (../specialpowers/content/SpecialPowersObserverAPI.js)
|
||||
* content/tests/SimpleTest/specialpowersAPI.js (../specialpowers/content/specialpowersAPI.js)
|
||||
content/tests/SimpleTest/specialpowersAPI.js (../specialpowers/content/specialpowersAPI.js)
|
||||
content/tests/SimpleTest/setup.js (tests/SimpleTest/setup.js)
|
||||
content/tests/SimpleTest/SimpleTest.js (tests/SimpleTest/SimpleTest.js)
|
||||
content/tests/SimpleTest/StructuredLog.jsm (../modules/StructuredLog.jsm)
|
||||
|
@ -28,17 +28,17 @@ addEventListener("DOMContentLoaded", function() {
|
||||
|
||||
split_debug_onto_two_rows();
|
||||
|
||||
find_all('.col-links a.screenshot').forEach(function(elem) {
|
||||
find_all(".col-links a.screenshot").forEach(function(elem) {
|
||||
elem.addEventListener("click",
|
||||
function(event) {
|
||||
var node = elem;
|
||||
while (node && !node.classList.contains('results-table-row')) {
|
||||
while (node && !node.classList.contains("results-table-row")) {
|
||||
node = node.parentNode;
|
||||
}
|
||||
if (node != null) {
|
||||
if (node.nextSibling &&
|
||||
node.nextSibling.classList.contains("debug")) {
|
||||
var href = find('.screenshot img', node.nextSibling).src;
|
||||
var href = find(".screenshot img", node.nextSibling).src;
|
||||
window.open(href);
|
||||
}
|
||||
}
|
||||
@ -46,20 +46,20 @@ addEventListener("DOMContentLoaded", function() {
|
||||
})
|
||||
});
|
||||
|
||||
find_all('.screenshot a').forEach(function(elem) {
|
||||
find_all(".screenshot a").forEach(function(elem) {
|
||||
elem.addEventListener("click",
|
||||
function(event) {
|
||||
window.open(find('img', elem).getAttribute('src'));
|
||||
window.open(find("img", elem).getAttribute("src"));
|
||||
event.preventDefault();
|
||||
})
|
||||
});
|
||||
|
||||
find_all('.sortable').forEach(function(elem) {
|
||||
find_all(".sortable").forEach(function(elem) {
|
||||
elem.addEventListener("click",
|
||||
function(event) {
|
||||
toggle_sort_states(elem);
|
||||
var colIndex = toArray(elem.parentNode.childNodes).indexOf(elem);
|
||||
var key = elem.classList.contains('numeric') ? key_num : key_alpha;
|
||||
var key = elem.classList.contains("numeric") ? key_num : key_alpha;
|
||||
sort_table(elem, key(colIndex));
|
||||
})
|
||||
});
|
||||
@ -68,12 +68,12 @@ addEventListener("DOMContentLoaded", function() {
|
||||
|
||||
function sort_table(clicked, key_func) {
|
||||
one_row_for_data();
|
||||
var rows = find_all('.results-table-row');
|
||||
var reversed = !clicked.classList.contains('asc');
|
||||
var rows = find_all(".results-table-row");
|
||||
var reversed = !clicked.classList.contains("asc");
|
||||
|
||||
var sorted_rows = sort(rows, key_func, reversed);
|
||||
|
||||
var parent = document.getElementById('results-table-body');
|
||||
var parent = document.getElementById("results-table-body");
|
||||
sorted_rows.forEach(function(elem) {
|
||||
parent.appendChild(elem);
|
||||
});
|
||||
@ -112,10 +112,10 @@ function key_num(col_index) {
|
||||
}
|
||||
|
||||
function reset_sort_headers() {
|
||||
find_all('.sort-icon').forEach(function(elem) {
|
||||
find_all(".sort-icon").forEach(function(elem) {
|
||||
elem.remove();
|
||||
});
|
||||
find_all('.sortable').forEach(function(elem) {
|
||||
find_all(".sortable").forEach(function(elem) {
|
||||
var icon = document.createElement("div");
|
||||
icon.className = "sort-icon";
|
||||
icon.textContent = "vvv";
|
||||
@ -126,29 +126,29 @@ function reset_sort_headers() {
|
||||
}
|
||||
|
||||
function toggle_sort_states(elem) {
|
||||
//if active, toggle between asc and desc
|
||||
if (elem.classList.contains('active')) {
|
||||
elem.classList.toggle('asc');
|
||||
elem.classList.toggle('desc');
|
||||
// if active, toggle between asc and desc
|
||||
if (elem.classList.contains("active")) {
|
||||
elem.classList.toggle("asc");
|
||||
elem.classList.toggle("desc");
|
||||
}
|
||||
|
||||
//if inactive, reset all other functions and add ascending active
|
||||
if (elem.classList.contains('inactive')) {
|
||||
// if inactive, reset all other functions and add ascending active
|
||||
if (elem.classList.contains("inactive")) {
|
||||
reset_sort_headers();
|
||||
elem.classList.remove('inactive');
|
||||
elem.classList.add('active');
|
||||
elem.classList.remove("inactive");
|
||||
elem.classList.add("active");
|
||||
}
|
||||
}
|
||||
|
||||
function split_debug_onto_two_rows() {
|
||||
find_all('tr.results-table-row').forEach(function(elem) {
|
||||
find_all("tr.results-table-row").forEach(function(elem) {
|
||||
var new_row = document.createElement("tr")
|
||||
new_row.className = "debug";
|
||||
elem.parentNode.insertBefore(new_row, elem.nextSibling);
|
||||
find_all(".debug", elem).forEach(function (td_elem) {
|
||||
find_all(".debug", elem).forEach(function(td_elem) {
|
||||
if (find(".log", td_elem)) {
|
||||
new_row.appendChild(td_elem);
|
||||
td_elem.colSpan=5;
|
||||
td_elem.colSpan = 5;
|
||||
} else {
|
||||
td_elem.remove();
|
||||
}
|
||||
@ -157,10 +157,10 @@ function split_debug_onto_two_rows() {
|
||||
}
|
||||
|
||||
function one_row_for_data() {
|
||||
find_all('tr.results-table-row').forEach(function(elem) {
|
||||
if (elem.nextSibling.classList.contains('debug')) {
|
||||
find_all("tr.results-table-row").forEach(function(elem) {
|
||||
if (elem.nextSibling.classList.contains("debug")) {
|
||||
toArray(elem.nextSibling.childNodes).forEach(
|
||||
function (td_elem) {
|
||||
function(td_elem) {
|
||||
elem.appendChild(td_elem);
|
||||
})
|
||||
} else {
|
||||
|
@ -1,3 +1,4 @@
|
||||
/* globals user_pref */
|
||||
user_pref("browser.foo", "http://{server}");
|
||||
user_pref("zoom.minPercent", 30);
|
||||
user_pref("webgl.verbose", "false");
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Base preferences file used by most test harnesses
|
||||
|
||||
/* globals user_pref */
|
||||
user_pref("browser.console.showInPanel", true);
|
||||
user_pref("browser.dom.window.dump.enabled", true);
|
||||
user_pref("browser.firstrun.show.localepicker", false);
|
||||
@ -237,38 +237,38 @@ user_pref("dom.presentation.testing.simulate-receiver", false);
|
||||
|
||||
// Don't connect to Yahoo! for RSS feed tests.
|
||||
// en-US only uses .types.0.uri, but set all of them just to be sure.
|
||||
user_pref('browser.contentHandlers.types.0.uri', 'http://test1.example.org/rss?url=%%s')
|
||||
user_pref('browser.contentHandlers.types.1.uri', 'http://test1.example.org/rss?url=%%s')
|
||||
user_pref('browser.contentHandlers.types.2.uri', 'http://test1.example.org/rss?url=%%s')
|
||||
user_pref('browser.contentHandlers.types.3.uri', 'http://test1.example.org/rss?url=%%s')
|
||||
user_pref('browser.contentHandlers.types.4.uri', 'http://test1.example.org/rss?url=%%s')
|
||||
user_pref('browser.contentHandlers.types.5.uri', 'http://test1.example.org/rss?url=%%s')
|
||||
user_pref("browser.contentHandlers.types.0.uri", "http://test1.example.org/rss?url=%%s")
|
||||
user_pref("browser.contentHandlers.types.1.uri", "http://test1.example.org/rss?url=%%s")
|
||||
user_pref("browser.contentHandlers.types.2.uri", "http://test1.example.org/rss?url=%%s")
|
||||
user_pref("browser.contentHandlers.types.3.uri", "http://test1.example.org/rss?url=%%s")
|
||||
user_pref("browser.contentHandlers.types.4.uri", "http://test1.example.org/rss?url=%%s")
|
||||
user_pref("browser.contentHandlers.types.5.uri", "http://test1.example.org/rss?url=%%s")
|
||||
|
||||
// We want to collect telemetry, but we don't want to send in the results.
|
||||
user_pref('toolkit.telemetry.server', 'https://%(server)s/telemetry-dummy/');
|
||||
user_pref("toolkit.telemetry.server", "https://%(server)s/telemetry-dummy/");
|
||||
// Don't new-profile' ping on new profiles during tests, otherwise the testing framework
|
||||
// might wait on the pingsender to finish and slow down tests.
|
||||
user_pref("toolkit.telemetry.newProfilePing.enabled", false);
|
||||
|
||||
// A couple of preferences with default values to test that telemetry preference
|
||||
// watching is working.
|
||||
user_pref('toolkit.telemetry.test.pref1', true);
|
||||
user_pref('toolkit.telemetry.test.pref2', false);
|
||||
user_pref("toolkit.telemetry.test.pref1", true);
|
||||
user_pref("toolkit.telemetry.test.pref2", false);
|
||||
|
||||
// We don't want to hit the real Firefox Accounts server for tests. We don't
|
||||
// actually need a functioning FxA server, so just set it to something that
|
||||
// resolves and accepts requests, even if they all fail.
|
||||
user_pref('identity.fxaccounts.auth.uri', 'https://%(server)s/fxa-dummy/');
|
||||
user_pref("identity.fxaccounts.auth.uri", "https://%(server)s/fxa-dummy/");
|
||||
|
||||
// Ditto for all the other Firefox accounts URIs used for about:accounts et al.:
|
||||
user_pref("identity.fxaccounts.remote.signup.uri", "https://%(server)s/fxa-signup");
|
||||
user_pref("identity.fxaccounts.remote.force_auth.uri", "https://%(server)s/fxa-force-auth");
|
||||
user_pref("identity.fxaccounts.remote.signin.uri", "https://%(server)s/fxa-signin");
|
||||
user_pref("identity.fxaccounts.settings.uri", "https://%(server)s/fxa-settings");
|
||||
user_pref('identity.fxaccounts.remote.webchannel.uri', 'https://%(server)s/');
|
||||
user_pref("identity.fxaccounts.remote.webchannel.uri", "https://%(server)s/");
|
||||
|
||||
// We don't want browser tests to perform FxA device registration.
|
||||
user_pref('identity.fxaccounts.skipDeviceRegistration', true);
|
||||
user_pref("identity.fxaccounts.skipDeviceRegistration", true);
|
||||
|
||||
// Increase the APZ content response timeout in tests to 1 minute.
|
||||
// This is to accommodate the fact that test environments tends to be slower
|
||||
|
@ -21,14 +21,14 @@ Cu.forcePermissiveCOWs();
|
||||
var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
|
||||
var oldClassID = "", oldFactory = null;
|
||||
var newClassID = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator).generateUUID();
|
||||
var newFactory = function (window) {
|
||||
var newFactory = function(window) {
|
||||
return {
|
||||
createInstance: function(aOuter, aIID) {
|
||||
createInstance(aOuter, aIID) {
|
||||
if (aOuter)
|
||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||
return new MockColorPickerInstance(window).QueryInterface(aIID);
|
||||
},
|
||||
lockFactory: function(aLock) {
|
||||
lockFactory(aLock) {
|
||||
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
||||
},
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIFactory])
|
||||
@ -36,14 +36,14 @@ var newFactory = function (window) {
|
||||
}
|
||||
|
||||
this.MockColorPicker = {
|
||||
init: function(window) {
|
||||
init(window) {
|
||||
this.reset();
|
||||
this.factory = newFactory(window);
|
||||
if (!registrar.isCIDRegistered(newClassID)) {
|
||||
try {
|
||||
oldClassID = registrar.contractIDToCID(CONTRACT_ID);
|
||||
oldFactory = Cm.getClassObject(Cc[CONTRACT_ID], Ci.nsIFactory);
|
||||
} catch(ex) {
|
||||
} catch (ex) {
|
||||
oldClassID = "";
|
||||
oldFactory = null;
|
||||
dump("TEST-INFO | can't get colorpicker registered component, " +
|
||||
@ -56,14 +56,14 @@ this.MockColorPicker = {
|
||||
}
|
||||
},
|
||||
|
||||
reset: function() {
|
||||
reset() {
|
||||
this.returnColor = "";
|
||||
this.showCallback = null;
|
||||
this.shown = false;
|
||||
this.showing = false;
|
||||
},
|
||||
|
||||
cleanup: function() {
|
||||
cleanup() {
|
||||
var previousFactory = this.factory;
|
||||
this.reset();
|
||||
this.factory = null;
|
||||
@ -77,16 +77,16 @@ this.MockColorPicker = {
|
||||
|
||||
function MockColorPickerInstance(window) {
|
||||
this.window = window;
|
||||
};
|
||||
}
|
||||
MockColorPickerInstance.prototype = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIColorPicker]),
|
||||
init: function(aParent, aTitle, aInitialColor) {
|
||||
init(aParent, aTitle, aInitialColor) {
|
||||
this.parent = aParent;
|
||||
this.initialColor = aInitialColor;
|
||||
},
|
||||
initialColor: "",
|
||||
parent: null,
|
||||
open: function(aColorPickerShownCallback) {
|
||||
open(aColorPickerShownCallback) {
|
||||
MockColorPicker.showing = true;
|
||||
MockColorPicker.shown = true;
|
||||
|
||||
@ -105,7 +105,7 @@ MockColorPickerInstance.prototype = {
|
||||
} else if (typeof MockColorPicker.returnColor === "string") {
|
||||
result = MockColorPicker.returnColor;
|
||||
}
|
||||
} catch(ex) {
|
||||
} catch (ex) {
|
||||
dump("TEST-UNEXPECTED-FAIL | Exception in MockColorPicker.jsm open() " +
|
||||
"method: " + ex + "\n");
|
||||
}
|
||||
|
@ -22,14 +22,14 @@ Cu.forcePermissiveCOWs();
|
||||
var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
|
||||
var oldClassID, oldFactory;
|
||||
var newClassID = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator).generateUUID();
|
||||
var newFactory = function (window) {
|
||||
var newFactory = function(window) {
|
||||
return {
|
||||
createInstance: function(aOuter, aIID) {
|
||||
createInstance(aOuter, aIID) {
|
||||
if (aOuter)
|
||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||
return new MockFilePickerInstance(window).QueryInterface(aIID);
|
||||
},
|
||||
lockFactory: function(aLock) {
|
||||
lockFactory(aLock) {
|
||||
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
||||
},
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIFactory])
|
||||
@ -55,7 +55,7 @@ this.MockFilePicker = {
|
||||
window: null,
|
||||
pendingPromises: [],
|
||||
|
||||
init: function(window) {
|
||||
init(window) {
|
||||
this.window = window;
|
||||
|
||||
this.reset();
|
||||
@ -68,7 +68,7 @@ this.MockFilePicker = {
|
||||
}
|
||||
},
|
||||
|
||||
reset: function() {
|
||||
reset() {
|
||||
this.appendFilterCallback = null;
|
||||
this.appendFiltersCallback = null;
|
||||
this.displayDirectory = null;
|
||||
@ -83,7 +83,7 @@ this.MockFilePicker = {
|
||||
this.showing = false;
|
||||
},
|
||||
|
||||
cleanup: function() {
|
||||
cleanup() {
|
||||
var previousFactory = this.factory;
|
||||
this.reset();
|
||||
this.factory = null;
|
||||
@ -101,7 +101,7 @@ this.MockFilePicker = {
|
||||
};
|
||||
},
|
||||
|
||||
useAnyFile: function() {
|
||||
useAnyFile() {
|
||||
var file = FileUtils.getDir("TmpD", [], false);
|
||||
file.append("testfile");
|
||||
file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o644);
|
||||
@ -109,7 +109,7 @@ this.MockFilePicker = {
|
||||
.then(domFile => domFile, () => null)
|
||||
// domFile can be null.
|
||||
.then(domFile => {
|
||||
this.returnData = [this.internalFileData({ nsIFile: file, domFile: domFile })];
|
||||
this.returnData = [this.internalFileData({ nsIFile: file, domFile })];
|
||||
}).then(() => file);
|
||||
|
||||
this.pendingPromises = [promise];
|
||||
@ -118,14 +118,14 @@ this.MockFilePicker = {
|
||||
return promise;
|
||||
},
|
||||
|
||||
useBlobFile: function() {
|
||||
useBlobFile() {
|
||||
var blob = new this.window.Blob([]);
|
||||
var file = new this.window.File([blob], 'helloworld.txt', { type: 'plain/text' });
|
||||
var file = new this.window.File([blob], "helloworld.txt", { type: "plain/text" });
|
||||
this.returnData = [this.internalFileData({ domFile: file })];
|
||||
this.pendingPromises = [];
|
||||
},
|
||||
|
||||
useDirectory: function(aPath) {
|
||||
useDirectory(aPath) {
|
||||
var directory = new this.window.Directory(aPath);
|
||||
this.returnData = [this.internalFileData({ domDirectory: directory })];
|
||||
this.pendingPromises = [];
|
||||
@ -142,7 +142,7 @@ this.MockFilePicker = {
|
||||
let promise = this.window.File.createFromNsIFile(file, { existenceCheck: false });
|
||||
|
||||
promise.then(domFile => {
|
||||
this.returnData.push(this.internalFileData({ nsIFile: file, domFile: domFile }));
|
||||
this.returnData.push(this.internalFileData({ nsIFile: file, domFile }));
|
||||
});
|
||||
this.pendingPromises.push(promise);
|
||||
}
|
||||
@ -159,19 +159,19 @@ this.MockFilePicker = {
|
||||
|
||||
function MockFilePickerInstance(window) {
|
||||
this.window = window;
|
||||
};
|
||||
}
|
||||
MockFilePickerInstance.prototype = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIFilePicker]),
|
||||
init: function(aParent, aTitle, aMode) {
|
||||
init(aParent, aTitle, aMode) {
|
||||
MockFilePicker.mode = aMode;
|
||||
this.filterIndex = MockFilePicker.filterIndex;
|
||||
this.parent = aParent;
|
||||
},
|
||||
appendFilter: function(aTitle, aFilter) {
|
||||
appendFilter(aTitle, aFilter) {
|
||||
if (typeof MockFilePicker.appendFilterCallback == "function")
|
||||
MockFilePicker.appendFilterCallback(this, aTitle, aFilter);
|
||||
},
|
||||
appendFilters: function(aFilterMask) {
|
||||
appendFilters(aFilterMask) {
|
||||
if (typeof MockFilePicker.appendFiltersCallback == "function")
|
||||
MockFilePicker.appendFiltersCallback(this, aFilterMask);
|
||||
},
|
||||
@ -190,7 +190,7 @@ MockFilePickerInstance.prototype = {
|
||||
},
|
||||
|
||||
// We don't support directories here.
|
||||
get domFileOrDirectory() {
|
||||
get domFileOrDirectory() {
|
||||
if (MockFilePicker.returnData.length < 1) {
|
||||
return null;
|
||||
}
|
||||
@ -217,10 +217,10 @@ MockFilePickerInstance.prototype = {
|
||||
return {
|
||||
index: 0,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsISimpleEnumerator]),
|
||||
hasMoreElements: function() {
|
||||
hasMoreElements() {
|
||||
return this.index < MockFilePicker.returnData.length;
|
||||
},
|
||||
getNext: function() {
|
||||
getNext() {
|
||||
if (!MockFilePicker.returnData[this.index].nsIFile) {
|
||||
return null;
|
||||
}
|
||||
@ -228,16 +228,16 @@ MockFilePickerInstance.prototype = {
|
||||
}
|
||||
};
|
||||
},
|
||||
get domFileOrDirectoryEnumerator() {
|
||||
let utils = this.parent.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindowUtils);
|
||||
get domFileOrDirectoryEnumerator() {
|
||||
this.parent.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindowUtils);
|
||||
return {
|
||||
index: 0,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsISimpleEnumerator]),
|
||||
hasMoreElements: function() {
|
||||
hasMoreElements() {
|
||||
return this.index < MockFilePicker.returnData.length;
|
||||
},
|
||||
getNext: function() {
|
||||
getNext() {
|
||||
// window.File does not implement nsIFile
|
||||
if (MockFilePicker.returnData[this.index].domFile) {
|
||||
return MockFilePicker.returnData[this.index++].domFile;
|
||||
@ -251,10 +251,10 @@ MockFilePickerInstance.prototype = {
|
||||
}
|
||||
};
|
||||
},
|
||||
show: function() {
|
||||
show() {
|
||||
throw "This is not implemented";
|
||||
},
|
||||
open: function(aFilePickerShownCallback) {
|
||||
open(aFilePickerShownCallback) {
|
||||
MockFilePicker.showing = true;
|
||||
this.window.setTimeout(() => {
|
||||
// Maybe all the pending promises are already resolved, but we want to be sure.
|
||||
@ -279,7 +279,7 @@ MockFilePickerInstance.prototype = {
|
||||
if (typeof returnValue != "undefined") {
|
||||
return returnValue;
|
||||
}
|
||||
} catch(ex) {
|
||||
} catch (ex) {
|
||||
return Ci.nsIFilePicker.returnCancel;
|
||||
}
|
||||
}
|
||||
|
@ -19,19 +19,19 @@ var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
|
||||
var oldClassID, oldFactory;
|
||||
var newClassID = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator).generateUUID();
|
||||
var newFactory = {
|
||||
createInstance: function(aOuter, aIID) {
|
||||
createInstance(aOuter, aIID) {
|
||||
if (aOuter)
|
||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||
return new MockPermissionPromptInstance().QueryInterface(aIID);
|
||||
},
|
||||
lockFactory: function(aLock) {
|
||||
lockFactory(aLock) {
|
||||
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
||||
},
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIFactory])
|
||||
};
|
||||
|
||||
this.MockPermissionPrompt = {
|
||||
init: function() {
|
||||
init() {
|
||||
this.reset();
|
||||
if (!registrar.isCIDRegistered(newClassID)) {
|
||||
try {
|
||||
@ -49,11 +49,11 @@ this.MockPermissionPrompt = {
|
||||
registrar.registerFactory(newClassID, "", CONTRACT_ID, newFactory);
|
||||
}
|
||||
},
|
||||
|
||||
reset: function() {
|
||||
|
||||
reset() {
|
||||
},
|
||||
|
||||
cleanup: function() {
|
||||
|
||||
cleanup() {
|
||||
this.reset();
|
||||
if (oldFactory) {
|
||||
registrar.unregisterFactory(newClassID, newFactory);
|
||||
@ -62,13 +62,13 @@ this.MockPermissionPrompt = {
|
||||
},
|
||||
};
|
||||
|
||||
function MockPermissionPromptInstance() { };
|
||||
function MockPermissionPromptInstance() { }
|
||||
MockPermissionPromptInstance.prototype = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentPermissionPrompt]),
|
||||
|
||||
promptResult: Ci.nsIPermissionManager.UNKNOWN_ACTION,
|
||||
|
||||
prompt: function(request) {
|
||||
prompt(request) {
|
||||
|
||||
let perms = request.types.QueryInterface(Ci.nsIArray);
|
||||
for (let idx = 0; idx < perms.length; idx++) {
|
||||
@ -90,7 +90,7 @@ MockPermissionPrompt.reset();
|
||||
function exposeAll(obj) {
|
||||
var props = {};
|
||||
for (var prop in obj)
|
||||
props[prop] = 'rw';
|
||||
props[prop] = "rw";
|
||||
obj.__exposedProps__ = props;
|
||||
}
|
||||
exposeAll(MockPermissionPrompt);
|
||||
|
@ -4,28 +4,30 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
/* import-globals-from specialpowers.js */
|
||||
|
||||
function MozillaLogger(aPath) {
|
||||
}
|
||||
|
||||
function formatLogMessage(msg) {
|
||||
return msg.info.join(' ') + "\n";
|
||||
return msg.info.join(" ") + "\n";
|
||||
}
|
||||
|
||||
MozillaLogger.prototype = {
|
||||
init : function(path) {},
|
||||
init(path) {},
|
||||
|
||||
getLogCallback : function() {
|
||||
return function (msg) {
|
||||
getLogCallback() {
|
||||
return function(msg) {
|
||||
var data = formatLogMessage(msg);
|
||||
dump(data);
|
||||
};
|
||||
},
|
||||
|
||||
log : function(msg) {
|
||||
log(msg) {
|
||||
dump(msg);
|
||||
},
|
||||
|
||||
close : function() {}
|
||||
close() {}
|
||||
};
|
||||
|
||||
|
||||
@ -41,12 +43,12 @@ function SpecialPowersLogger(aPath) {
|
||||
}
|
||||
|
||||
SpecialPowersLogger.prototype = {
|
||||
init : function (path) {
|
||||
init(path) {
|
||||
SpecialPowers.setLogFile(path);
|
||||
},
|
||||
|
||||
getLogCallback : function () {
|
||||
return function (msg) {
|
||||
getLogCallback() {
|
||||
return function(msg) {
|
||||
var data = formatLogMessage(msg);
|
||||
SpecialPowers.log(data);
|
||||
|
||||
@ -56,11 +58,11 @@ SpecialPowersLogger.prototype = {
|
||||
};
|
||||
},
|
||||
|
||||
log : function (msg) {
|
||||
log(msg) {
|
||||
SpecialPowers.log(msg);
|
||||
},
|
||||
|
||||
close : function () {
|
||||
close() {
|
||||
SpecialPowers.closeLogFile();
|
||||
}
|
||||
};
|
||||
@ -82,7 +84,7 @@ function MozillaFileLogger(aPath) {
|
||||
|
||||
MozillaFileLogger.prototype = {
|
||||
|
||||
init : function (path) {
|
||||
init(path) {
|
||||
var PR_WRITE_ONLY = 0x02; // Open for writing only.
|
||||
var PR_CREATE_FILE = 0x08;
|
||||
var PR_APPEND = 0x10;
|
||||
@ -99,8 +101,8 @@ MozillaFileLogger.prototype = {
|
||||
this._converter.init(this._foStream, "UTF-8", 0, 0);
|
||||
},
|
||||
|
||||
getLogCallback : function() {
|
||||
return function (msg) {
|
||||
getLogCallback() {
|
||||
return function(msg) {
|
||||
var data = formatLogMessage(msg);
|
||||
if (MozillaFileLogger._converter) {
|
||||
this._converter.writeString(data);
|
||||
@ -112,12 +114,12 @@ MozillaFileLogger.prototype = {
|
||||
};
|
||||
},
|
||||
|
||||
log : function(msg) {
|
||||
log(msg) {
|
||||
if (this._converter) {
|
||||
this._converter.writeString(msg);
|
||||
}
|
||||
},
|
||||
close : function() {
|
||||
close() {
|
||||
if (this._converter) {
|
||||
this._converter.flush();
|
||||
this._converter.close();
|
||||
|
@ -8,11 +8,13 @@
|
||||
// https://developer.mozilla.org/en/XPCOM/XPCOM_changes_in_Gecko_1.9.3
|
||||
// https://developer.mozilla.org/en/how_to_build_an_xpcom_component_in_javascript
|
||||
|
||||
/* import-globals-from SpecialPowersObserverAPI.js */
|
||||
|
||||
var EXPORTED_SYMBOLS = ["SpecialPowersObserver", "SpecialPowersObserverFactory"];
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
Components.utils.importGlobalProperties(['File']);
|
||||
Components.utils.importGlobalProperties(["File"]);
|
||||
|
||||
if (typeof(Cc) == "undefined") {
|
||||
const Cc = Components.classes;
|
||||
@ -44,8 +46,7 @@ SpecialPowersObserver.prototype.classID = Components.ID("{59a52458-13e0-4d93-9d8
|
||||
SpecialPowersObserver.prototype.contractID = "@mozilla.org/special-powers-observer;1";
|
||||
SpecialPowersObserver.prototype.QueryInterface = XPCOMUtils.generateQI([Components.interfaces.nsIObserver]);
|
||||
|
||||
SpecialPowersObserver.prototype.observe = function(aSubject, aTopic, aData)
|
||||
{
|
||||
SpecialPowersObserver.prototype.observe = function(aSubject, aTopic, aData) {
|
||||
switch (aTopic) {
|
||||
case "chrome-document-global-created":
|
||||
this._loadFrameScript();
|
||||
@ -54,7 +55,7 @@ SpecialPowersObserver.prototype.observe = function(aSubject, aTopic, aData)
|
||||
case "http-on-modify-request":
|
||||
if (aSubject instanceof Ci.nsIChannel) {
|
||||
let uri = aSubject.URI.spec;
|
||||
this._sendAsyncMessage("specialpowers-http-notify-request", { uri: uri });
|
||||
this._sendAsyncMessage("specialpowers-http-notify-request", { uri });
|
||||
}
|
||||
break;
|
||||
|
||||
@ -64,8 +65,7 @@ SpecialPowersObserver.prototype.observe = function(aSubject, aTopic, aData)
|
||||
}
|
||||
};
|
||||
|
||||
SpecialPowersObserver.prototype._loadFrameScript = function()
|
||||
{
|
||||
SpecialPowersObserver.prototype._loadFrameScript = function() {
|
||||
if (!this._isFrameScriptLoaded) {
|
||||
// Register for any messages our API needs us to handle
|
||||
this._messageManager.addMessageListener("SPPrefService", this);
|
||||
@ -96,8 +96,7 @@ SpecialPowersObserver.prototype._loadFrameScript = function()
|
||||
}
|
||||
};
|
||||
|
||||
SpecialPowersObserver.prototype._sendAsyncMessage = function(msgname, msg)
|
||||
{
|
||||
SpecialPowersObserver.prototype._sendAsyncMessage = function(msgname, msg) {
|
||||
this._messageManager.broadcastAsyncMessage(msgname, msg);
|
||||
};
|
||||
|
||||
@ -105,8 +104,7 @@ SpecialPowersObserver.prototype._receiveMessage = function(aMessage) {
|
||||
return this._receiveMessageAPI(aMessage);
|
||||
};
|
||||
|
||||
SpecialPowersObserver.prototype.init = function()
|
||||
{
|
||||
SpecialPowersObserver.prototype.init = function() {
|
||||
var obs = Services.obs;
|
||||
obs.addObserver(this, "chrome-document-global-created");
|
||||
|
||||
@ -128,8 +126,7 @@ SpecialPowersObserver.prototype.init = function()
|
||||
this._loadFrameScript();
|
||||
};
|
||||
|
||||
SpecialPowersObserver.prototype.uninit = function()
|
||||
{
|
||||
SpecialPowersObserver.prototype.uninit = function() {
|
||||
var obs = Services.obs;
|
||||
obs.removeObserver(this, "chrome-document-global-created");
|
||||
obs.removeObserver(this, "http-on-modify-request");
|
||||
@ -195,14 +192,14 @@ SpecialPowersObserver.prototype._removeProcessCrashObservers = function() {
|
||||
SpecialPowersObserver.prototype._registerObservers = {
|
||||
_self: null,
|
||||
_topics: [],
|
||||
_add: function(topic) {
|
||||
_add(topic) {
|
||||
if (this._topics.indexOf(topic) < 0) {
|
||||
this._topics.push(topic);
|
||||
Services.obs.addObserver(this, topic);
|
||||
}
|
||||
},
|
||||
observe: function (aSubject, aTopic, aData) {
|
||||
var msg = { aData: aData };
|
||||
observe(aSubject, aTopic, aData) {
|
||||
var msg = { aData };
|
||||
switch (aTopic) {
|
||||
case "perm-changed":
|
||||
var permission = aSubject.QueryInterface(Ci.nsIPermission);
|
||||
@ -229,7 +226,7 @@ SpecialPowersObserver.prototype._registerObservers = {
|
||||
* This will get requests from our API in the window and process them in chrome for it
|
||||
**/
|
||||
SpecialPowersObserver.prototype.receiveMessage = function(aMessage) {
|
||||
switch(aMessage.name) {
|
||||
switch (aMessage.name) {
|
||||
case "SPPingService":
|
||||
if (aMessage.json.op == "ping") {
|
||||
aMessage.target
|
||||
@ -247,15 +244,15 @@ SpecialPowersObserver.prototype.receiveMessage = function(aMessage) {
|
||||
aMessage.target.focus();
|
||||
break;
|
||||
case "SpecialPowers.CreateFiles":
|
||||
let filePaths = new Array;
|
||||
let filePaths = [];
|
||||
if (!this._createdFiles) {
|
||||
this._createdFiles = new Array;
|
||||
this._createdFiles = [];
|
||||
}
|
||||
let createdFiles = this._createdFiles;
|
||||
try {
|
||||
let promises = [];
|
||||
aMessage.data.forEach(function(request) {
|
||||
const filePerms = 0666;
|
||||
const filePerms = 0666; // eslint-disable-line no-octal
|
||||
let testFile = Services.dirsvc.get("ProfD", Ci.nsIFile);
|
||||
if (request.name) {
|
||||
testFile.appendRelativePath(request.name);
|
||||
@ -299,7 +296,7 @@ SpecialPowersObserver.prototype.receiveMessage = function(aMessage) {
|
||||
break;
|
||||
case "SpecialPowers.RemoveFiles":
|
||||
if (this._createdFiles) {
|
||||
this._createdFiles.forEach(function (testFile) {
|
||||
this._createdFiles.forEach(function(testFile) {
|
||||
try {
|
||||
testFile.remove(false);
|
||||
} catch (e) {}
|
||||
@ -310,14 +307,15 @@ SpecialPowersObserver.prototype.receiveMessage = function(aMessage) {
|
||||
default:
|
||||
return this._receiveMessage(aMessage);
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SpecialPowersObserver]);
|
||||
this.SpecialPowersObserverFactory = Object.freeze({
|
||||
createInstance: function(outer, id) {
|
||||
if (outer) { throw Components.results.NS_ERROR_NO_AGGREGATION };
|
||||
createInstance(outer, id) {
|
||||
if (outer) { throw Components.results.NS_ERROR_NO_AGGREGATION }
|
||||
return new SpecialPowersObserver();
|
||||
},
|
||||
loadFactory: function(lock){},
|
||||
loadFactory(lock) {},
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIFactory])
|
||||
});
|
||||
|
@ -7,17 +7,17 @@
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
Components.utils.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
if (typeof(Ci) == 'undefined') {
|
||||
if (typeof(Ci) == "undefined") {
|
||||
var Ci = Components.interfaces;
|
||||
}
|
||||
|
||||
if (typeof(Cc) == 'undefined') {
|
||||
if (typeof(Cc) == "undefined") {
|
||||
var Cc = Components.classes;
|
||||
}
|
||||
|
||||
this.SpecialPowersError = function(aMsg) {
|
||||
Error.call(this);
|
||||
let {stack} = new Error();
|
||||
// let {stack} = new Error();
|
||||
this.message = aMsg;
|
||||
this.name = "SpecialPowersError";
|
||||
}
|
||||
@ -35,14 +35,14 @@ this.SpecialPowersObserverAPI = function SpecialPowersObserverAPI() {
|
||||
}
|
||||
|
||||
function parseKeyValuePairs(text) {
|
||||
var lines = text.split('\n');
|
||||
var lines = text.split("\n");
|
||||
var data = {};
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
if (lines[i] == '')
|
||||
if (lines[i] == "")
|
||||
continue;
|
||||
|
||||
// can't just .split() because the value might contain = characters
|
||||
let eq = lines[i].indexOf('=');
|
||||
let eq = lines[i].indexOf("=");
|
||||
if (eq != -1) {
|
||||
let [key, value] = [lines[i].substring(0, eq),
|
||||
lines[i].substring(eq + 1)];
|
||||
@ -61,7 +61,7 @@ function parseKeyValuePairsFromFile(file) {
|
||||
createInstance(Ci.nsIConverterInputStream);
|
||||
is.init(fstream, "UTF-8", 1024, Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
|
||||
var str = {};
|
||||
var contents = '';
|
||||
var contents = "";
|
||||
while (is.readString(4096, str) != 0) {
|
||||
contents += str.value;
|
||||
}
|
||||
@ -86,20 +86,20 @@ function getTestPlugin(pluginName) {
|
||||
|
||||
SpecialPowersObserverAPI.prototype = {
|
||||
|
||||
_observe: function(aSubject, aTopic, aData) {
|
||||
_observe(aSubject, aTopic, aData) {
|
||||
function addDumpIDToMessage(propertyName) {
|
||||
try {
|
||||
var id = aSubject.getPropertyAsAString(propertyName);
|
||||
} catch(ex) {
|
||||
var id = null;
|
||||
} catch (ex) {
|
||||
id = null;
|
||||
}
|
||||
if (id) {
|
||||
message.dumpIDs.push({id: id, extension: "dmp"});
|
||||
message.dumpIDs.push({id: id, extension: "extra"});
|
||||
message.dumpIDs.push({id, extension: "dmp"});
|
||||
message.dumpIDs.push({id, extension: "extra"});
|
||||
}
|
||||
}
|
||||
|
||||
switch(aTopic) {
|
||||
switch (aTopic) {
|
||||
case "plugin-crashed":
|
||||
case "ipc:content-shutdown":
|
||||
var message = { type: "crash-observed", dumpIDs: [] };
|
||||
@ -111,7 +111,7 @@ SpecialPowersObserverAPI.prototype = {
|
||||
let pluginID = aSubject.getPropertyAsAString("pluginDumpID");
|
||||
let extra = this._getExtraData(pluginID);
|
||||
if (extra && ("additional_minidumps" in extra)) {
|
||||
let dumpNames = extra.additional_minidumps.split(',');
|
||||
let dumpNames = extra.additional_minidumps.split(",");
|
||||
for (let name of dumpNames) {
|
||||
message.dumpIDs.push({id: pluginID + "-" + name, extension: "dmp"});
|
||||
}
|
||||
@ -124,7 +124,7 @@ SpecialPowersObserverAPI.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
_getCrashDumpDir: function() {
|
||||
_getCrashDumpDir() {
|
||||
if (!this._crashDumpDir) {
|
||||
this._crashDumpDir = Services.dirsvc.get("ProfD", Ci.nsIFile);
|
||||
this._crashDumpDir.append("minidumps");
|
||||
@ -132,7 +132,7 @@ SpecialPowersObserverAPI.prototype = {
|
||||
return this._crashDumpDir;
|
||||
},
|
||||
|
||||
_getPendingCrashDumpDir: function() {
|
||||
_getPendingCrashDumpDir() {
|
||||
if (!this._pendingCrashDumpDir) {
|
||||
this._pendingCrashDumpDir = Services.dirsvc.get("UAppData", Ci.nsIFile);
|
||||
this._pendingCrashDumpDir.append("Crash Reports");
|
||||
@ -141,7 +141,7 @@ SpecialPowersObserverAPI.prototype = {
|
||||
return this._pendingCrashDumpDir;
|
||||
},
|
||||
|
||||
_getExtraData: function(dumpId) {
|
||||
_getExtraData(dumpId) {
|
||||
let extraFile = this._getCrashDumpDir().clone();
|
||||
extraFile.append(dumpId + ".extra");
|
||||
if (!extraFile.exists()) {
|
||||
@ -150,7 +150,7 @@ SpecialPowersObserverAPI.prototype = {
|
||||
return parseKeyValuePairsFromFile(extraFile);
|
||||
},
|
||||
|
||||
_deleteCrashDumpFiles: function(aFilenames) {
|
||||
_deleteCrashDumpFiles(aFilenames) {
|
||||
var crashDumpDir = this._getCrashDumpDir();
|
||||
if (!crashDumpDir.exists()) {
|
||||
return false;
|
||||
@ -169,7 +169,7 @@ SpecialPowersObserverAPI.prototype = {
|
||||
return success;
|
||||
},
|
||||
|
||||
_findCrashDumpFiles: function(aToIgnore) {
|
||||
_findCrashDumpFiles(aToIgnore) {
|
||||
var crashDumpDir = this._getCrashDumpDir();
|
||||
var entries = crashDumpDir.exists() && crashDumpDir.directoryEntries;
|
||||
if (!entries) {
|
||||
@ -187,7 +187,7 @@ SpecialPowersObserverAPI.prototype = {
|
||||
return crashDumpFiles.concat();
|
||||
},
|
||||
|
||||
_deletePendingCrashDumpFiles: function() {
|
||||
_deletePendingCrashDumpFiles() {
|
||||
var crashDumpDir = this._getPendingCrashDumpDir();
|
||||
var removed = false;
|
||||
if (crashDumpDir.exists()) {
|
||||
@ -203,11 +203,11 @@ SpecialPowersObserverAPI.prototype = {
|
||||
return removed;
|
||||
},
|
||||
|
||||
_getURI: function (url) {
|
||||
_getURI(url) {
|
||||
return Services.io.newURI(url);
|
||||
},
|
||||
|
||||
_readUrlAsString: function(aUrl) {
|
||||
_readUrlAsString(aUrl) {
|
||||
// Fetch script content as we can't use scriptloader's loadSubScript
|
||||
// to evaluate http:// urls...
|
||||
var scriptableStream = Cc["@mozilla.org/scriptableinputstream;1"]
|
||||
@ -247,7 +247,7 @@ SpecialPowersObserverAPI.prototype = {
|
||||
return output;
|
||||
},
|
||||
|
||||
_sendReply: function(aMessage, aReplyName, aReplyMsg) {
|
||||
_sendReply(aMessage, aReplyName, aReplyMsg) {
|
||||
let mm = aMessage.target
|
||||
.QueryInterface(Ci.nsIFrameLoaderOwner)
|
||||
.frameLoader
|
||||
@ -255,7 +255,7 @@ SpecialPowersObserverAPI.prototype = {
|
||||
mm.sendAsyncMessage(aReplyName, aReplyMsg);
|
||||
},
|
||||
|
||||
_notifyCategoryAndObservers: function(subject, topic, data) {
|
||||
_notifyCategoryAndObservers(subject, topic, data) {
|
||||
const serviceMarker = "service,";
|
||||
|
||||
// First create observers from the category manager.
|
||||
@ -274,8 +274,7 @@ SpecialPowersObserverAPI.prototype = {
|
||||
if (contractID.substring(0, serviceMarker.length) == serviceMarker) {
|
||||
contractID = contractID.substring(serviceMarker.length);
|
||||
factoryFunction = "getService";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
factoryFunction = "createInstance";
|
||||
}
|
||||
|
||||
@ -285,7 +284,7 @@ SpecialPowersObserverAPI.prototype = {
|
||||
let observer = handler.QueryInterface(Ci.nsIObserver);
|
||||
observers.push(observer);
|
||||
}
|
||||
} catch(e) { }
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
// Next enumerate the registered observers.
|
||||
@ -299,10 +298,10 @@ SpecialPowersObserverAPI.prototype = {
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
observers.forEach(function (observer) {
|
||||
observers.forEach(function(observer) {
|
||||
try {
|
||||
observer.observe(subject, topic, data);
|
||||
} catch(e) { }
|
||||
} catch (e) { }
|
||||
});
|
||||
},
|
||||
|
||||
@ -310,11 +309,11 @@ SpecialPowersObserverAPI.prototype = {
|
||||
* messageManager callback function
|
||||
* This will get requests from our API in the window and process them in chrome for it
|
||||
**/
|
||||
_receiveMessageAPI: function(aMessage) {
|
||||
_receiveMessageAPI(aMessage) { // eslint-disable-line complexity
|
||||
// We explicitly return values in the below code so that this function
|
||||
// doesn't trigger a flurry of warnings about "does not always return
|
||||
// a value".
|
||||
switch(aMessage.name) {
|
||||
switch (aMessage.name) {
|
||||
case "SPPrefService": {
|
||||
let prefs = Services.prefs;
|
||||
let prefType = aMessage.json.prefType.toUpperCase();
|
||||
@ -329,7 +328,7 @@ SpecialPowersObserverAPI.prototype = {
|
||||
if (prefs.getPrefType(prefName) == prefs.PREF_INVALID)
|
||||
return null;
|
||||
} else if (aMessage.json.op == "set") {
|
||||
if (!prefName || !prefType || prefValue === null)
|
||||
if (!prefName || !prefType || prefValue === null)
|
||||
throw new SpecialPowersError("Invalid parameters for set in SPPrefService");
|
||||
} else if (aMessage.json.op == "clear") {
|
||||
if (!prefName)
|
||||
@ -339,27 +338,23 @@ SpecialPowersObserverAPI.prototype = {
|
||||
}
|
||||
|
||||
// Now we make the call
|
||||
switch(prefType) {
|
||||
switch (prefType) {
|
||||
case "BOOL":
|
||||
if (aMessage.json.op == "get")
|
||||
return(prefs.getBoolPref(prefName));
|
||||
else
|
||||
return(prefs.setBoolPref(prefName, prefValue));
|
||||
return (prefs.getBoolPref(prefName));
|
||||
return (prefs.setBoolPref(prefName, prefValue));
|
||||
case "INT":
|
||||
if (aMessage.json.op == "get")
|
||||
return(prefs.getIntPref(prefName));
|
||||
else
|
||||
return(prefs.setIntPref(prefName, prefValue));
|
||||
return (prefs.getIntPref(prefName));
|
||||
return (prefs.setIntPref(prefName, prefValue));
|
||||
case "CHAR":
|
||||
if (aMessage.json.op == "get")
|
||||
return(prefs.getCharPref(prefName));
|
||||
else
|
||||
return(prefs.setCharPref(prefName, prefValue));
|
||||
return (prefs.getCharPref(prefName));
|
||||
return (prefs.setCharPref(prefName, prefValue));
|
||||
case "COMPLEX":
|
||||
if (aMessage.json.op == "get")
|
||||
return(prefs.getComplexValue(prefName, prefValue[0]));
|
||||
else
|
||||
return(prefs.setComplexValue(prefName, prefValue[0], prefValue[1]));
|
||||
return (prefs.getComplexValue(prefName, prefValue[0]));
|
||||
return (prefs.setComplexValue(prefName, prefValue[0], prefValue[1]));
|
||||
case "":
|
||||
if (aMessage.json.op == "clear") {
|
||||
prefs.clearUserPref(prefName);
|
||||
@ -467,22 +462,22 @@ SpecialPowersObserverAPI.prototype = {
|
||||
.messageManager;
|
||||
sb.sendAsyncMessage = (name, message) => {
|
||||
mm.sendAsyncMessage("SPChromeScriptMessage",
|
||||
{ id: id, name: name, message: message });
|
||||
{ id, name, message });
|
||||
};
|
||||
sb.addMessageListener = (name, listener) => {
|
||||
this._chromeScriptListeners.push({ id: id, name: name, listener: listener });
|
||||
this._chromeScriptListeners.push({ id, name, listener });
|
||||
};
|
||||
sb.browserElement = aMessage.target;
|
||||
|
||||
// Also expose assertion functions
|
||||
let reporter = function (err, message, stack) {
|
||||
let reporter = function(err, message, stack) {
|
||||
// Pipe assertions back to parent process
|
||||
mm.sendAsyncMessage("SPChromeScriptAssert",
|
||||
{ id, name: scriptName, err, message,
|
||||
stack });
|
||||
};
|
||||
Object.defineProperty(sb, "assert", {
|
||||
get: function () {
|
||||
get() {
|
||||
let scope = Components.utils.createObjectIn(sb);
|
||||
Services.scriptloader.loadSubScript("chrome://specialpowers/content/Assert.jsm",
|
||||
scope);
|
||||
@ -497,7 +492,7 @@ SpecialPowersObserverAPI.prototype = {
|
||||
// Evaluate the chrome script
|
||||
try {
|
||||
Components.utils.evalInSandbox(jsScript, sb, "1.8", scriptName, 1);
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
throw new SpecialPowersError(
|
||||
"Error while executing chrome script '" + scriptName + "':\n" +
|
||||
e + "\n" +
|
||||
@ -583,6 +578,7 @@ SpecialPowersObserverAPI.prototype = {
|
||||
if (extensionData.errors.length) {
|
||||
return Promise.reject("Extension contains packaging errors");
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
},
|
||||
() => {
|
||||
@ -623,7 +619,7 @@ SpecialPowersObserverAPI.prototype = {
|
||||
|
||||
// We throw an exception before reaching this explicit return because
|
||||
// we should never be arriving here anyway.
|
||||
throw new SpecialPowersError("Unreached code");
|
||||
throw new SpecialPowersError("Unreached code"); // eslint-disable-line no-unreachable
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
|
@ -5,6 +5,9 @@
|
||||
* order to be used as a replacement for UniversalXPConnect
|
||||
*/
|
||||
|
||||
/* import-globals-from specialpowersAPI.js */
|
||||
/* globals addMessageListener, removeMessageListener, sendSyncMessage, sendAsyncMessage */
|
||||
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
function SpecialPowers(window) {
|
||||
@ -16,8 +19,8 @@ function SpecialPowers(window) {
|
||||
this._unexpectedCrashDumpFiles = { };
|
||||
this._crashDumpDir = null;
|
||||
this.DOMWindowUtils = bindDOMWindowUtils(window);
|
||||
Object.defineProperty(this, 'Components', {
|
||||
configurable: true, enumerable: true, get: function() {
|
||||
Object.defineProperty(this, "Components", {
|
||||
configurable: true, enumerable: true, get() {
|
||||
var win = this.window.get();
|
||||
if (!win)
|
||||
return null;
|
||||
@ -59,9 +62,11 @@ function SpecialPowers(window) {
|
||||
removeMessageListener("SPPingService", self._messageListener);
|
||||
removeMessageListener("SpecialPowers.FilesCreated", self._messageListener);
|
||||
removeMessageListener("SpecialPowers.FilesError", self._messageListener);
|
||||
} catch (e if e.result == Components.results.NS_ERROR_ILLEGAL_VALUE) {
|
||||
} catch (e) {
|
||||
// Ignore the exception which the message manager has been destroyed.
|
||||
;
|
||||
if (e.result != Components.results.NS_ERROR_ILLEGAL_VALUE) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}, "inner-window-destroyed");
|
||||
@ -133,20 +138,20 @@ SpecialPowers.prototype._messageReceived = function(aMessage) {
|
||||
break;
|
||||
|
||||
case "SpecialPowers.FilesCreated":
|
||||
var handler = this._createFilesOnSuccess;
|
||||
var createdHandler = this._createFilesOnSuccess;
|
||||
this._createFilesOnSuccess = null;
|
||||
this._createFilesOnError = null;
|
||||
if (handler) {
|
||||
handler(aMessage.data);
|
||||
if (createdHandler) {
|
||||
createdHandler(aMessage.data);
|
||||
}
|
||||
break;
|
||||
|
||||
case "SpecialPowers.FilesError":
|
||||
var handler = this._createFilesOnError;
|
||||
var errorHandler = this._createFilesOnError;
|
||||
this._createFilesOnSuccess = null;
|
||||
this._createFilesOnError = null;
|
||||
if (handler) {
|
||||
handler(aMessage.data);
|
||||
if (errorHandler) {
|
||||
errorHandler(aMessage.data);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -191,20 +196,20 @@ SpecialPowers.prototype.nestedFrameSetup = function() {
|
||||
// get a ref to the app <iframe>
|
||||
frameLoader.QueryInterface(Components.interfaces.nsIFrameLoader);
|
||||
let frame = frameLoader.ownerElement;
|
||||
let frameId = frame.getAttribute('id');
|
||||
let frameId = frame.getAttribute("id");
|
||||
if (frameId === "nested-parent-frame") {
|
||||
Services.obs.removeObserver(onRemoteBrowserShown, "remote-browser-shown");
|
||||
|
||||
let mm = frame.QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader.messageManager;
|
||||
self._grandChildFrameMM = mm;
|
||||
|
||||
self.SP_SYNC_MESSAGES.forEach(function (msgname) {
|
||||
mm.addMessageListener(msgname, function (msg) {
|
||||
self.SP_SYNC_MESSAGES.forEach(function(msgname) {
|
||||
mm.addMessageListener(msgname, function(msg) {
|
||||
return self._sendSyncMessage(msgname, msg.data)[0];
|
||||
});
|
||||
});
|
||||
self.SP_ASYNC_MESSAGES.forEach(function (msgname) {
|
||||
mm.addMessageListener(msgname, function (msg) {
|
||||
self.SP_ASYNC_MESSAGES.forEach(function(msgname) {
|
||||
mm.addMessageListener(msgname, function(msg) {
|
||||
self._sendAsyncMessage(msgname, msg.data);
|
||||
});
|
||||
});
|
||||
@ -243,7 +248,7 @@ function attachSpecialPowersToWindow(aWindow) {
|
||||
sp.addPermission("allowXULXBL", true, aWindow.document);
|
||||
}
|
||||
}
|
||||
} catch(ex) {
|
||||
} catch (ex) {
|
||||
dump("TEST-INFO | specialpowers.js | Failed to attach specialpowers to window exception: " + ex + "\n");
|
||||
}
|
||||
}
|
||||
@ -272,7 +277,7 @@ this.attachSpecialPowersToWindow = attachSpecialPowersToWindow;
|
||||
|
||||
// In the case of Chrome mochitests that inject specialpowers.js as
|
||||
// a regular content script
|
||||
if (typeof window != 'undefined') {
|
||||
if (typeof window != "undefined") {
|
||||
window.addMessageListener = function() {}
|
||||
window.removeMessageListener = function() {}
|
||||
window.wrappedJSObject.SpecialPowers = new SpecialPowers(window);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
specialpowers.jar:
|
||||
% content specialpowers %content/ contentaccessible=true
|
||||
content/specialpowers.js (content/specialpowers.js)
|
||||
* content/specialpowersAPI.js (content/specialpowersAPI.js)
|
||||
content/specialpowersAPI.js (content/specialpowersAPI.js)
|
||||
content/SpecialPowersObserverAPI.js (content/SpecialPowersObserverAPI.js)
|
||||
content/SpecialPowersObserver.jsm (content/SpecialPowersObserver.jsm)
|
||||
content/MozillaLogger.js (content/MozillaLogger.js)
|
||||
|
@ -1,5 +1,3 @@
|
||||
[display-none.html]
|
||||
type: testharness
|
||||
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1358668
|
||||
[Intersecting notification after first rAF.]
|
||||
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1359318
|
||||
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1359318
|
||||
|
@ -527,10 +527,6 @@ this.ExtensionData = class {
|
||||
|
||||
let whitelist = [];
|
||||
for (let perm of this.manifest.permissions) {
|
||||
if (perm == "contextualIdentities" && !Preferences.get("privacy.userContext.enabled")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (perm === "geckoProfiler") {
|
||||
const acceptedExtensions = Preferences.get("extensions.geckoProfiler.acceptedExtensionIds");
|
||||
if (!acceptedExtensions.split(",").includes(this.id)) {
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
|
||||
"resource://gre/modules/ContextualIdentityService.jsm");
|
||||
XPCOMUtils.defineLazyPreferenceGetter(this, "containersEnabled",
|
||||
"privacy.userContext.enabled");
|
||||
|
||||
function convert(identity) {
|
||||
let result = {
|
||||
@ -19,6 +21,10 @@ this.contextualIdentities = class extends ExtensionAPI {
|
||||
let self = {
|
||||
contextualIdentities: {
|
||||
get(cookieStoreId) {
|
||||
if (!containersEnabled) {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
|
||||
let containerId = getContainerForCookieStoreId(cookieStoreId);
|
||||
if (!containerId) {
|
||||
return Promise.resolve(null);
|
||||
@ -29,6 +35,10 @@ this.contextualIdentities = class extends ExtensionAPI {
|
||||
},
|
||||
|
||||
query(details) {
|
||||
if (!containersEnabled) {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
|
||||
let identities = [];
|
||||
ContextualIdentityService.getPublicIdentities().forEach(identity => {
|
||||
if (details.name &&
|
||||
@ -43,6 +53,10 @@ this.contextualIdentities = class extends ExtensionAPI {
|
||||
},
|
||||
|
||||
create(details) {
|
||||
if (!containersEnabled) {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
|
||||
let identity = ContextualIdentityService.create(details.name,
|
||||
details.icon,
|
||||
details.color);
|
||||
@ -50,6 +64,10 @@ this.contextualIdentities = class extends ExtensionAPI {
|
||||
},
|
||||
|
||||
update(cookieStoreId, details) {
|
||||
if (!containersEnabled) {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
|
||||
let containerId = getContainerForCookieStoreId(cookieStoreId);
|
||||
if (!containerId) {
|
||||
return Promise.resolve(null);
|
||||
@ -82,6 +100,10 @@ this.contextualIdentities = class extends ExtensionAPI {
|
||||
},
|
||||
|
||||
remove(cookieStoreId) {
|
||||
if (!containersEnabled) {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
|
||||
let containerId = getContainerForCookieStoreId(cookieStoreId);
|
||||
if (!containerId) {
|
||||
return Promise.resolve(null);
|
||||
|
@ -23,10 +23,26 @@ add_task(async function test_contextualIdentities_without_permissions() {
|
||||
|
||||
|
||||
add_task(async function test_contextualIdentity_no_containers() {
|
||||
function backgroundScript() {
|
||||
browser.test.assertTrue(!browser.contextualIdentities,
|
||||
"contextualIdentities API is not available when the containers are disabled");
|
||||
browser.test.notifyPass("contextualIdentities_pref");
|
||||
async function backgroundScript() {
|
||||
let ci = await browser.contextualIdentities.get("foobar");
|
||||
browser.test.assertEq(false, ci, "No identity should be returned here");
|
||||
|
||||
ci = await browser.contextualIdentities.get("firefox-container-1");
|
||||
browser.test.assertEq(false, ci, "We don't have any identity");
|
||||
|
||||
let cis = await browser.contextualIdentities.query({});
|
||||
browser.test.assertEq(false, cis, "no containers, 0 containers");
|
||||
|
||||
ci = await browser.contextualIdentities.create({name: "foobar", color: "red", icon: "icon"});
|
||||
browser.test.assertEq(false, ci, "We don't have any identity");
|
||||
|
||||
ci = await browser.contextualIdentities.update("firefox-container-1", {name: "barfoo", color: "blue", icon: "icon icon"});
|
||||
browser.test.assertEq(false, ci, "We don't have any identity");
|
||||
|
||||
ci = await browser.contextualIdentities.remove("firefox-container-1");
|
||||
browser.test.assertEq(false, ci, "We have an identity");
|
||||
|
||||
browser.test.notifyPass("contextualIdentities");
|
||||
}
|
||||
|
||||
let extension = ExtensionTestUtils.loadExtension({
|
||||
@ -39,7 +55,7 @@ add_task(async function test_contextualIdentity_no_containers() {
|
||||
Services.prefs.setBoolPref("privacy.userContext.enabled", false);
|
||||
|
||||
await extension.startup();
|
||||
await extension.awaitFinish("contextualIdentities_pref");
|
||||
await extension.awaitFinish("contextualIdentities");
|
||||
await extension.unload();
|
||||
|
||||
Services.prefs.clearUserPref("privacy.userContext.enabled");
|
||||
|
@ -1134,8 +1134,8 @@ GetShellFolderPath(KNOWNFOLDERID folder, nsAString& _retval)
|
||||
|
||||
LPITEMIDLIST pItemIDList = nullptr;
|
||||
|
||||
if (SUCCEEDED(SHGetKnownFolderIDList(folder, KF_FLAG_SIMPLE_IDLIST | KF_FLAG_DONT_VERIFY,
|
||||
NULL, &pItemIDList)) &&
|
||||
DWORD flags = KF_FLAG_SIMPLE_IDLIST | KF_FLAG_DONT_VERIFY | KF_FLAG_NO_ALIAS;
|
||||
if (SUCCEEDED(SHGetKnownFolderIDList(folder, flags, NULL, &pItemIDList)) &&
|
||||
SHGetPathFromIDListW(pItemIDList, buf)) {
|
||||
// We're going to use wcslen (wcsnlen not available in msvc7.1) so make
|
||||
// sure to null terminate.
|
||||
|
Loading…
Reference in New Issue
Block a user