Skip to content

Commit

Permalink
Backed out changeset 3b4e0751850a (bug 1797843) for causing mochitest…
Browse files Browse the repository at this point in the history
… failures nsContentSecurityUtils.cpp CLOSED TREE
  • Loading branch information
Cristian Tuns committed Nov 12, 2022
1 parent 9e86cef commit 6c5c587
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "MultiStageAboutWelcome": () => (/* binding */ MultiStageAboutWelcome),
/* harmony export */ "SecondaryCTA": () => (/* binding */ SecondaryCTA),
/* harmony export */ "OnboardingVideo": () => (/* binding */ OnboardingVideo),
/* harmony export */ "StepsIndicator": () => (/* binding */ StepsIndicator),
/* harmony export */ "WelcomeScreen": () => (/* binding */ WelcomeScreen)
/* harmony export */ });
Expand Down Expand Up @@ -385,24 +384,6 @@ const SecondaryCTA = props => {
onClick: props.handleAction
})));
};
const OnboardingVideo = props => {
var _props$content, _props$content2;

const vidUrl = (_props$content = props.content) === null || _props$content === void 0 ? void 0 : _props$content.video_url;
const autoplay = (_props$content2 = props.content) === null || _props$content2 === void 0 ? void 0 : _props$content2.autoPlay;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("video", {
// eslint-disable-line jsx-a11y/media-has-caption
controls: true,
autoPlay: autoplay,
src: vidUrl,
width: "604px",
height: "340px",
value: "video_container",
onEnded: props.handleAction
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("source", {
src: vidUrl
})));
};
const StepsIndicator = props => {
let steps = [];

Expand Down Expand Up @@ -485,9 +466,9 @@ class WelcomeScreen extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCo
// Populate MULTI_ACTION data actions property with selected checkbox actions from tiles data
action.data = {
actions: this.props.activeMultiSelect.map(id => {
var _props$content3, _props$content3$tiles, _props$content3$tiles2;
var _props$content, _props$content$tiles, _props$content$tiles$;

return (_props$content3 = props.content) === null || _props$content3 === void 0 ? void 0 : (_props$content3$tiles = _props$content3.tiles) === null || _props$content3$tiles === void 0 ? void 0 : (_props$content3$tiles2 = _props$content3$tiles.data.find(ckbx => ckbx.id === id)) === null || _props$content3$tiles2 === void 0 ? void 0 : _props$content3$tiles2.action;
return (_props$content = props.content) === null || _props$content === void 0 ? void 0 : (_props$content$tiles = _props$content.tiles) === null || _props$content$tiles === void 0 ? void 0 : (_props$content$tiles$ = _props$content$tiles.data.find(ckbx => ckbx.id === id)) === null || _props$content$tiles$ === void 0 ? void 0 : _props$content$tiles$.action;
})
};
}
Expand Down Expand Up @@ -904,11 +885,11 @@ class ProtonScreen extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCom
const includeNoodles = content.has_noodles; // The default screen position is "center"

const isCenterPosition = content.position === "center" || !content.position;
const hideStepsIndicator = autoAdvance || (content === null || content === void 0 ? void 0 : content.video_container) || isFirstCenteredScreen && isLastCenteredScreen;
const hideStepsIndicator = autoAdvance || (content === null || content === void 0 ? void 0 : content.has_video) || isFirstCenteredScreen && isLastCenteredScreen;
const textColorClass = content.text_color ? `${content.text_color}-text` : ""; // Assign proton screen style 'screen-1' or 'screen-2' to centered screens
// by checking if screen order is even or odd.

