Skip to content

Commit

Permalink
Bug 1620556 - Automatic code fixes for Prettier 1.19.1 upgrade. r=Sta…
Browse files Browse the repository at this point in the history
…ndard8,remote-protocol-reviewers,marionette-reviewers,webcompat-reviewers,perftest-reviewers,sparky,whimboo,denschub

Differential Revision: https://phabricator.services.mozilla.com/D66128

--HG--
extra : moz-landing-system : lando
  • Loading branch information
Mardak committed Mar 13, 2020
1 parent 68e1404 commit acb9606
Show file tree
Hide file tree
Showing 357 changed files with 2,996 additions and 1,502 deletions.
10 changes: 6 additions & 4 deletions accessible/tests/browser/fission/browser_nested_iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ addAccessibleTask(
const state = {};
nestedDocAcc.getState(state, {});
if (state.value & STATE_BUSY) {
nestedDocAcc = (await waitForEvent(
EVENT_DOCUMENT_LOAD_COMPLETE,
NESTED_IFRAME_DOC_BODY_ID
)).accessible;
nestedDocAcc = (
await waitForEvent(
EVENT_DOCUMENT_LOAD_COMPLETE,
NESTED_IFRAME_DOC_BODY_ID
)
).accessible;
}

if (gIsRemoteIframe) {
Expand Down
5 changes: 4 additions & 1 deletion accessible/tests/browser/tree/browser_aria_owns.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ addAccessibleTask(
let two = findAccessibleChildByID(accDoc, "two");

let waitfor = {
expected: [[EVENT_REORDER, "one"], [EVENT_REORDER, "two"]],
expected: [
[EVENT_REORDER, "one"],
[EVENT_REORDER, "two"],
],
};

await contentSpawnMutation(browser, waitfor, function() {
Expand Down
3 changes: 2 additions & 1 deletion accessible/tests/mochitest/pivot.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ var ObjectTraversalRule = {
var role = aAccessible.role;
if (
hasState(aAccessible, STATE_FOCUSABLE) &&
(role != ROLE_DOCUMENT && role != ROLE_INTERNAL_FRAME)
role != ROLE_DOCUMENT &&
role != ROLE_INTERNAL_FRAME
) {
rv = FILTER_IGNORE_SUBTREE | FILTER_MATCH;
} else if (
Expand Down
26 changes: 14 additions & 12 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -8050,8 +8050,8 @@ function warnAboutClosingWindow() {
// closing multiple tabs.
return (
AppConstants.platform != "macosx" ||
(isPBWindow ||
gBrowser.warnAboutClosingTabs(closingTabs, gBrowser.closingTabsEnum.ALL))
isPBWindow ||
gBrowser.warnAboutClosingTabs(closingTabs, gBrowser.closingTabsEnum.ALL)
);
}

Expand Down Expand Up @@ -8274,20 +8274,22 @@ const gAccessibilityServiceIndicator = {
if (this.enabled && accessibilityEnabled) {
this._active = true;
document.documentElement.setAttribute("accessibilitymode", "true");
[...document.querySelectorAll(".accessibility-indicator")].forEach(
indicator =>
["click", "keypress"].forEach(type =>
indicator.addEventListener(type, this)
)
[
...document.querySelectorAll(".accessibility-indicator"),
].forEach(indicator =>
["click", "keypress"].forEach(type =>
indicator.addEventListener(type, this)
)
);
} else if (this._active) {
this._active = false;
document.documentElement.removeAttribute("accessibilitymode");
[...document.querySelectorAll(".accessibility-indicator")].forEach(
indicator =>
["click", "keypress"].forEach(type =>
indicator.removeEventListener(type, this)
)
[
...document.querySelectorAll(".accessibility-indicator"),
].forEach(indicator =>
["click", "keypress"].forEach(type =>
indicator.removeEventListener(type, this)
)
);
}
},
Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/tabbrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2071,7 +2071,7 @@
// Use the JSM global to create the permanentKey, so that if the
// permanentKey is held by something after this window closes, it
// doesn't keep the window alive.
b.permanentKey = new (Cu.getGlobalForObject(Services)).Object();
b.permanentKey = new (Cu.getGlobalForObject(Services).Object)();

const defaultBrowserAttributes = {
contextmenu: "contentAreaContextMenu",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ async function requestCameraPermission(browser) {
return SpecialPowers.spawn(browser, [], () =>
content.navigator.mediaDevices
.getUserMedia({ video: true, fake: true })
.then(() => true, () => false)
.then(
() => true,
() => false
)
);
}

Expand Down
7 changes: 3 additions & 4 deletions browser/base/content/test/fullscreen/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ async function jsWindowOpen(browser, iframeId) {
let destWin = content;
if (args.iframeId) {
// Create a cross origin iframe
destWin = (await content.wrappedJSObject.createIframe(
args.iframeId,
true
)).contentWindow;
destWin = (
await content.wrappedJSObject.createIframe(args.iframeId, true)
).contentWindow;
}
// Send message to either the iframe or the current page to open a popup
await content.wrappedJSObject.sendMessage(destWin, "open");
Expand Down
5 changes: 4 additions & 1 deletion browser/base/content/test/general/browser_bug882977.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
add_task(async function() {
let homepage = "about:preferences";
await SpecialPowers.pushPrefEnv({
set: [["browser.startup.homepage", homepage], ["browser.startup.page", 1]],
set: [
["browser.startup.homepage", homepage],
["browser.startup.page", 1],
],
});

let win = OpenBrowserWindow();
Expand Down
14 changes: 8 additions & 6 deletions browser/base/content/test/performance/browser_appmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ add_task(async function() {
filter: rects =>
rects.filter(
r =>
!// We expect the menu button to get into the active state.
(
r.y1 >= menuButtonRect.top &&
r.y2 <= menuButtonRect.bottom &&
r.x1 >= menuButtonRect.left &&
r.x2 <= menuButtonRect.right
!(
// We expect the menu button to get into the active state.
(
r.y1 >= menuButtonRect.top &&
r.y2 <= menuButtonRect.bottom &&
r.x1 >= menuButtonRect.left &&
r.x2 <= menuButtonRect.right
)
)
// XXX For some reason the menu panel isn't in our screenshots,
// but that's where we actually expect many changes.
Expand Down
38 changes: 20 additions & 18 deletions browser/base/content/test/performance/browser_tabclose.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,26 @@ add_task(async function() {
filter: rects =>
rects.filter(
r =>
!// We expect all changes to be within the tab strip.
(
r.y1 >= tabStripRect.top &&
r.y2 <= tabStripRect.bottom &&
r.x1 >= tabStripRect.left &&
r.x2 <= tabStripRect.right &&
// The closed tab should disappear at the same time as the previous
// tab gets selected, causing both tab areas to change color at once:
// this should be a single rect of the width of 2 tabs, and can
// include the '+' button if it starts its animation.
((r.w > gBrowser.selectedTab.clientWidth &&
r.x2 <= newTabButtonRect.right) ||
// The '+' icon moves with an animation. At the end of the animation
// the former and new positions can touch each other causing the rect
// to have twice the icon's width.
(r.h == 14 && r.w <= 2 * 14 + kMaxEmptyPixels) ||
// We sometimes have a rect for the right most 2px of the '+' button.
(r.h == 2 && r.w == 2))
!(
// We expect all changes to be within the tab strip.
(
r.y1 >= tabStripRect.top &&
r.y2 <= tabStripRect.bottom &&
r.x1 >= tabStripRect.left &&
r.x2 <= tabStripRect.right &&
// The closed tab should disappear at the same time as the previous
// tab gets selected, causing both tab areas to change color at once:
// this should be a single rect of the width of 2 tabs, and can
// include the '+' button if it starts its animation.
((r.w > gBrowser.selectedTab.clientWidth &&
r.x2 <= newTabButtonRect.right) ||
// The '+' icon moves with an animation. At the end of the animation
// the former and new positions can touch each other causing the rect
// to have twice the icon's width.
(r.h == 14 && r.w <= 2 * 14 + kMaxEmptyPixels) ||
// We sometimes have a rect for the right most 2px of the '+' button.
(r.h == 2 && r.w == 2))
)
)
),
exceptions: [
Expand Down
28 changes: 15 additions & 13 deletions browser/base/content/test/performance/browser_tabclose_grow.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,21 @@ add_task(async function() {
filter: rects =>
rects.filter(
r =>
!// We expect plenty of changed rects within the tab strip.
(
r.y1 >= tabStripRect.top &&
r.y2 <= tabStripRect.bottom &&
r.x1 >= tabStripRect.left &&
r.x2 <= tabStripRect.right &&
// It would make sense for each rect to have a width smaller than
// a tab (ie. tabstrip.width / tabcount), but tabs are small enough
// that they sometimes get reported in the same rect.
// So we accept up to the width of n-1 tabs.
r.w <=
(gBrowser.tabs.length - 1) *
Math.ceil(tabStripRect.width / gBrowser.tabs.length)
!(
// We expect plenty of changed rects within the tab strip.
(
r.y1 >= tabStripRect.top &&
r.y2 <= tabStripRect.bottom &&
r.x1 >= tabStripRect.left &&
r.x2 <= tabStripRect.right &&
// It would make sense for each rect to have a width smaller than
// a tab (ie. tabstrip.width / tabcount), but tabs are small enough
// that they sometimes get reported in the same rect.
// So we accept up to the width of n-1 tabs.
r.w <=
(gBrowser.tabs.length - 1) *
Math.ceil(tabStripRect.width / gBrowser.tabs.length)
)
)
),
},
Expand Down
54 changes: 28 additions & 26 deletions browser/base/content/test/performance/browser_tabopen.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,32 +58,34 @@ add_task(async function() {
filter: rects =>
rects.filter(
r =>
!// We expect all changes to be within the tab strip.
(
r.y1 >= tabStripRect.top &&
r.y2 <= tabStripRect.bottom &&
r.x1 >= tabStripRect.left &&
r.x2 <= tabStripRect.right &&
// The first tab should get deselected at the same time as the next
// tab starts appearing, so we should have one rect that includes the
// first tab but is wider.
((inRange(r.w, firstTabRect.width, firstTabRect.width * 2) &&
r.x1 == firstTabRect.x) ||
// The second tab gets painted several times due to tabopen animation.
(inRange(
r.x1,
firstTabRect.right - 1, // -1 for the border on Win7
firstTabRect.right + firstTabRect.width
) &&
r.x2 < firstTabRect.right + firstTabRect.width + 25) || // The + 25 is because sometimes the '+' is in the same rect.
// The '+' icon moves with an animation. At the end of the animation
// the former and new positions can touch each other causing the rect
// to have twice the icon's width.
(r.h == 14 && r.w <= 2 * 14 + kMaxEmptyPixels) ||
// We sometimes have a rect for the right most 2px of the '+' button.
(r.h == 2 && r.w == 2) ||
// Same for the 'X' icon.
(r.h == 10 && r.w <= 2 * 10))
!(
// We expect all changes to be within the tab strip.
(
r.y1 >= tabStripRect.top &&
r.y2 <= tabStripRect.bottom &&
r.x1 >= tabStripRect.left &&
r.x2 <= tabStripRect.right &&
// The first tab should get deselected at the same time as the next
// tab starts appearing, so we should have one rect that includes the
// first tab but is wider.
((inRange(r.w, firstTabRect.width, firstTabRect.width * 2) &&
r.x1 == firstTabRect.x) ||
// The second tab gets painted several times due to tabopen animation.
(inRange(
r.x1,
firstTabRect.right - 1, // -1 for the border on Win7
firstTabRect.right + firstTabRect.width
) &&
r.x2 < firstTabRect.right + firstTabRect.width + 25) || // The + 25 is because sometimes the '+' is in the same rect.
// The '+' icon moves with an animation. At the end of the animation
// the former and new positions can touch each other causing the rect
// to have twice the icon's width.
(r.h == 14 && r.w <= 2 * 14 + kMaxEmptyPixels) ||
// We sometimes have a rect for the right most 2px of the '+' button.
(r.h == 2 && r.w == 2) ||
// Same for the 'X' icon.
(r.h == 10 && r.w <= 2 * 10))
)
)
),
exceptions: [
Expand Down
28 changes: 15 additions & 13 deletions browser/base/content/test/performance/browser_tabopen_squeeze.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,21 @@ add_task(async function() {
filter: rects =>
rects.filter(
r =>
!// We expect plenty of changed rects within the tab strip.
(
r.y1 >= tabStripRect.top &&
r.y2 <= tabStripRect.bottom &&
r.x1 >= tabStripRect.left &&
r.x2 <= tabStripRect.right &&
// It would make sense for each rect to have a width smaller than
// a tab (ie. tabstrip.width / tabcount), but tabs are small enough
// that they sometimes get reported in the same rect.
// So we accept up to the width of n-1 tabs.
r.w <=
(gBrowser.tabs.length - 1) *
Math.ceil(tabStripRect.width / gBrowser.tabs.length)
!(
// We expect plenty of changed rects within the tab strip.
(
r.y1 >= tabStripRect.top &&
r.y2 <= tabStripRect.bottom &&
r.x1 >= tabStripRect.left &&
r.x2 <= tabStripRect.right &&
// It would make sense for each rect to have a width smaller than
// a tab (ie. tabstrip.width / tabcount), but tabs are small enough
// that they sometimes get reported in the same rect.
// So we accept up to the width of n-1 tabs.
r.w <=
(gBrowser.tabs.length - 1) *
Math.ceil(tabStripRect.width / gBrowser.tabs.length)
)
)
),
exceptions: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ add_task(async function() {
filter: rects =>
rects.filter(
r =>
!// We expect plenty of changed rects within the tab strip.
(
r.y1 >= tabStripRect.top &&
r.y2 <= tabStripRect.bottom &&
r.x1 >= tabStripRect.left &&
r.x2 <= tabStripRect.right
!(
// We expect plenty of changed rects within the tab strip.
(
r.y1 >= tabStripRect.top &&
r.y2 <= tabStripRect.bottom &&
r.x1 >= tabStripRect.left &&
r.x2 <= tabStripRect.right
)
)
),
exceptions: [
Expand Down
28 changes: 15 additions & 13 deletions browser/base/content/test/performance/browser_tabswitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,21 @@ add_task(async function() {
filter: rects =>
rects.filter(
r =>
!// We expect all changes to be within the tab strip.
(
r.y1 >= tabStripRect.top &&
r.y2 <= tabStripRect.bottom &&
r.x1 >= tabStripRect.left &&
r.x2 <= tabStripRect.right &&
// The tab selection changes between 2 adjacent tabs, so we expect
// both to change color at once: this should be a single rect of the
// width of 2 tabs.
inRange(
r.w,
(origTab.clientWidth - 1) * 2, // -1 for the border on Win7
origTab.clientWidth * 2
!(
// We expect all changes to be within the tab strip.
(
r.y1 >= tabStripRect.top &&
r.y2 <= tabStripRect.bottom &&
r.x1 >= tabStripRect.left &&
r.x2 <= tabStripRect.right &&
// The tab selection changes between 2 adjacent tabs, so we expect
// both to change color at once: this should be a single rect of the
// width of 2 tabs.
inRange(
r.w,
(origTab.clientWidth - 1) * 2, // -1 for the border on Win7
origTab.clientWidth * 2
)
)
)
),
Expand Down
Loading

0 comments on commit acb9606

Please sign in to comment.