Skip to content

Commit

Permalink
chore: update playwright-browsers to Mar 19 (#30599)
Browse files Browse the repository at this point in the history
Upstream commit 5a76c58a3d8e61d581e593882532346961863354
  • Loading branch information
yury-s committed Apr 30, 2024
1 parent fa7d4e5 commit 154694b
Show file tree
Hide file tree
Showing 6 changed files with 603 additions and 558 deletions.
6 changes: 4 additions & 2 deletions browser_patches/firefox/juggler/TargetRegistry.js
Expand Up @@ -21,6 +21,8 @@ const ALL_PERMISSIONS = [
'desktop-notification',
];

let globalTabAndWindowActivationChain = Promise.resolve();

class DownloadInterceptor {
constructor(registry) {
this._registry = registry
Expand Down Expand Up @@ -384,7 +386,7 @@ class PageTarget {
const tabBrowser = ownerWindow.gBrowser;
// Serialize all tab-switching commands per tabbed browser
// to disallow concurrent tab switching.
const result = (tabBrowser.__serializedChain ?? Promise.resolve()).then(async () => {
const result = globalTabAndWindowActivationChain.then(async () => {
this._window.focus();
if (tabBrowser.selectedTab !== this._tab) {
const promise = helper.awaitEvent(ownerWindow, 'TabSwitchDone');
Expand All @@ -399,7 +401,7 @@ class PageTarget {
notificationsPopup?.style.removeProperty('pointer-events');
}
});
tabBrowser.__serializedChain = result.catch(error => { /* swallow errors to keep chain running */ });
globalTabAndWindowActivationChain = result.catch(error => { /* swallow errors to keep chain running */ });
return result;
}

Expand Down
6 changes: 6 additions & 0 deletions browser_patches/firefox/juggler/content/PageAgent.js
Expand Up @@ -382,6 +382,12 @@ class PageAgent {
throw new Error('Object is not input!');
const nsFiles = await Promise.all(files.map(filePath => File.createFromFileName(filePath)));
unsafeObject.mozSetFileArray(nsFiles);
const events = [
new (frame.domWindow().Event)('input', { bubbles: true, cancelable: true, composed: true }),
new (frame.domWindow().Event)('change', { bubbles: true, cancelable: true, composed: true }),
];
for (const event of events)
unsafeObject.dispatchEvent(event);
}

_getContentQuads({objectId, frameId}) {
Expand Down
47 changes: 16 additions & 31 deletions browser_patches/firefox/patches/bootstrap.diff
Expand Up @@ -2475,7 +2475,7 @@ index 6dfd07d6b676a99993408921de8dea9d561f201d..e3c6794363cd6336effbeac83a179f37
readonly attribute boolean securityCheckDisabled;
};
diff --git a/services/settings/Utils.sys.mjs b/services/settings/Utils.sys.mjs
index 73c83e526be1a3a252f995d0718e3975d50bffa7..4b05141c8ab8b084d977341127f36ea6d226aa9a 100644
index 73c83e526be1a3a252f995d0718e3975d50bffa7..db5977c54221e19e107a8325a0834302c2e84546 100644
--- a/services/settings/Utils.sys.mjs
+++ b/services/settings/Utils.sys.mjs
@@ -95,7 +95,7 @@ function _isUndefined(value) {
Expand All @@ -2487,6 +2487,16 @@ index 73c83e526be1a3a252f995d0718e3975d50bffa7..4b05141c8ab8b084d977341127f36ea6
? lazy.gServerURL
: AppConstants.REMOTE_SETTINGS_SERVER_URL;
},
@@ -108,6 +108,9 @@ export var Utils = {
log,

get shouldSkipRemoteActivityDueToTests() {
+ // Playwright does not set Cu.isInAutomation, hence we just return true
+ // here in order to disable the remote activity.
+ return true;
return (
(lazy.isRunningTests || Cu.isInAutomation) &&
this.SERVER_URL == "data:,#remote-settings-dummy/v1"
diff --git a/servo/components/style/gecko/media_features.rs b/servo/components/style/gecko/media_features.rs
index c9ad30b28b069a122cf01c5e97b83dc68ef022ff..f32dbcfe26fe2f6b8a0d066d6dfd208f1afc510d 100644
--- a/servo/components/style/gecko/media_features.rs
Expand Down Expand Up @@ -2925,7 +2935,7 @@ diff --git a/widget/cocoa/NativeKeyBindings.mm b/widget/cocoa/NativeKeyBindings.
index e4bdf715e2fb899e97a5bfeb2e147127460d6047..3554f919480278b7353617481c7ce8050630a1aa 100644
--- a/widget/cocoa/NativeKeyBindings.mm
+++ b/widget/cocoa/NativeKeyBindings.mm
@@ -528,6 +528,13 @@
@@ -528,6 +528,13 @@ void NativeKeyBindings::GetEditCommandsForTests(
break;
case KEY_NAME_INDEX_ArrowLeft:
if (aEvent.IsAlt()) {
Expand All @@ -2939,7 +2949,7 @@ index e4bdf715e2fb899e97a5bfeb2e147127460d6047..3554f919480278b7353617481c7ce805
break;
}
if (aEvent.IsMeta() || (aEvent.IsControl() && aEvent.IsShift())) {
@@ -550,6 +557,13 @@
@@ -550,6 +557,13 @@ void NativeKeyBindings::GetEditCommandsForTests(
break;
case KEY_NAME_INDEX_ArrowRight:
if (aEvent.IsAlt()) {
Expand All @@ -2953,7 +2963,7 @@ index e4bdf715e2fb899e97a5bfeb2e147127460d6047..3554f919480278b7353617481c7ce805
break;
}
if (aEvent.IsMeta() || (aEvent.IsControl() && aEvent.IsShift())) {
@@ -572,6 +586,10 @@
@@ -572,6 +586,10 @@ void NativeKeyBindings::GetEditCommandsForTests(
break;
case KEY_NAME_INDEX_ArrowUp:
if (aEvent.IsControl()) {
Expand All @@ -2964,7 +2974,7 @@ index e4bdf715e2fb899e97a5bfeb2e147127460d6047..3554f919480278b7353617481c7ce805
break;
}
if (aEvent.IsMeta()) {
@@ -582,7 +600,7 @@
@@ -582,7 +600,7 @@ void NativeKeyBindings::GetEditCommandsForTests(
!aEvent.IsShift()
? ToObjcSelectorPtr(@selector(moveToBeginningOfDocument:))
: ToObjcSelectorPtr(
Expand All @@ -2973,7 +2983,7 @@ index e4bdf715e2fb899e97a5bfeb2e147127460d6047..3554f919480278b7353617481c7ce805
aCommands);
break;
}
@@ -609,6 +627,10 @@
@@ -609,6 +627,10 @@ void NativeKeyBindings::GetEditCommandsForTests(
break;
case KEY_NAME_INDEX_ArrowDown:
if (aEvent.IsControl()) {
Expand All @@ -2984,31 +2994,6 @@ index e4bdf715e2fb899e97a5bfeb2e147127460d6047..3554f919480278b7353617481c7ce805
break;
}
if (aEvent.IsMeta()) {
diff --git a/widget/cocoa/nsCocoaUtils.mm b/widget/cocoa/nsCocoaUtils.mm
index f3a760476290953df2179fa44bd68dd171d291ab..6cd3f8178d260904905372c1afc7ecbcc568fbc8 100644
--- a/widget/cocoa/nsCocoaUtils.mm
+++ b/widget/cocoa/nsCocoaUtils.mm
@@ -267,14 +267,17 @@ static float MenuBarScreenHeight() {
return nullptr;
}

- nsCOMPtr<nsIWidget> hiddenWindowWidget;
+ nsCOMPtr<nsIWidget> mainWindowWidget;
if (NS_FAILED(baseHiddenWindow->GetMainWidget(
- getter_AddRefs(hiddenWindowWidget)))) {
+ getter_AddRefs(mainWindowWidget)))) {
NS_WARNING("Couldn't get nsIWidget from hidden window (nsIBaseWindow)");
return nullptr;
}

- return hiddenWindowWidget;
+ // In the case of headless mode, it's a HeadlessWidget while the callee expects a nsCocoaWindow
+ if (gfxPlatform::IsHeadless())
+ return nullptr;
+ return mainWindowWidget;
}

BOOL nsCocoaUtils::WasLaunchedAtLogin() {
diff --git a/widget/headless/HeadlessCompositorWidget.cpp b/widget/headless/HeadlessCompositorWidget.cpp
index bb4ee9175e66dc40de1871a7f91368fe309494a3..747625e3869882300bfbc18b184db5151dd90c1a 100644
--- a/widget/headless/HeadlessCompositorWidget.cpp
Expand Down
13 changes: 12 additions & 1 deletion browser_patches/firefox/preferences/playwright.cfg
Expand Up @@ -112,9 +112,20 @@ pref("prompts.contentPromptSubDialog", false);
// Do not use system colors - they are affected by themes.
pref("ui.use_standins_for_native_colors", true);

// Turn off the Push service.
pref("dom.push.serverURL", "");
// This setting breaks settings loading.
// Prevent Remote Settings (firefox.settings.services.mozilla.com) to issue non local connections.
pref("services.settings.server", "");
// Prevent location.services.mozilla.com to issue non local connections.
pref("browser.region.network.url", "");
pref("browser.pocket.enabled", false);
pref("browser.newtabpage.activity-stream.feeds.topsites", false);
// Disable sponsored tiles from "Mozilla Tiles Service"
pref("browser.newtabpage.activity-stream.showSponsoredTopSites", false);
// required to prevent non-local access to push.services.mozilla.com
pref("dom.push.connection.enabled", false);
// Prevent contile.services.mozilla.com to issue non local connections.
pref("browser.topsites.contile.enabled", false);
pref("browser.safebrowsing.provider.mozilla.updateURL", "");
pref("browser.library.activity-stream.enabled", false);
pref("browser.search.geoSpecificDefaults", false);
Expand Down
2 changes: 1 addition & 1 deletion browser_patches/webkit/UPSTREAM_CONFIG.sh
@@ -1,3 +1,3 @@
REMOTE_URL="https://github.com/WebKit/WebKit.git"
BASE_BRANCH="main"
BASE_REVISION="d477c762a9ecbbc8dedf3ca7a6a2a079577bf60c"
BASE_REVISION="e225c278f4c06f451ea92cc68b12986dd2a99979"

0 comments on commit 154694b

Please sign in to comment.