const screenClassName = isCenterPosition ? this.getScreenClassName(isFirstCenteredScreen, isLastCenteredScreen, includeNoodles, content === null || content === void 0 ? void 0 : content.video_container) : "";
const screenClassName = isCenterPosition ? this.getScreenClassName(isFirstCenteredScreen, isLastCenteredScreen, includeNoodles, content === null || content === void 0 ? void 0 : content.has_video) : "";
const currentStep = this.props.order + 1;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("main", {
className: `screen ${this.props.id || ""} ${screenClassName} ${textColorClass}`,
Expand Down Expand Up @@ -955,10 +936,7 @@ class ProtonScreen extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCom
})), content.cta_paragraph ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_CTAParagraph__WEBPACK_IMPORTED_MODULE_8__.CTAParagraph, {
content: content.cta_paragraph,
handleAction: this.props.handleAction
}) : null), content.video_container ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MultiStageAboutWelcome__WEBPACK_IMPORTED_MODULE_6__.OnboardingVideo, {
content: content.video_container,
handleAction: this.props.handleAction
}) : null, this.renderContentTiles(), this.renderLanguageSwitcher(), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ProtonScreenActionButtons, {
}) : null), this.renderContentTiles(), this.renderLanguageSwitcher(), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ProtonScreenActionButtons, {
content: content,
handleAction: this.props.handleAction
})), hideStepsIndicator ? null : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<head>
<meta charset="utf-8">
<meta name="color-scheme" content="light dark">
<meta http-equiv="Content-Security-Policy" content="default-src chrome:; object-src 'none'; script-src resource: chrome:; media-src resource: chrome: https://assets.mozilla.net https://www.mozilla.org; connect-src https:; img-src https: data: blob: chrome:; style-src resource: chrome:;">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; object-src 'none'; script-src resource: chrome:; media-src resource: chrome:; connect-src https:; img-src https: data: blob: chrome:; style-src resource: chrome:;">
<title data-l10n-id="onboarding-welcome-header"></title>
<link rel="icon" type="image/png" href="chrome://branding/content/icon32.png">
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,26 +252,6 @@ export const SecondaryCTA = props => {
);
};

export const OnboardingVideo = props => {
const vidUrl = props.content?.video_url;
const autoplay = props.content?.autoPlay;
return (
<div>
<video // eslint-disable-line jsx-a11y/media-has-caption
controls={true}
autoPlay={autoplay}
src={vidUrl}
width="604px"
height="340px"
value="video_container"
onEnded={props.handleAction}
>
<source src={vidUrl}></source>
</video>
</div>
);
};

export const StepsIndicator = props => {
let steps = [];
for (let i = 0; i < props.totalNumberOfScreens; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ import { Colorways } from "./MRColorways";
import { MobileDownloads } from "./MobileDownloads";
import { MultiSelect } from "./MultiSelect";
import { Themes } from "./Themes";
import {
OnboardingVideo,
SecondaryCTA,
StepsIndicator,
} from "./MultiStageAboutWelcome";
import { SecondaryCTA, StepsIndicator } from "./MultiStageAboutWelcome";
import { LanguageSwitcher } from "./LanguageSwitcher";
import { CTAParagraph } from "./CTAParagraph";
import { HeroImage } from "./HeroImage";
Expand Down Expand Up @@ -303,7 +299,7 @@ export class ProtonScreen extends React.PureComponent {
const isCenterPosition = content.position === "center" || !content.position;
const hideStepsIndicator =
autoAdvance ||
content?.video_container ||
content?.has_video ||
(isFirstCenteredScreen && isLastCenteredScreen);
const textColorClass = content.text_color
? `${content.text_color}-text`
Expand All @@ -315,7 +311,7 @@ export class ProtonScreen extends React.PureComponent {
isFirstCenteredScreen,
isLastCenteredScreen,
includeNoodles,
content?.video_container
content?.has_video
)
: "";

Expand Down Expand Up @@ -383,12 +379,6 @@ export class ProtonScreen extends React.PureComponent {
/>
) : null}
</div>
{content.video_container ? (
<OnboardingVideo
content={content.video_container}
handleAction={this.props.handleAction}
/>
) : null}
{this.renderContentTiles()}
{this.renderLanguageSwitcher()}
<ProtonScreenActionButtons
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,25 +304,14 @@ add_task(async function test_aboutwelcome_video_content() {
navigate: true,
},
},
video_container: {
video_url: "",
action: {
navigate: true,
},
autoPlay: false,
},
has_video: true,
},
},
];
await setAboutWelcomeMultiStage(JSON.stringify(TEST_CONTENT));
let { cleanup, browser } = await openMRAboutWelcome();

await test_screen_content(
browser,
"Video exists",
["main.with-video", "video[src='']"],
[]
);
await test_screen_content(browser, ["main.with-video"], []);
await SpecialPowers.popPrefEnv();
await cleanup();
});
Expand Down

0 comments on commit 6c5c587

Please sign in to comment.