Backed out 2 changesets (bug 1864896) for causing node failures. CLOSED TREE
Backed out changeset adba0b352699 (bug 1864896) Backed out changeset 153146ce081c (bug 1864896)
This commit is contained in:
@@ -43,7 +43,7 @@ export class ASRouterChild extends JSWindowActorChild {
|
||||
});
|
||||
}
|
||||
|
||||
handleEvent() {
|
||||
handleEvent(event) {
|
||||
// DOMDocElementCreated is only used to create the actor.
|
||||
}
|
||||
|
||||
|
||||
@@ -258,7 +258,7 @@ export class ASRouterAdminInner extends React.PureComponent {
|
||||
ASRouterUtils.sendMessage({ type: "RESET_PROVIDER_PREF" });
|
||||
}
|
||||
|
||||
resetGroups() {
|
||||
resetGroups(id, value) {
|
||||
ASRouterUtils.sendMessage({
|
||||
type: "RESET_GROUPS_STATE",
|
||||
}).then(this.setStateFromParent);
|
||||
@@ -387,7 +387,7 @@ export class ASRouterAdminInner extends React.PureComponent {
|
||||
}
|
||||
|
||||
// Simulate a copy event that sets to clipboard all targeting paramters and values
|
||||
onCopyTargetingParams() {
|
||||
onCopyTargetingParams(event) {
|
||||
const stringTargetingParameters = {
|
||||
...this.state.stringTargetingParameters,
|
||||
};
|
||||
@@ -507,7 +507,7 @@ export class ASRouterAdminInner extends React.PureComponent {
|
||||
isBlocked ? null : isModified ? (
|
||||
<button
|
||||
className="button restore"
|
||||
onClick={() => this.resetJSON(msg)}
|
||||
onClick={e => this.resetJSON(msg)}
|
||||
>
|
||||
Reset
|
||||
</button>
|
||||
@@ -523,7 +523,7 @@ export class ASRouterAdminInner extends React.PureComponent {
|
||||
{isBlocked ? null : (
|
||||
<button
|
||||
className="button modify"
|
||||
onClick={() => this.modifyJson(msg)}
|
||||
onClick={e => this.modifyJson(msg)}
|
||||
>
|
||||
Modify
|
||||
</button>
|
||||
@@ -557,7 +557,7 @@ export class ASRouterAdminInner extends React.PureComponent {
|
||||
name={msg.id}
|
||||
className="general-textarea"
|
||||
disabled={isBlocked}
|
||||
onChange={() => this.handleChange(msg.id)}
|
||||
onChange={e => this.handleChange(msg.id)}
|
||||
>
|
||||
{JSON.stringify(msg, null, 2)}
|
||||
</textarea>
|
||||
@@ -647,7 +647,7 @@ export class ASRouterAdminInner extends React.PureComponent {
|
||||
</button>
|
||||
<button
|
||||
className="ASRouterButton slim button"
|
||||
onClick={() => this.resetPBJSON(msg)}
|
||||
onClick={e => this.resetPBJSON(msg)}
|
||||
>
|
||||
Reset JSON
|
||||
</button>
|
||||
@@ -698,7 +698,7 @@ export class ASRouterAdminInner extends React.PureComponent {
|
||||
<div>
|
||||
<button
|
||||
className="ASRouterButton slim"
|
||||
onClick={() => this.toggleAllMessages(messagesToShow)}
|
||||
onClick={e => this.toggleAllMessages(messagesToShow)}
|
||||
>
|
||||
Collapse/Expand All
|
||||
</button>
|
||||
@@ -1046,7 +1046,7 @@ export class ASRouterAdminInner extends React.PureComponent {
|
||||
});
|
||||
}
|
||||
|
||||
setAttribution() {
|
||||
setAttribution(e) {
|
||||
ASRouterUtils.sendMessage({
|
||||
type: "FORCE_ATTRIBUTION",
|
||||
data: this.state.attributionParameters,
|
||||
@@ -1307,7 +1307,7 @@ export class ASRouterAdminInner extends React.PureComponent {
|
||||
<h2>Messages</h2>
|
||||
<button
|
||||
className="ASRouterButton slim button"
|
||||
onClick={() => this.toggleAllMessages(messagesToShow)}
|
||||
onClick={e => this.toggleAllMessages(messagesToShow)}
|
||||
>
|
||||
Collapse/Expand All
|
||||
</button>
|
||||
@@ -1359,7 +1359,10 @@ export class ASRouterAdminInner extends React.PureComponent {
|
||||
<tbody>
|
||||
{this.state.groups &&
|
||||
this.state.groups.map(
|
||||
({ id, enabled, frequency, userPreferences = [] }) => (
|
||||
(
|
||||
{ id, enabled, frequency, userPreferences = [] },
|
||||
index
|
||||
) => (
|
||||
<Row key={id}>
|
||||
<td>
|
||||
<TogglePrefCheckbox
|
||||
|
||||
@@ -26,7 +26,7 @@ export const CopyButton = ({
|
||||
timeout.current = setTimeout(() => setCopied(false), 1500);
|
||||
}, [inputSelector, transformer]);
|
||||
return (
|
||||
<button className={className} onClick={() => onClick()} {...props}>
|
||||
<button className={className} onClick={e => onClick()} {...props}>
|
||||
{(copied && copiedLabel) || label}
|
||||
</button>
|
||||
);
|
||||
|
||||
@@ -947,7 +947,7 @@ export class _ASRouter {
|
||||
return this.state;
|
||||
}
|
||||
|
||||
async _onLocaleChanged() {
|
||||
async _onLocaleChanged(subject, topic, data) {
|
||||
await this._maybeUpdateL10nAttachment();
|
||||
}
|
||||
|
||||
@@ -1743,7 +1743,7 @@ export class _ASRouter {
|
||||
}
|
||||
// Update storage
|
||||
this._storage.set("groupImpressions", newGroupImpressions);
|
||||
return this.setState(() => ({
|
||||
return this.setState(({ groups }) => ({
|
||||
groupImpressions: newGroupImpressions,
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -576,7 +576,7 @@ const TargetingGetters = {
|
||||
lazy.fxAccounts
|
||||
.getSignedInUser()
|
||||
.then(data => resolve(!!data))
|
||||
.catch(() => resolve(false));
|
||||
.catch(e => resolve(false));
|
||||
});
|
||||
},
|
||||
get sync() {
|
||||
|
||||
@@ -446,7 +446,7 @@ export const ASRouterTriggerListeners = new Map([
|
||||
}
|
||||
},
|
||||
|
||||
observe(aSubject, aTopic) {
|
||||
observe(aSubject, aTopic, aData) {
|
||||
if (aSubject.currentURI.asciiHost === "accounts.firefox.com") {
|
||||
// Don't notify about saved logins on the FxA login origin since this
|
||||
// trigger is used to promote login Sync and getting a recommendation
|
||||
@@ -562,7 +562,7 @@ export const ASRouterTriggerListeners = new Map([
|
||||
_sessionPageLoad: 0,
|
||||
onLocationChange: null,
|
||||
|
||||
init(triggerHandler, params) {
|
||||
init(triggerHandler, params, patterns) {
|
||||
params.forEach(p => this._events.push(p));
|
||||
|
||||
if (!this._initialized) {
|
||||
@@ -610,7 +610,7 @@ export const ASRouterTriggerListeners = new Map([
|
||||
this._sessionPageLoad = 0;
|
||||
},
|
||||
|
||||
observe(aSubject, aTopic) {
|
||||
observe(aSubject, aTopic, aData) {
|
||||
switch (aTopic) {
|
||||
case "SiteProtection:ContentBlockingEvent":
|
||||
const { browser, host, event } = aSubject.wrappedJSObject;
|
||||
@@ -690,7 +690,7 @@ export const ASRouterTriggerListeners = new Map([
|
||||
this._triggerHandler = triggerHandler;
|
||||
},
|
||||
|
||||
observe(aSubject, aTopic) {
|
||||
observe(aSubject, aTopic, aData) {
|
||||
switch (aTopic) {
|
||||
case "captive-portal-login-success":
|
||||
const browser = Services.wm.getMostRecentBrowserWindow();
|
||||
|
||||
@@ -792,7 +792,7 @@ export class PageAction {
|
||||
* Respond to a user click on the recommendation by showing a doorhanger/
|
||||
* popup notification or running the action defined in the message
|
||||
*/
|
||||
async _cfrUrlbarButtonClick() {
|
||||
async _cfrUrlbarButtonClick(event) {
|
||||
const browser = this.window.gBrowser.selectedBrowser;
|
||||
if (!RecommendationMap.has(browser)) {
|
||||
// There's no recommendation for this browser, so the user shouldn't have
|
||||
|
||||
@@ -192,7 +192,7 @@ export class _FeatureCalloutBroker {
|
||||
return item;
|
||||
}
|
||||
|
||||
handleFeatureCalloutCallback(win, event) {
|
||||
handleFeatureCalloutCallback(win, event, data) {
|
||||
switch (event) {
|
||||
case "end":
|
||||
const item = this.#calloutMap.get(win);
|
||||
|
||||
@@ -123,7 +123,7 @@ export const ToastNotification = {
|
||||
}
|
||||
|
||||
let shownPromise = Promise.withResolvers();
|
||||
let obs = (subject, topic) => {
|
||||
let obs = (subject, topic, data) => {
|
||||
if (topic === "alertshow") {
|
||||
shownPromise.resolve();
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ export class _ToolbarBadgeHub {
|
||||
win.MozXULElement.insertFTLIfNeeded("browser/newtab/asrouter.ftl");
|
||||
}
|
||||
|
||||
executeAction({ id }) {
|
||||
executeAction({ id, data, message_id }) {
|
||||
switch (id) {
|
||||
case "show-whatsnew-button":
|
||||
lazy.ToolbarPanelHub.enableToolbarButton();
|
||||
|
||||
@@ -183,7 +183,7 @@ add_setup(async function () {
|
||||
// Store it in order to restore to the original value
|
||||
const { _fetchLatestAddonVersion } = CFRPageActions;
|
||||
// Prevent fetching the real addon url and making a network request
|
||||
CFRPageActions._fetchLatestAddonVersion = () => "http://example.com";
|
||||
CFRPageActions._fetchLatestAddonVersion = x => "http://example.com";
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
CFRPageActions._fetchLatestAddonVersion = _fetchLatestAddonVersion;
|
||||
|
||||
@@ -444,7 +444,7 @@ add_task(async function test_emptyMessage() {
|
||||
);
|
||||
|
||||
// Clear all messages
|
||||
ASRouter.setState(() => ({
|
||||
ASRouter.setState(state => ({
|
||||
messages: [],
|
||||
}));
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ add_task(async function return_nothing_for_no_matching_message() {
|
||||
|
||||
add_task(async function check_other_error_handling() {
|
||||
let called = false;
|
||||
function onError() {
|
||||
function onError(...args) {
|
||||
called = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ add_task(async function panel_feature_callout_anchor_open_attr() {
|
||||
|
||||
win.document.querySelector(calloutDismissSelector).click();
|
||||
},
|
||||
() => {
|
||||
(win, calloutContainer) => {
|
||||
ok(
|
||||
!anchor.hasAttribute("open"),
|
||||
"Callout container's anchor node should not have its [open] attribute set"
|
||||
|
||||
@@ -16,10 +16,10 @@ const mockIdleService = {
|
||||
},
|
||||
QueryInterface: ChromeUtils.generateQI(["nsIUserIdleService"]),
|
||||
idleTime: 1200000,
|
||||
addIdleObserver(observer) {
|
||||
addIdleObserver(observer, time) {
|
||||
this._observers.add(observer);
|
||||
},
|
||||
removeIdleObserver(observer) {
|
||||
removeIdleObserver(observer, time) {
|
||||
this._observers.delete(observer);
|
||||
},
|
||||
};
|
||||
|
||||
@@ -32,11 +32,11 @@ describe("#CachedTargetingGetter", () => {
|
||||
globals.set(
|
||||
"TargetingContext",
|
||||
class {
|
||||
static combineContexts() {
|
||||
static combineContexts(...args) {
|
||||
return sinon.stub();
|
||||
}
|
||||
|
||||
evalWithDefault() {
|
||||
evalWithDefault(expr) {
|
||||
return sinon.stub();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -554,7 +554,7 @@ describe("CFRPageActions", () => {
|
||||
);
|
||||
const htmlFooterEl = fakeRemoteL10n.createElement.args.find(
|
||||
/* eslint-disable-next-line max-nested-callbacks */
|
||||
([, , args]) =>
|
||||
([doc, el, args]) =>
|
||||
args && args.content === fakeRecommendation.content.text
|
||||
);
|
||||
assert.ok(htmlFooterEl);
|
||||
@@ -849,7 +849,7 @@ describe("CFRPageActions", () => {
|
||||
);
|
||||
const [, , headerElementArgs] = fakeRemoteL10n.createElement.args.find(
|
||||
/* eslint-disable-next-line max-nested-callbacks */
|
||||
([, , args]) => args && args.content && args.attributes
|
||||
([doc, el, args]) => args && args.content && args.attributes
|
||||
);
|
||||
assert.equal(
|
||||
headerElementArgs.content.string_id,
|
||||
@@ -872,7 +872,7 @@ describe("CFRPageActions", () => {
|
||||
);
|
||||
const [, , headerElementArgs] = fakeRemoteL10n.createElement.args.find(
|
||||
/* eslint-disable-next-line max-nested-callbacks */
|
||||
([, , args]) => args && args.content && args.attributes
|
||||
([doc, el, args]) => args && args.content && args.attributes
|
||||
);
|
||||
assert.equal(
|
||||
headerElementArgs.content.string_id,
|
||||
|
||||
@@ -392,13 +392,14 @@ describe("ToolbarPanelHub", () => {
|
||||
for (let message of messages) {
|
||||
assert.ok(
|
||||
fakeRemoteL10n.createElement.args.find(
|
||||
([, , args]) => args && args.classList === "whatsNew-message-title"
|
||||
([doc, el, args]) =>
|
||||
args && args.classList === "whatsNew-message-title"
|
||||
)
|
||||
);
|
||||
if (message.content.layout === "tracking-protections") {
|
||||
assert.ok(
|
||||
fakeRemoteL10n.createElement.args.find(
|
||||
([, , args]) =>
|
||||
([doc, el, args]) =>
|
||||
args && args.classList === "whatsNew-message-subtitle"
|
||||
)
|
||||
);
|
||||
@@ -406,13 +407,13 @@ describe("ToolbarPanelHub", () => {
|
||||
if (message.id === "WHATS_NEW_FINGERPRINTER_COUNTER_72") {
|
||||
assert.ok(
|
||||
fakeRemoteL10n.createElement.args.find(
|
||||
([, el, args]) => el === "h2" && args.content === 3
|
||||
([doc, el, args]) => el === "h2" && args.content === 3
|
||||
)
|
||||
);
|
||||
}
|
||||
assert.ok(
|
||||
fakeRemoteL10n.createElement.args.find(
|
||||
([, , args]) =>
|
||||
([doc, el, args]) =>
|
||||
args && args.classList === "whatsNew-message-content"
|
||||
)
|
||||
);
|
||||
@@ -455,9 +456,10 @@ describe("ToolbarPanelHub", () => {
|
||||
// value as the `order` field of the message
|
||||
const titleEls = fakeRemoteL10n.createElement.args
|
||||
.filter(
|
||||
([, , args]) => args && args.classList === "whatsNew-message-title"
|
||||
([doc, el, args]) =>
|
||||
args && args.classList === "whatsNew-message-title"
|
||||
)
|
||||
.map(([, , args]) => args.content);
|
||||
.map(([doc, el, args]) => args.content);
|
||||
assert.deepEqual(titleEls, [1, 2, 3]);
|
||||
});
|
||||
it("should accept string for image attributes", async () => {
|
||||
@@ -486,7 +488,7 @@ describe("ToolbarPanelHub", () => {
|
||||
await instance.renderMessages(fakeWindow, fakeDocument, "container-id");
|
||||
|
||||
const [, , args] = fakeRemoteL10n.createElement.args.find(
|
||||
([, , elArgs]) => elArgs && elArgs.attributes
|
||||
([doc, el, elArgs]) => elArgs && elArgs.attributes
|
||||
);
|
||||
assert.ok(args);
|
||||
// Currently this.state.contentArguments has 8 different entries
|
||||
@@ -508,7 +510,7 @@ describe("ToolbarPanelHub", () => {
|
||||
await instance.renderMessages(fakeWindow, fakeDocument, "container-id");
|
||||
|
||||
const dateElements = fakeRemoteL10n.createElement.args.filter(
|
||||
([, el, args]) =>
|
||||
([doc, el, args]) =>
|
||||
el === "p" && args.classList === "whatsNew-message-date"
|
||||
);
|
||||
assert.lengthOf(dateElements, uniqueDates.length);
|
||||
|
||||
@@ -105,8 +105,8 @@ const TEST_GLOBAL = {
|
||||
JSWindowActorParent,
|
||||
JSWindowActorChild,
|
||||
AboutReaderParent: {
|
||||
addMessageListener: (_messageName, _listener) => {},
|
||||
removeMessageListener: (_messageName, _listener) => {},
|
||||
addMessageListener: (messageName, listener) => {},
|
||||
removeMessageListener: (messageName, listener) => {},
|
||||
},
|
||||
AboutWelcomeTelemetry: class {
|
||||
submitGleanPingForPing() {}
|
||||
@@ -289,8 +289,8 @@ const TEST_GLOBAL = {
|
||||
},
|
||||
dump() {},
|
||||
EveryWindow: {
|
||||
registerCallback: (_id, _init, _uninit) => {},
|
||||
unregisterCallback: _id => {},
|
||||
registerCallback: (id, init, uninit) => {},
|
||||
unregisterCallback: id => {},
|
||||
},
|
||||
setTimeout: window.setTimeout.bind(window),
|
||||
clearTimeout: window.clearTimeout.bind(window),
|
||||
@@ -410,7 +410,7 @@ const TEST_GLOBAL = {
|
||||
},
|
||||
urlFormatter: { formatURL: str => str, formatURLPref: str => str },
|
||||
mm: {
|
||||
addMessageListener: (_msg, _cb) => this.receiveMessage(),
|
||||
addMessageListener: (msg, cb) => this.receiveMessage(),
|
||||
removeMessageListener() {},
|
||||
},
|
||||
obs: {
|
||||
@@ -420,7 +420,7 @@ const TEST_GLOBAL = {
|
||||
},
|
||||
telemetry: {
|
||||
setEventRecordingEnabled: () => {},
|
||||
recordEvent: _eventDetails => {},
|
||||
recordEvent: eventDetails => {},
|
||||
scalarSet: () => {},
|
||||
keyedScalarAdd: () => {},
|
||||
},
|
||||
@@ -578,7 +578,7 @@ const TEST_GLOBAL = {
|
||||
finish: () => {},
|
||||
},
|
||||
Sampling: {
|
||||
ratioSample(_seed, _ratios) {
|
||||
ratioSample(seed, ratios) {
|
||||
return Promise.resolve(0);
|
||||
},
|
||||
},
|
||||
|
||||
@@ -339,7 +339,7 @@ export const AboutHomeStartupCacheChild = {
|
||||
});
|
||||
},
|
||||
|
||||
observe(subject, topic) {
|
||||
observe(subject, topic, data) {
|
||||
if (topic === "memory-pressure" && this._cacheWorker) {
|
||||
this._cacheWorker.terminate();
|
||||
this._cacheWorker = null;
|
||||
@@ -447,7 +447,7 @@ class BaseAboutNewTabService {
|
||||
return this.defaultURL;
|
||||
}
|
||||
|
||||
aboutHomeChannel() {
|
||||
aboutHomeChannel(uri, loadInfo) {
|
||||
throw Components.Exception(
|
||||
"AboutHomeChannel not implemented for this process.",
|
||||
Cr.NS_ERROR_NOT_IMPLEMENTED
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
return ["fluent-remote-id"];
|
||||
}
|
||||
|
||||
attributeChangedCallback() {
|
||||
attributeChangedCallback(name, oldValue, newValue) {
|
||||
this.render();
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ export class ContextMenuButton extends React.PureComponent {
|
||||
this.onUpdate = this.onUpdate.bind(this);
|
||||
}
|
||||
|
||||
openContextMenu(isKeyBoard) {
|
||||
openContextMenu(isKeyBoard, event) {
|
||||
if (this.props.onUpdate) {
|
||||
this.props.onUpdate(true);
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ export class DiscoveryStreamAdminUI extends React.PureComponent {
|
||||
);
|
||||
}
|
||||
|
||||
restorePrefDefaults() {
|
||||
restorePrefDefaults(event) {
|
||||
this.props.dispatch(
|
||||
ac.OnlyToMain({
|
||||
type: at.DISCOVERY_STREAM_CONFIG_RESET_DEFAULTS,
|
||||
|
||||
@@ -110,7 +110,7 @@ export class _DiscoveryStreamBase extends React.PureComponent {
|
||||
});
|
||||
}
|
||||
|
||||
renderComponent(component) {
|
||||
renderComponent(component, embedWidth) {
|
||||
switch (component.type) {
|
||||
case "Highlights":
|
||||
return <Highlights />;
|
||||
|
||||
@@ -31,7 +31,11 @@ export function DSSubHeader({ children }) {
|
||||
);
|
||||
}
|
||||
|
||||
export function OnboardingExperience({ dispatch, windowObj = global }) {
|
||||
export function OnboardingExperience({
|
||||
children,
|
||||
dispatch,
|
||||
windowObj = global,
|
||||
}) {
|
||||
const [dismissed, setDismissed] = useState(false);
|
||||
const [maxHeight, setMaxHeight] = useState(null);
|
||||
const heightElement = useRef(null);
|
||||
|
||||
@@ -85,6 +85,7 @@ export const DefaultMeta = ({
|
||||
sponsor,
|
||||
sponsored_by_override,
|
||||
saveToPocketCard,
|
||||
isRecentSave,
|
||||
ctaButtonVariant,
|
||||
}) => (
|
||||
<div className="meta">
|
||||
@@ -182,7 +183,7 @@ export class _DSCard extends React.PureComponent {
|
||||
];
|
||||
}
|
||||
|
||||
onLinkClick() {
|
||||
onLinkClick(event) {
|
||||
if (this.props.dispatch) {
|
||||
this.props.dispatch(
|
||||
ac.DiscoveryStreamUserEvent({
|
||||
@@ -222,7 +223,7 @@ export class _DSCard extends React.PureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
onSaveClick() {
|
||||
onSaveClick(event) {
|
||||
if (this.props.dispatch) {
|
||||
this.props.dispatch(
|
||||
ac.AlsoToMain({
|
||||
@@ -525,4 +526,4 @@ export const DSCard = connect(state => ({
|
||||
DiscoveryStream: state.DiscoveryStream,
|
||||
}))(_DSCard);
|
||||
|
||||
export const PlaceholderDSCard = () => <DSCard placeholder={true} />;
|
||||
export const PlaceholderDSCard = props => <DSCard placeholder={true} />;
|
||||
|
||||
@@ -17,7 +17,7 @@ export class DSPrivacyModal extends React.PureComponent {
|
||||
this.onManageLinkClick = this.onManageLinkClick.bind(this);
|
||||
}
|
||||
|
||||
onLearnLinkClick() {
|
||||
onLearnLinkClick(event) {
|
||||
this.props.dispatch(
|
||||
ac.DiscoveryStreamUserEvent({
|
||||
event: "CLICK_PRIVACY_INFO",
|
||||
@@ -26,7 +26,7 @@ export class DSPrivacyModal extends React.PureComponent {
|
||||
);
|
||||
}
|
||||
|
||||
onManageLinkClick() {
|
||||
onManageLinkClick(event) {
|
||||
this.props.dispatch(ac.OnlyToMain({ type: at.SETTINGS_OPEN }));
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ export class ErrorBoundary extends React.PureComponent {
|
||||
this.state = { hasError: false };
|
||||
}
|
||||
|
||||
componentDidCatch() {
|
||||
componentDidCatch(error, info) {
|
||||
this.setState({ hasError: true });
|
||||
}
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ export class _TopSites extends React.PureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
export const TopSites = connect(state => ({
|
||||
export const TopSites = connect((state, props) => ({
|
||||
TopSites: state.TopSites,
|
||||
Prefs: state.Prefs,
|
||||
TopSitesRows: state.Prefs.values.topSitesRows,
|
||||
|
||||
@@ -44,7 +44,7 @@ function mergeStateReducer(mainReducer) {
|
||||
/**
|
||||
* messageMiddleware - Middleware that looks for SentToMain type actions, and sends them if necessary
|
||||
*/
|
||||
const messageMiddleware = () => next => action => {
|
||||
const messageMiddleware = store => next => action => {
|
||||
const skipLocal = action.meta && action.meta.skipLocal;
|
||||
if (au.isSendToMain(action)) {
|
||||
RPMSendAsyncMessage(OUTGOING_MESSAGE_NAME, action);
|
||||
|
||||
@@ -25,7 +25,7 @@ const _OpenInPrivateWindow = site => ({
|
||||
export const LinkMenuOptions = {
|
||||
Separator: () => ({ type: "separator" }),
|
||||
EmptyItem: () => ({ type: "empty" }),
|
||||
ShowPrivacyInfo: () => ({
|
||||
ShowPrivacyInfo: site => ({
|
||||
id: "newtab-menu-show-privacy-info",
|
||||
icon: "info",
|
||||
action: {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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/. */
|
||||
|
||||
export const selectLayoutRender = ({ state = {}, prefs = {} }) => {
|
||||
export const selectLayoutRender = ({ state = {}, prefs = {}, locale = "" }) => {
|
||||
const { layout, feeds, spocs } = state;
|
||||
let spocIndexPlacementMap = {};
|
||||
|
||||
|
||||
@@ -682,7 +682,7 @@ class DiscoveryStreamAdminUI extends (external_React_default()).PureComponent {
|
||||
}
|
||||
}));
|
||||
}
|
||||
restorePrefDefaults() {
|
||||
restorePrefDefaults(event) {
|
||||
this.props.dispatch(actionCreators.OnlyToMain({
|
||||
type: actionTypes.DISCOVERY_STREAM_CONFIG_RESET_DEFAULTS
|
||||
}));
|
||||
@@ -1423,7 +1423,7 @@ const LinkMenuOptions = {
|
||||
EmptyItem: () => ({
|
||||
type: "empty"
|
||||
}),
|
||||
ShowPrivacyInfo: () => ({
|
||||
ShowPrivacyInfo: site => ({
|
||||
id: "newtab-menu-show-privacy-info",
|
||||
icon: "info",
|
||||
action: {
|
||||
@@ -1820,7 +1820,7 @@ class ContextMenuButton extends (external_React_default()).PureComponent {
|
||||
this.onKeyDown = this.onKeyDown.bind(this);
|
||||
this.onUpdate = this.onUpdate.bind(this);
|
||||
}
|
||||
openContextMenu(isKeyBoard) {
|
||||
openContextMenu(isKeyBoard, event) {
|
||||
if (this.props.onUpdate) {
|
||||
this.props.onUpdate(true);
|
||||
}
|
||||
@@ -2517,6 +2517,7 @@ const DefaultMeta = ({
|
||||
sponsor,
|
||||
sponsored_by_override,
|
||||
saveToPocketCard,
|
||||
isRecentSave,
|
||||
ctaButtonVariant
|
||||
}) => /*#__PURE__*/external_React_default().createElement("div", {
|
||||
className: "meta"
|
||||
@@ -2591,7 +2592,7 @@ class _DSCard extends (external_React_default()).PureComponent {
|
||||
height: 101
|
||||
}];
|
||||
}
|
||||
onLinkClick() {
|
||||
onLinkClick(event) {
|
||||
if (this.props.dispatch) {
|
||||
this.props.dispatch(actionCreators.DiscoveryStreamUserEvent({
|
||||
event: "CLICK",
|
||||
@@ -2623,7 +2624,7 @@ class _DSCard extends (external_React_default()).PureComponent {
|
||||
}));
|
||||
}
|
||||
}
|
||||
onSaveClick() {
|
||||
onSaveClick(event) {
|
||||
if (this.props.dispatch) {
|
||||
this.props.dispatch(actionCreators.AlsoToMain({
|
||||
type: actionTypes.SAVE_TO_POCKET,
|
||||
@@ -2873,7 +2874,7 @@ const DSCard = (0,external_ReactRedux_namespaceObject.connect)(state => ({
|
||||
App: state.App,
|
||||
DiscoveryStream: state.DiscoveryStream
|
||||
}))(_DSCard);
|
||||
const PlaceholderDSCard = () => /*#__PURE__*/external_React_default().createElement(DSCard, {
|
||||
const PlaceholderDSCard = props => /*#__PURE__*/external_React_default().createElement(DSCard, {
|
||||
placeholder: true
|
||||
});
|
||||
;// CONCATENATED MODULE: ./content-src/components/DiscoveryStreamComponents/DSEmptyState/DSEmptyState.jsx
|
||||
@@ -3162,6 +3163,7 @@ function DSSubHeader({
|
||||
}, children));
|
||||
}
|
||||
function OnboardingExperience({
|
||||
children,
|
||||
dispatch,
|
||||
windowObj = __webpack_require__.g
|
||||
}) {
|
||||
@@ -3774,7 +3776,7 @@ class ErrorBoundary extends (external_React_default()).PureComponent {
|
||||
hasError: false
|
||||
};
|
||||
}
|
||||
componentDidCatch() {
|
||||
componentDidCatch(error, info) {
|
||||
this.setState({
|
||||
hasError: true
|
||||
});
|
||||
@@ -4011,13 +4013,13 @@ class DSPrivacyModal extends (external_React_default()).PureComponent {
|
||||
this.onLearnLinkClick = this.onLearnLinkClick.bind(this);
|
||||
this.onManageLinkClick = this.onManageLinkClick.bind(this);
|
||||
}
|
||||
onLearnLinkClick() {
|
||||
onLearnLinkClick(event) {
|
||||
this.props.dispatch(actionCreators.DiscoveryStreamUserEvent({
|
||||
event: "CLICK_PRIVACY_INFO",
|
||||
source: "DS_PRIVACY_MODAL"
|
||||
}));
|
||||
}
|
||||
onManageLinkClick() {
|
||||
onManageLinkClick(event) {
|
||||
this.props.dispatch(actionCreators.OnlyToMain({
|
||||
type: actionTypes.SETTINGS_OPEN
|
||||
}));
|
||||
@@ -7535,7 +7537,7 @@ class _TopSites extends (external_React_default()).PureComponent {
|
||||
}))))));
|
||||
}
|
||||
}
|
||||
const TopSites_TopSites = (0,external_ReactRedux_namespaceObject.connect)(state => ({
|
||||
const TopSites_TopSites = (0,external_ReactRedux_namespaceObject.connect)((state, props) => ({
|
||||
TopSites: state.TopSites,
|
||||
Prefs: state.Prefs,
|
||||
TopSitesRows: state.Prefs.values.topSitesRows
|
||||
@@ -8037,7 +8039,8 @@ class SectionTitle extends (external_React_default()).PureComponent {
|
||||
|
||||
const selectLayoutRender = ({
|
||||
state = {},
|
||||
prefs = {}
|
||||
prefs = {},
|
||||
locale = ""
|
||||
}) => {
|
||||
const {
|
||||
layout,
|
||||
@@ -8320,7 +8323,7 @@ class _DiscoveryStreamBase extends (external_React_default()).PureComponent {
|
||||
});
|
||||
});
|
||||
}
|
||||
renderComponent(component) {
|
||||
renderComponent(component, embedWidth) {
|
||||
switch (component.type) {
|
||||
case "Highlights":
|
||||
return /*#__PURE__*/external_React_default().createElement(Highlights, null);
|
||||
@@ -9403,7 +9406,7 @@ function mergeStateReducer(mainReducer) {
|
||||
/**
|
||||
* messageMiddleware - Middleware that looks for SentToMain type actions, and sends them if necessary
|
||||
*/
|
||||
const messageMiddleware = () => next => action => {
|
||||
const messageMiddleware = store => next => action => {
|
||||
const skipLocal = action.meta && action.meta.skipLocal;
|
||||
if (actionUtils.isSendToMain(action)) {
|
||||
RPMSendAsyncMessage(OUTGOING_MESSAGE_NAME, action);
|
||||
|
||||
@@ -306,7 +306,7 @@ export const PREFS_CONFIG = new Map([
|
||||
"discoverystream.config",
|
||||
{
|
||||
title: "Configuration for the new pocket new tab",
|
||||
getValue: () => {
|
||||
getValue: ({ geo, locale }) => {
|
||||
return JSON.stringify({
|
||||
api_key_pref: "extensions.pocket.oAuthConsumerKey",
|
||||
collapsible: true,
|
||||
@@ -689,7 +689,7 @@ export class ActivityStream {
|
||||
}
|
||||
}
|
||||
|
||||
observe(subject, topic) {
|
||||
observe(subject, topic, data) {
|
||||
switch (topic) {
|
||||
case "intl:app-locales-changed":
|
||||
case lazy.Region.REGION_TOPIC:
|
||||
|
||||
@@ -67,7 +67,7 @@ export class ActivityStreamMessageChannel {
|
||||
* @param {object} store A redux store
|
||||
* @return {function} Redux middleware
|
||||
*/
|
||||
middleware() {
|
||||
middleware(store) {
|
||||
return next => action => {
|
||||
const skipMain = action.meta && action.meta.skipMain;
|
||||
if (au.isSendToOneContent(action)) {
|
||||
|
||||
@@ -331,7 +331,7 @@ export class DiscoveryStreamFeed {
|
||||
},
|
||||
});
|
||||
},
|
||||
error() {},
|
||||
error(error) {},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
||||
const DOWNLOAD_CHANGED_DELAY_TIME = 1000; // time in ms to delay timer for downloads changed events
|
||||
|
||||
export class DownloadsManager {
|
||||
constructor() {
|
||||
constructor(store) {
|
||||
this._downloadData = null;
|
||||
this._store = null;
|
||||
this._downloadItems = new Map();
|
||||
|
||||
@@ -161,7 +161,7 @@ export class RecipeExecutor {
|
||||
* Config:
|
||||
* Not configurable
|
||||
*/
|
||||
conditionallyNmfTag(item) {
|
||||
conditionallyNmfTag(item, config) {
|
||||
let nestedNmfTags = {};
|
||||
let parentTags = {};
|
||||
let parentWeights = {};
|
||||
@@ -1052,7 +1052,7 @@ export class RecipeExecutor {
|
||||
} else if (config.operation === "overwrite") {
|
||||
op = (a, b) => b;
|
||||
} else if (config.operation === "count") {
|
||||
op = a => a + 1;
|
||||
op = (a, b) => a + 1;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ export class PrefsFeed {
|
||||
/**
|
||||
* Handler for when experiment data updates.
|
||||
*/
|
||||
onExperimentUpdated() {
|
||||
onExperimentUpdated(event, reason) {
|
||||
const value = lazy.NimbusFeatures.newtab.getAllVariables() || {};
|
||||
this.store.dispatch(
|
||||
ac.BroadcastToContent({
|
||||
@@ -238,7 +238,7 @@ export class PrefsFeed {
|
||||
}
|
||||
}
|
||||
|
||||
observe(subject, topic) {
|
||||
observe(subject, topic, data) {
|
||||
switch (topic) {
|
||||
case lazy.Region.REGION_TOPIC:
|
||||
this.store.dispatch(
|
||||
|
||||
@@ -242,7 +242,7 @@ export class RecommendationProvider {
|
||||
);
|
||||
}
|
||||
|
||||
async observe(subject, topic) {
|
||||
async observe(subject, topic, data) {
|
||||
switch (topic) {
|
||||
case "idle-daily":
|
||||
await this.updatePersonalizationScores();
|
||||
|
||||
@@ -31,7 +31,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
||||
* `${feed_pref_name}.options`.
|
||||
*/
|
||||
|
||||
const BUILT_IN_SECTIONS = ({ pocketNewtab }) => ({
|
||||
const BUILT_IN_SECTIONS = ({ newtab, pocketNewtab }) => ({
|
||||
"feeds.section.topstories": options => ({
|
||||
id: "topstories",
|
||||
pref: {
|
||||
@@ -107,7 +107,7 @@ const BUILT_IN_SECTIONS = ({ pocketNewtab }) => ({
|
||||
shouldSendImpressionStats: true,
|
||||
dedupeFrom: ["highlights"],
|
||||
}),
|
||||
"feeds.section.highlights": () => ({
|
||||
"feeds.section.highlights": options => ({
|
||||
id: "highlights",
|
||||
pref: {
|
||||
titleString: {
|
||||
|
||||
@@ -144,7 +144,7 @@ export class Store {
|
||||
this._messageChannel.simulateMessagesForExistingTabs();
|
||||
}
|
||||
|
||||
async _initIndexedDB() {
|
||||
async _initIndexedDB(telemetryKey) {
|
||||
// "snippets" is the name of one storage space, but these days it is used
|
||||
// not for snippet-related data (snippets were removed in bug 1715158),
|
||||
// but storage for impression or session data for all ASRouter messages.
|
||||
|
||||
@@ -165,7 +165,7 @@ class TopSitesTelemetry {
|
||||
{},
|
||||
...Object.entries(this.allSponsoredTiles)
|
||||
.filter(
|
||||
([, v]) =>
|
||||
([k, v]) =>
|
||||
v.display_fail_reason === null ||
|
||||
v.display_fail_reason === undefined
|
||||
)
|
||||
@@ -196,8 +196,8 @@ class TopSitesTelemetry {
|
||||
|
||||
clearTilesForProvider(provider) {
|
||||
Object.entries(this.allSponsoredTiles)
|
||||
.filter(([k]) => k.startsWith(provider))
|
||||
.map(([k]) => delete this.allSponsoredTiles[k]);
|
||||
.filter(([k, v]) => k.startsWith(provider))
|
||||
.map(([k, v]) => delete this.allSponsoredTiles[k]);
|
||||
}
|
||||
|
||||
_getAdvertiser(tile) {
|
||||
|
||||
@@ -187,7 +187,7 @@ add_task(async function test_newtab_doesnt_send_nimbus() {
|
||||
let { sessions } =
|
||||
AboutNewTab.activityStream.store.feeds.get("feeds.telemetry");
|
||||
return !Array.from(sessions.entries()).filter(
|
||||
([, v]) => v.session_id === sessionId
|
||||
([k, v]) => v.session_id === sessionId
|
||||
).length;
|
||||
}, "Waiting for sessions to clean up.");
|
||||
// Session ended without a ping being sent. Success!
|
||||
|
||||
@@ -143,7 +143,7 @@ export const UTSessionPing = Joi.array().items(
|
||||
eventsTelemetryExtraKeys
|
||||
);
|
||||
|
||||
export function chaiAssertions(_chai) {
|
||||
export function chaiAssertions(_chai, utils) {
|
||||
const { Assertion } = _chai;
|
||||
|
||||
Assertion.addMethod("validate", function (schema, schemaName) {
|
||||
|
||||
@@ -146,7 +146,7 @@ describe("AboutPreferences Feed", () => {
|
||||
},
|
||||
},
|
||||
createProcessingInstruction: sandbox.stub(),
|
||||
createElementNS: sandbox.stub().callsFake(() => node),
|
||||
createElementNS: sandbox.stub().callsFake((NS, el) => node),
|
||||
getElementById: sandbox.stub().returns(node),
|
||||
insertBefore: sandbox.stub().returnsArg(0),
|
||||
querySelector: sandbox
|
||||
|
||||
@@ -417,11 +417,13 @@ describe("ActivityStream", () => {
|
||||
clock = sinon.useFakeTimers();
|
||||
|
||||
// Have addObserver cause prefHasUserValue to now return true then observe
|
||||
sandbox.stub(global.Services.obs, "addObserver").callsFake(() => {
|
||||
setTimeout(() => {
|
||||
Services.obs.notifyObservers("US", "browser-region-updated");
|
||||
sandbox
|
||||
.stub(global.Services.obs, "addObserver")
|
||||
.callsFake((pref, obs) => {
|
||||
setTimeout(() => {
|
||||
Services.obs.notifyObservers("US", "browser-region-updated");
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
afterEach(() => clock.restore());
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ describe("Personality Provider", () => {
|
||||
RemoteSettingsOffStub = sandbox.stub().returns();
|
||||
RemoteSettingsGetStub = sandbox.stub().returns([]);
|
||||
|
||||
RemoteSettingsStub = () => ({
|
||||
RemoteSettingsStub = name => ({
|
||||
get: RemoteSettingsGetStub,
|
||||
on: RemoteSettingsOnStub,
|
||||
off: RemoteSettingsOffStub,
|
||||
@@ -142,7 +142,7 @@ describe("Personality Provider", () => {
|
||||
},
|
||||
]);
|
||||
sinon.spy(instance, "getAttachment");
|
||||
RemoteSettingsStub = () => ({
|
||||
RemoteSettingsStub = name => ({
|
||||
get: RemoteSettingsGetStub,
|
||||
on: RemoteSettingsOnStub,
|
||||
off: RemoteSettingsOffStub,
|
||||
|
||||
@@ -6,7 +6,7 @@ class MockTagger {
|
||||
this.mode = mode;
|
||||
this.tagScoreMap = tagScoreMap;
|
||||
}
|
||||
tagTokens() {
|
||||
tagTokens(tokens) {
|
||||
if (this.mode === "nb") {
|
||||
// eslint-disable-next-line prefer-destructuring
|
||||
let tag = Object.keys(this.tagScoreMap)[0];
|
||||
|
||||
@@ -97,8 +97,8 @@ const TEST_GLOBAL = {
|
||||
JSWindowActorParent,
|
||||
JSWindowActorChild,
|
||||
AboutReaderParent: {
|
||||
addMessageListener: (_messageName, _listener) => {},
|
||||
removeMessageListener: (_messageName, _listener) => {},
|
||||
addMessageListener: (messageName, listener) => {},
|
||||
removeMessageListener: (messageName, listener) => {},
|
||||
},
|
||||
AboutWelcomeTelemetry: class {
|
||||
submitGleanPingForPing() {}
|
||||
@@ -281,8 +281,8 @@ const TEST_GLOBAL = {
|
||||
},
|
||||
dump() {},
|
||||
EveryWindow: {
|
||||
registerCallback: (_id, _init, _uninit) => {},
|
||||
unregisterCallback: _id => {},
|
||||
registerCallback: (id, init, uninit) => {},
|
||||
unregisterCallback: id => {},
|
||||
},
|
||||
setTimeout: window.setTimeout.bind(window),
|
||||
clearTimeout: window.clearTimeout.bind(window),
|
||||
@@ -402,7 +402,7 @@ const TEST_GLOBAL = {
|
||||
},
|
||||
urlFormatter: { formatURL: str => str, formatURLPref: str => str },
|
||||
mm: {
|
||||
addMessageListener: (_msg, _cb) => this.receiveMessage(),
|
||||
addMessageListener: (msg, cb) => this.receiveMessage(),
|
||||
removeMessageListener() {},
|
||||
},
|
||||
obs: {
|
||||
@@ -412,7 +412,7 @@ const TEST_GLOBAL = {
|
||||
},
|
||||
telemetry: {
|
||||
setEventRecordingEnabled: () => {},
|
||||
recordEvent: _eventDetails => {},
|
||||
recordEvent: eventDetails => {},
|
||||
scalarSet: () => {},
|
||||
keyedScalarAdd: () => {},
|
||||
},
|
||||
@@ -570,7 +570,7 @@ const TEST_GLOBAL = {
|
||||
finish: () => {},
|
||||
},
|
||||
Sampling: {
|
||||
ratioSample(_seed, _ratios) {
|
||||
ratioSample(seed, ratios) {
|
||||
return Promise.resolve(0);
|
||||
},
|
||||
},
|
||||
|
||||
@@ -176,7 +176,7 @@ export class FakensIPrefBranch {
|
||||
prefHasUserValue(prefName) {
|
||||
return this.prefs.has(prefName);
|
||||
}
|
||||
prefIsLocked(_prefName) {
|
||||
prefIsLocked(prefName) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -187,7 +187,7 @@ export class FakensIPrefBranch {
|
||||
*/
|
||||
export class FakensIPrefService extends FakensIPrefBranch {
|
||||
getBranch() {}
|
||||
getDefaultBranch(_prefix) {
|
||||
getDefaultBranch(prefix) {
|
||||
return {
|
||||
setBoolPref() {},
|
||||
setIntPref() {},
|
||||
@@ -208,8 +208,8 @@ export class FakePrefs extends FakensIPrefBranch {
|
||||
ignore(prefName, callback) {
|
||||
super.removeObserver(prefName, callback);
|
||||
}
|
||||
observeBranch(_listener) {}
|
||||
ignoreBranch(_listener) {}
|
||||
observeBranch(listener) {}
|
||||
ignoreBranch(listener) {}
|
||||
set(prefName, value) {
|
||||
this.prefs.set(prefName, value);
|
||||
|
||||
@@ -312,7 +312,7 @@ FakePerformance.prototype = {
|
||||
return 10000.234;
|
||||
},
|
||||
// XXX assumes type == "mark"
|
||||
getEntriesByName(name, _type) {
|
||||
getEntriesByName(name, type) {
|
||||
if (this.marks.has(name)) {
|
||||
return this.marks.get(name);
|
||||
}
|
||||
|
||||
@@ -424,7 +424,7 @@ add_task(async function test_onAction_OPEN_LINK() {
|
||||
data: { url: "https://foo.com" },
|
||||
_target: {
|
||||
browser: {
|
||||
ownerGlobal: { openTrustedLinkIn, whereToOpenLink: () => "current" },
|
||||
ownerGlobal: { openTrustedLinkIn, whereToOpenLink: e => "current" },
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -450,7 +450,7 @@ add_task(async function test_onAction_OPEN_LINK_referrer() {
|
||||
data: { url: "https://foo.com", referrer: "https://foo.com/ref" },
|
||||
_target: {
|
||||
browser: {
|
||||
ownerGlobal: { openTrustedLinkIn, whereToOpenLink: () => "tab" },
|
||||
ownerGlobal: { openTrustedLinkIn, whereToOpenLink: e => "tab" },
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -496,7 +496,7 @@ add_task(async function test_onAction_OPEN_LINK_typed_bonus() {
|
||||
},
|
||||
_target: {
|
||||
browser: {
|
||||
ownerGlobal: { openTrustedLinkIn, whereToOpenLink: () => "tab" },
|
||||
ownerGlobal: { openTrustedLinkIn, whereToOpenLink: e => "tab" },
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -524,7 +524,7 @@ add_task(async function test_onAction_OPEN_LINK_pocket() {
|
||||
},
|
||||
_target: {
|
||||
browser: {
|
||||
ownerGlobal: { openTrustedLinkIn, whereToOpenLink: () => "current" },
|
||||
ownerGlobal: { openTrustedLinkIn, whereToOpenLink: e => "current" },
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -551,7 +551,7 @@ add_task(async function test_onAction_OPEN_LINK_not_http() {
|
||||
data: { url: "file:///foo.com" },
|
||||
_target: {
|
||||
browser: {
|
||||
ownerGlobal: { openTrustedLinkIn, whereToOpenLink: () => "current" },
|
||||
ownerGlobal: { openTrustedLinkIn, whereToOpenLink: e => "current" },
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -41,7 +41,7 @@ add_task(async function test_messagechannel() {
|
||||
let sandbox = sinon.createSandbox();
|
||||
sandbox
|
||||
.stub(ActivityStreamMessageChannel.prototype, "middleware")
|
||||
.returns(() => next => action => next(action));
|
||||
.returns(s => next => action => next(action));
|
||||
let store = new Store();
|
||||
|
||||
info(
|
||||
|
||||
@@ -123,7 +123,7 @@ let gContainersPane = {
|
||||
this.openPreferenceDialog(button.getAttribute("value"));
|
||||
},
|
||||
|
||||
onAddButtonCommand() {
|
||||
onAddButtonCommand(button) {
|
||||
this.openPreferenceDialog(null);
|
||||
},
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ let gAddEngineDialog = {
|
||||
document.addEventListener("dialogaccept", this.onAddEngine.bind(this));
|
||||
},
|
||||
|
||||
async onAddEngine() {
|
||||
async onAddEngine(event) {
|
||||
let url = document
|
||||
.getElementById("engineUrl")
|
||||
.value.replace(/%s/, "{searchTerms}");
|
||||
|
||||
@@ -26,28 +26,28 @@ var gBlocklistManager = {
|
||||
return "";
|
||||
},
|
||||
|
||||
isSeparator() {
|
||||
isSeparator(index) {
|
||||
return false;
|
||||
},
|
||||
isSorted() {
|
||||
return false;
|
||||
},
|
||||
isContainer() {
|
||||
isContainer(index) {
|
||||
return false;
|
||||
},
|
||||
setTree() {},
|
||||
getImageSrc() {},
|
||||
setTree(tree) {},
|
||||
getImageSrc(row, column) {},
|
||||
getCellValue(row, column) {
|
||||
if (column.id == "selectionCol") {
|
||||
return gBlocklistManager._blockLists[row].selected;
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
cycleHeader() {},
|
||||
getRowProperties() {
|
||||
cycleHeader(column) {},
|
||||
getRowProperties(row) {
|
||||
return "";
|
||||
},
|
||||
getColumnProperties() {
|
||||
getColumnProperties(column) {
|
||||
return "";
|
||||
},
|
||||
getCellProperties(row, column) {
|
||||
|
||||
@@ -58,7 +58,7 @@ var gClearSiteDataDialog = {
|
||||
);
|
||||
},
|
||||
|
||||
onCheckboxCommand() {
|
||||
onCheckboxCommand(event) {
|
||||
this._dialog.setAttribute(
|
||||
"buttondisabledaccept",
|
||||
!(this._clearSiteDataCheckbox.checked || this._clearCacheCheckbox.checked)
|
||||
|
||||
@@ -88,7 +88,7 @@ let gContainersManager = {
|
||||
this._dialog.setAttribute("buttondisabledaccept", !name.value.trim());
|
||||
},
|
||||
|
||||
createIconButtons() {
|
||||
createIconButtons(defaultIcon) {
|
||||
let radiogroup = document.createXULElement("radiogroup");
|
||||
radiogroup.setAttribute("id", "icon");
|
||||
radiogroup.className = "icon-buttons radio-buttons";
|
||||
@@ -116,7 +116,7 @@ let gContainersManager = {
|
||||
return radiogroup;
|
||||
},
|
||||
|
||||
createColorSwatches() {
|
||||
createColorSwatches(defaultColor) {
|
||||
let radiogroup = document.createXULElement("radiogroup");
|
||||
radiogroup.setAttribute("id", "color");
|
||||
radiogroup.className = "radio-buttons";
|
||||
|
||||
@@ -46,29 +46,29 @@ Tree.prototype = {
|
||||
get rowCount() {
|
||||
return this._data.length;
|
||||
},
|
||||
getCellText(aRow) {
|
||||
getCellText(aRow, aColumn) {
|
||||
return this._data[aRow];
|
||||
},
|
||||
isSeparator() {
|
||||
isSeparator(aIndex) {
|
||||
return false;
|
||||
},
|
||||
isSorted() {
|
||||
return false;
|
||||
},
|
||||
isContainer() {
|
||||
isContainer(aIndex) {
|
||||
return false;
|
||||
},
|
||||
setTree() {},
|
||||
getImageSrc() {},
|
||||
getCellValue() {},
|
||||
cycleHeader() {},
|
||||
getRowProperties() {
|
||||
setTree(aTree) {},
|
||||
getImageSrc(aRow, aColumn) {},
|
||||
getCellValue(aRow, aColumn) {},
|
||||
cycleHeader(column) {},
|
||||
getRowProperties(row) {
|
||||
return "";
|
||||
},
|
||||
getColumnProperties() {
|
||||
getColumnProperties(column) {
|
||||
return "";
|
||||
},
|
||||
getCellProperties() {
|
||||
getCellProperties(row, column) {
|
||||
return "";
|
||||
},
|
||||
QueryInterface: ChromeUtils.generateQI(["nsITreeView"]),
|
||||
|
||||
@@ -60,29 +60,29 @@ Tree.prototype = {
|
||||
get rowCount() {
|
||||
return this._data.length;
|
||||
},
|
||||
getCellText(aRow) {
|
||||
getCellText(aRow, aColumn) {
|
||||
return this._data[aRow];
|
||||
},
|
||||
isSeparator() {
|
||||
isSeparator(aIndex) {
|
||||
return false;
|
||||
},
|
||||
isSorted() {
|
||||
return false;
|
||||
},
|
||||
isContainer() {
|
||||
isContainer(aIndex) {
|
||||
return false;
|
||||
},
|
||||
setTree() {},
|
||||
getImageSrc() {},
|
||||
getCellValue() {},
|
||||
cycleHeader() {},
|
||||
getRowProperties() {
|
||||
setTree(aTree) {},
|
||||
getImageSrc(aRow, aColumn) {},
|
||||
getCellValue(aRow, aColumn) {},
|
||||
cycleHeader(column) {},
|
||||
getRowProperties(row) {
|
||||
return "";
|
||||
},
|
||||
getColumnProperties() {
|
||||
getColumnProperties(column) {
|
||||
return "";
|
||||
},
|
||||
getCellProperties() {
|
||||
getCellProperties(row, column) {
|
||||
return "";
|
||||
},
|
||||
QueryInterface: ChromeUtils.generateQI(["nsITreeView"]),
|
||||
|
||||
@@ -882,7 +882,7 @@ var gMainPane = {
|
||||
this.readBrowserContainersCheckbox();
|
||||
},
|
||||
|
||||
async onGetStarted() {
|
||||
async onGetStarted(aEvent) {
|
||||
if (!AppConstants.MOZ_DEV_EDITION) {
|
||||
return;
|
||||
}
|
||||
@@ -1983,7 +1983,7 @@ var gMainPane = {
|
||||
}
|
||||
},
|
||||
|
||||
async checkBrowserContainers() {
|
||||
async checkBrowserContainers(event) {
|
||||
let checkbox = document.getElementById("browserContainersCheckbox");
|
||||
if (checkbox.checked) {
|
||||
Services.prefs.setBoolPref("privacy.userContext.enabled", true);
|
||||
@@ -2138,7 +2138,7 @@ var gMainPane = {
|
||||
})().catch(console.error);
|
||||
},
|
||||
|
||||
onMigrationButtonCommand() {
|
||||
onMigrationButtonCommand(command) {
|
||||
// Even though we're going to be showing the migration wizard here in
|
||||
// about:preferences, we'll delegate the call to
|
||||
// `MigrationUtils.showMigrationWizard`, as this will allow us to
|
||||
@@ -2291,7 +2291,7 @@ var gMainPane = {
|
||||
}
|
||||
},
|
||||
|
||||
updatePerformanceSettingsBox() {
|
||||
updatePerformanceSettingsBox({ duringChangeEvent }) {
|
||||
let defaultPerformancePref = Preferences.get(
|
||||
"browser.preferences.defaultPerformanceSettings.enabled"
|
||||
);
|
||||
@@ -4209,7 +4209,7 @@ const AppearanceChooser = {
|
||||
this._update();
|
||||
},
|
||||
|
||||
observe() {
|
||||
observe(subject, topic, data) {
|
||||
this._update();
|
||||
},
|
||||
|
||||
|
||||
@@ -475,7 +475,7 @@ async function spotlight(subcategory, category) {
|
||||
}
|
||||
}
|
||||
|
||||
async function scrollAndHighlight(subcategory) {
|
||||
async function scrollAndHighlight(subcategory, category) {
|
||||
let element = document.querySelector(`[data-subcategory="${subcategory}"]`);
|
||||
if (!element) {
|
||||
return;
|
||||
@@ -643,7 +643,7 @@ async function ensureScrollPadding() {
|
||||
let stickyContainer = document.querySelector(".sticky-container");
|
||||
let height = await window.browsingContext.topChromeWindow
|
||||
.promiseDocumentFlushed(() => stickyContainer.clientHeight)
|
||||
.catch(() => Cu.reportError); // Can reject if the window goes away.
|
||||
.catch(err => Cu.reportError); // Can reject if the window goes away.
|
||||
|
||||
// Make it a bit more, to ensure focus rectangles etc. don't get cut off.
|
||||
// This being 8px causes us to end up with 90px if the policies container
|
||||
|
||||
@@ -435,7 +435,7 @@ var gPrivacyPane = {
|
||||
);
|
||||
|
||||
let trackingProtectionObserver = {
|
||||
observe() {
|
||||
observe(subject, topic, data) {
|
||||
gPrivacyPane._updateTrackingProtectionUI();
|
||||
},
|
||||
};
|
||||
@@ -3317,7 +3317,7 @@ var gPrivacyPane = {
|
||||
* Initialize the opt-out-study preference checkbox into about:preferences and
|
||||
* handles events coming from the UI for it.
|
||||
*/
|
||||
initOptOutStudyCheckbox() {
|
||||
initOptOutStudyCheckbox(doc) {
|
||||
// The checkbox should be disabled if any of the below are true. This
|
||||
// prevents the user from changing the value in the box.
|
||||
//
|
||||
@@ -3361,7 +3361,7 @@ var gPrivacyPane = {
|
||||
});
|
||||
},
|
||||
|
||||
observe(aSubject, aTopic) {
|
||||
observe(aSubject, aTopic, aData) {
|
||||
switch (aTopic) {
|
||||
case "sitedatamanager:updating-sites":
|
||||
// While updating, we want to disable this section and display loading message until updated
|
||||
|
||||
@@ -496,7 +496,7 @@ var gSearchPane = {
|
||||
* @param {boolean} isPrivate
|
||||
* True if we are dealing with the default engine for private mode.
|
||||
*/
|
||||
async _buildEngineDropDown(list, currentEngine) {
|
||||
async _buildEngineDropDown(list, currentEngine, isPrivate) {
|
||||
// If the current engine isn't in the list any more, select the first item.
|
||||
let engines = gEngineView._engineStore._engines;
|
||||
if (!engines.length) {
|
||||
@@ -1231,7 +1231,7 @@ EngineView.prototype = {
|
||||
},
|
||||
|
||||
selection: null,
|
||||
getRowProperties() {
|
||||
getRowProperties(index) {
|
||||
return "";
|
||||
},
|
||||
getCellProperties(index, column) {
|
||||
@@ -1245,31 +1245,31 @@ EngineView.prototype = {
|
||||
}
|
||||
return "";
|
||||
},
|
||||
getColumnProperties() {
|
||||
getColumnProperties(column) {
|
||||
return "";
|
||||
},
|
||||
isContainer() {
|
||||
isContainer(index) {
|
||||
return false;
|
||||
},
|
||||
isContainerOpen() {
|
||||
isContainerOpen(index) {
|
||||
return false;
|
||||
},
|
||||
isContainerEmpty() {
|
||||
isContainerEmpty(index) {
|
||||
return false;
|
||||
},
|
||||
isSeparator() {
|
||||
isSeparator(index) {
|
||||
return false;
|
||||
},
|
||||
isSorted() {
|
||||
isSorted(index) {
|
||||
return false;
|
||||
},
|
||||
getParentIndex() {
|
||||
getParentIndex(index) {
|
||||
return -1;
|
||||
},
|
||||
hasNextSibling() {
|
||||
hasNextSibling(parentIndex, index) {
|
||||
return false;
|
||||
},
|
||||
getLevel() {
|
||||
getLevel(index) {
|
||||
return 0;
|
||||
},
|
||||
getCellValue(index, column) {
|
||||
@@ -1282,10 +1282,10 @@ EngineView.prototype = {
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
toggleOpenState() {},
|
||||
cycleHeader() {},
|
||||
toggleOpenState(index) {},
|
||||
cycleHeader(column) {},
|
||||
selectionChanged() {},
|
||||
cycleCell() {},
|
||||
cycleCell(row, column) {},
|
||||
isEditable(index, column) {
|
||||
return (
|
||||
column.id != "engineName" &&
|
||||
|
||||
@@ -69,7 +69,7 @@ var gSyncPane = {
|
||||
xps.ensureLoaded();
|
||||
},
|
||||
|
||||
_showLoadPage() {
|
||||
_showLoadPage(xps) {
|
||||
let maybeAcct = false;
|
||||
let username = Services.prefs.getCharPref("services.sync.username", "");
|
||||
if (username) {
|
||||
|
||||
@@ -109,7 +109,7 @@ add_task(async function () {
|
||||
win.FontBuilder._enumerator = {
|
||||
_list: ["MockedFont1", "MockedFont2", "MockedFont3"],
|
||||
_defaultFont: null,
|
||||
EnumerateFontsAsync() {
|
||||
EnumerateFontsAsync(lang, type) {
|
||||
return Promise.resolve(this._list);
|
||||
},
|
||||
EnumerateAllFontsAsync() {
|
||||
|
||||
@@ -194,7 +194,7 @@ function assertTelemetryRecorded(events) {
|
||||
|
||||
// Only look at the related events after stripping the timestamp and category.
|
||||
let relatedEvents = snapshot.parent
|
||||
.filter(([, category]) => category == TELEMETRY_CATEGORY)
|
||||
.filter(([timestamp, category]) => category == TELEMETRY_CATEGORY)
|
||||
.map(relatedEvent => relatedEvent.slice(2, 6));
|
||||
|
||||
// Events are now an array of: method, object[, value[, extra]] as expected.
|
||||
@@ -297,7 +297,7 @@ add_task(async function testDisabledBrowserLanguages() {
|
||||
// Search for more languages.
|
||||
available.menupopup.lastElementChild.doCommand();
|
||||
available.menupopup.hidePopup();
|
||||
await waitForMutation(available.menupopup, { childList: true }, () =>
|
||||
await waitForMutation(available.menupopup, { childList: true }, target =>
|
||||
Array.from(available.menupopup.children).some(
|
||||
locale => locale.value == "pl"
|
||||
)
|
||||
@@ -352,7 +352,7 @@ add_task(async function testReorderingBrowserLanguages() {
|
||||
// Install all the available langpacks.
|
||||
let langpacks = await createTestLangpacks();
|
||||
let addons = await Promise.all(
|
||||
langpacks.map(async ([, file]) => {
|
||||
langpacks.map(async ([locale, file]) => {
|
||||
let install = await AddonTestUtils.promiseInstallFile(file);
|
||||
return install.addon;
|
||||
})
|
||||
@@ -458,7 +458,7 @@ add_task(async function testAddAndRemoveSelectedLanguages() {
|
||||
|
||||
let langpacks = await createTestLangpacks();
|
||||
let addons = await Promise.all(
|
||||
langpacks.map(async ([, file]) => {
|
||||
langpacks.map(async ([locale, file]) => {
|
||||
let install = await AddonTestUtils.promiseInstallFile(file);
|
||||
return install.addon;
|
||||
})
|
||||
@@ -603,7 +603,7 @@ add_task(async function testInstallFromAMO() {
|
||||
await waitForMutation(
|
||||
available.menupopup,
|
||||
{ childList: true },
|
||||
() => available.itemCount > 1
|
||||
target => available.itemCount > 1
|
||||
);
|
||||
}
|
||||
|
||||
@@ -685,7 +685,7 @@ add_task(async function testInstallFromAMO() {
|
||||
await waitForMutation(
|
||||
available.menupopup,
|
||||
{ childList: true },
|
||||
() => available.itemCount > 1
|
||||
target => available.itemCount > 1
|
||||
);
|
||||
}
|
||||
assertLocaleOrder(selected, "en-US");
|
||||
@@ -793,7 +793,7 @@ add_task(async function testReorderMainPane() {
|
||||
|
||||
let langpacks = await createTestLangpacks();
|
||||
let addons = await Promise.all(
|
||||
langpacks.map(async ([, file]) => {
|
||||
langpacks.map(async ([locale, file]) => {
|
||||
let install = await AddonTestUtils.promiseInstallFile(file);
|
||||
return install.addon;
|
||||
})
|
||||
@@ -860,7 +860,7 @@ add_task(async function testLiveLanguageReloading() {
|
||||
|
||||
let langpacks = await createTestLangpacks();
|
||||
let addons = await Promise.all(
|
||||
langpacks.map(async ([, file]) => {
|
||||
langpacks.map(async ([locale, file]) => {
|
||||
let install = await AddonTestUtils.promiseInstallFile(file);
|
||||
return install.addon;
|
||||
})
|
||||
@@ -928,7 +928,7 @@ add_task(async function testLiveLanguageReloadingBidiOff() {
|
||||
|
||||
let langpacks = await createTestLangpacks();
|
||||
let addons = await Promise.all(
|
||||
langpacks.map(async ([, file]) => {
|
||||
langpacks.map(async ([locale, file]) => {
|
||||
let install = await AddonTestUtils.promiseInstallFile(file);
|
||||
return install.addon;
|
||||
})
|
||||
@@ -1006,7 +1006,7 @@ add_task(async function testLiveLanguageReloadingBidiOn() {
|
||||
|
||||
let langpacks = await createTestLangpacks();
|
||||
let addons = await Promise.all(
|
||||
langpacks.map(async ([, file]) => {
|
||||
langpacks.map(async ([locale, file]) => {
|
||||
let install = await AddonTestUtils.promiseInstallFile(file);
|
||||
return install.addon;
|
||||
})
|
||||
|
||||
@@ -26,7 +26,7 @@ function test() {
|
||||
so it has to be opened as a sub dialog of the main pref tab.
|
||||
Open the main tab here.
|
||||
*/
|
||||
open_preferences(async function tabOpened() {
|
||||
open_preferences(async function tabOpened(aContentWindow) {
|
||||
is(
|
||||
gBrowser.currentURI.spec,
|
||||
"about:preferences",
|
||||
|
||||
@@ -37,7 +37,7 @@ function test() {
|
||||
so it has to be opened as a sub dialog of the main pref tab.
|
||||
Open the main tab here.
|
||||
*/
|
||||
open_preferences(async function tabOpened() {
|
||||
open_preferences(async function tabOpened(aContentWindow) {
|
||||
let dialog, dialogClosingPromise, dialogElement;
|
||||
let proxyTypePref, sharePref, httpPref, httpPortPref;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ add_task(async function testAllow() {
|
||||
apply();
|
||||
await observeAllPromise;
|
||||
},
|
||||
() => {
|
||||
params => {
|
||||
return [
|
||||
{
|
||||
type: "cookie",
|
||||
@@ -52,7 +52,7 @@ add_task(async function testBlock() {
|
||||
apply();
|
||||
await observeAllPromise;
|
||||
},
|
||||
() => {
|
||||
params => {
|
||||
return [
|
||||
{
|
||||
type: "cookie",
|
||||
@@ -85,7 +85,7 @@ add_task(async function testAllowAgain() {
|
||||
apply();
|
||||
await observeAllPromise;
|
||||
},
|
||||
() => {
|
||||
params => {
|
||||
return [
|
||||
{
|
||||
type: "cookie",
|
||||
@@ -152,7 +152,7 @@ add_task(async function testAdd() {
|
||||
|
||||
PermissionTestUtils.remove(uri, "popup");
|
||||
},
|
||||
() => {
|
||||
params => {
|
||||
return [
|
||||
{
|
||||
type: "popup",
|
||||
@@ -178,7 +178,7 @@ add_task(async function testAllowHTTPSWithPort() {
|
||||
apply();
|
||||
await observeAllPromise;
|
||||
},
|
||||
() => {
|
||||
params => {
|
||||
return [
|
||||
{
|
||||
type: "cookie",
|
||||
@@ -204,7 +204,7 @@ add_task(async function testBlockHTTPSWithPort() {
|
||||
apply();
|
||||
await observeAllPromise;
|
||||
},
|
||||
() => {
|
||||
params => {
|
||||
return [
|
||||
{
|
||||
type: "cookie",
|
||||
@@ -230,7 +230,7 @@ add_task(async function testAllowAgainHTTPSWithPort() {
|
||||
apply();
|
||||
await observeAllPromise;
|
||||
},
|
||||
() => {
|
||||
params => {
|
||||
return [
|
||||
{
|
||||
type: "cookie",
|
||||
@@ -288,7 +288,7 @@ add_task(async function testAllowPort() {
|
||||
apply();
|
||||
await observeAllPromise;
|
||||
},
|
||||
() => {
|
||||
params => {
|
||||
return [
|
||||
{
|
||||
type: "cookie",
|
||||
@@ -321,7 +321,7 @@ add_task(async function testBlockPort() {
|
||||
apply();
|
||||
await observeAllPromise;
|
||||
},
|
||||
() => {
|
||||
params => {
|
||||
return [
|
||||
{
|
||||
type: "cookie",
|
||||
@@ -354,7 +354,7 @@ add_task(async function testAllowAgainPort() {
|
||||
apply();
|
||||
await observeAllPromise;
|
||||
},
|
||||
() => {
|
||||
params => {
|
||||
return [
|
||||
{
|
||||
type: "cookie",
|
||||
@@ -450,7 +450,7 @@ add_task(async function testSort() {
|
||||
PermissionTestUtils.remove(uri, "cookie");
|
||||
}
|
||||
},
|
||||
() => {
|
||||
params => {
|
||||
return [
|
||||
{
|
||||
type: "cookie",
|
||||
@@ -477,7 +477,7 @@ add_task(async function testSort() {
|
||||
|
||||
add_task(async function testPrivateBrowsingSessionPermissionsAreHidden() {
|
||||
await runTest(
|
||||
async params => {
|
||||
async (params, observeAllPromise, apply) => {
|
||||
assertListContents(params, []);
|
||||
|
||||
let uri = Services.io.newURI("http://test.com");
|
||||
@@ -498,7 +498,7 @@ add_task(async function testPrivateBrowsingSessionPermissionsAreHidden() {
|
||||
|
||||
PermissionTestUtils.remove(uri, "cookie");
|
||||
},
|
||||
() => {
|
||||
params => {
|
||||
return [];
|
||||
}
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
function whenMainPaneLoadedFinished() {
|
||||
return new Promise(function (resolve) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
const topic = "main-pane-loaded";
|
||||
Services.obs.addObserver(function observer() {
|
||||
Services.obs.addObserver(function observer(aSubject) {
|
||||
Services.obs.removeObserver(observer, topic);
|
||||
resolve();
|
||||
}, topic);
|
||||
|
||||
@@ -36,7 +36,7 @@ add_setup(async function () {
|
||||
// The rows should be visible and checked by default.
|
||||
add_task(async function visible() {
|
||||
await checkRowVisibility(true);
|
||||
await forEachLocalShortcutRow(async row => {
|
||||
await forEachLocalShortcutRow(async (row, shortcut) => {
|
||||
Assert.equal(
|
||||
gTree.view.getCellValue(row, gTree.columns.getNamedColumn("engineShown")),
|
||||
"true",
|
||||
@@ -136,7 +136,7 @@ add_task(async function syncToPrefs_click() {
|
||||
|
||||
// The keyword column should not be editable according to isEditable().
|
||||
add_task(async function keywordNotEditable_isEditable() {
|
||||
await forEachLocalShortcutRow(async row => {
|
||||
await forEachLocalShortcutRow(async (row, shortcut) => {
|
||||
Assert.ok(
|
||||
!gTree.view.isEditable(
|
||||
row,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
const PERMISSIONS_URL =
|
||||
"chrome://browser/content/preferences/dialogs/permissions.xhtml";
|
||||
|
||||
add_task(async function urlFieldVisibleForPopupPermissions() {
|
||||
add_task(async function urlFieldVisibleForPopupPermissions(finish) {
|
||||
await openPreferencesViaOpenPreferencesAPI("panePrivacy", {
|
||||
leaveOpen: true,
|
||||
});
|
||||
|
||||
@@ -47,7 +47,7 @@ function test() {
|
||||
so it has to be opened as a sub dialog of the main pref tab.
|
||||
Open the main tab here.
|
||||
*/
|
||||
open_preferences(async function tabOpened() {
|
||||
open_preferences(async function tabOpened(aContentWindow) {
|
||||
is(
|
||||
gBrowser.currentURI.spec,
|
||||
"about:preferences",
|
||||
|
||||
@@ -167,7 +167,7 @@ add_task(async function testDialogLaunchFromURI() {
|
||||
);
|
||||
await BrowserTestUtils.withNewTab(
|
||||
"about:preferences?action=choose-what-to-sync#sync",
|
||||
async () => {
|
||||
async browser => {
|
||||
let dialogEvent = await dialogEventPromise;
|
||||
Assert.equal(
|
||||
dialogEvent.detail.dialog._frame.contentWindow.location,
|
||||
|
||||
@@ -29,7 +29,7 @@ add_setup(async function () {
|
||||
};
|
||||
|
||||
const origStart = FxAccountsPairingFlow.start;
|
||||
FxAccountsPairingFlow.start = () => {
|
||||
FxAccountsPairingFlow.start = ({ emitter: e }) => {
|
||||
return `https://foo.bar/${flowCounter++}`;
|
||||
};
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ function openAndLoadSubDialog(
|
||||
}
|
||||
|
||||
function promiseLoadSubDialog(aURL) {
|
||||
return new Promise(resolve => {
|
||||
return new Promise((resolve, reject) => {
|
||||
content.gSubDialog._dialogStack.addEventListener(
|
||||
"dialogopen",
|
||||
function dialogopen(aEvent) {
|
||||
|
||||
@@ -52,7 +52,7 @@ function is_element_hidden(aElement, aMsg) {
|
||||
}
|
||||
|
||||
function promiseLoadSubDialog(aURL) {
|
||||
return new Promise(resolve => {
|
||||
return new Promise((resolve, reject) => {
|
||||
content.gSubDialog._dialogStack.addEventListener(
|
||||
"dialogopen",
|
||||
function dialogopen(aEvent) {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<h1>Service Worker Test</h1>
|
||||
<script type="text/javascript">
|
||||
navigator.serviceWorker.register("service_worker_test.js")
|
||||
.then(() => document.body.setAttribute("data-test-service-worker-registered", "true"));
|
||||
.then(regis => document.body.setAttribute("data-test-service-worker-registered", "true"));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user