From c7e338b97791fbb286ae773019d5563a9352c80e Mon Sep 17 00:00:00 2001 From: "electron-roller[bot]" <84116207+electron-roller[bot]@users.noreply.github.com> Date: Fri, 13 Aug 2021 13:00:55 +0000 Subject: [PATCH 01/12] chore: bump chromium in DEPS to 93.0.4577.42 --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index fa265f7e135b4..b1682fceb681a 100644 --- a/DEPS +++ b/DEPS @@ -15,7 +15,7 @@ gclient_gn_args = [ vars = { 'chromium_version': - '93.0.4577.25', + '93.0.4577.42', 'node_version': 'v14.17.0', 'nan_version': From a827bbf49630bdbba2a512e04267c35aa1409864 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Fri, 13 Aug 2021 16:22:21 -0400 Subject: [PATCH 02/12] ci: update git on CI machines (cherry picked from commit 9b2e028f50fdcb495ea5e31967bbcc0b2d326f8b) --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e0fab29d049c1..41cf485cb89ee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -67,7 +67,7 @@ executors: type: enum enum: ["medium", "xlarge", "2xlarge+"] docker: - - image: electron.azurecr.io/build:4fc81b50f9c0980699d329bc32062fac20a26701 + - image: electron.azurecr.io/build:d818f06a9b1540c7fd38f75ad5a2c493dd6843b6 resource_class: << parameters.size >> macos: From 7e557c26e574f607052447028a658ae35cf91520 Mon Sep 17 00:00:00 2001 From: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Date: Mon, 16 Aug 2021 16:06:28 +0000 Subject: [PATCH 03/12] chore: update patches --- patches/chromium/add_didinstallconditionalfeatures.patch | 8 ++++---- .../chromium/build_add_electron_tracing_category.patch | 2 +- patches/chromium/can_create_window.patch | 2 +- ...iswebcontentscreationoverridden_with_full_params.patch | 2 +- patches/chromium/desktop_media_list.patch | 4 ++-- patches/chromium/disable_color_correct_rendering.patch | 4 ++-- ...tentially_null_getwebframe_-_view_when_get_blink.patch | 4 ++-- patches/chromium/notification_provenance.patch | 4 ++-- patches/chromium/support_mixed_sandbox_with_zygote.patch | 4 ++-- patches/chromium/webview_fullscreen.patch | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/patches/chromium/add_didinstallconditionalfeatures.patch b/patches/chromium/add_didinstallconditionalfeatures.patch index bf9eb6854c0b4..3c41cb4ca7b73 100644 --- a/patches/chromium/add_didinstallconditionalfeatures.patch +++ b/patches/chromium/add_didinstallconditionalfeatures.patch @@ -23,10 +23,10 @@ index e24c169444c699f295de2c1f1f42683eeca73436..4675cdccb1876a318a9a0253cdf552bb int32_t world_id) {} virtual void DidClearWindowObject() {} diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index 5f7a44233f04adddf7f5a4cd9b40fc0497961fbc..2ce30e48d579fbd06efb6b8464dce7d483bbd6b3 100644 +index c8139a90c462297ceaed71c5db1be8b35e310f20..6452ed9146a51730ef61fc7500d3eec52205704b 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -4420,6 +4420,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local context, +@@ -4435,6 +4435,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local context, observer.DidCreateScriptContext(context, world_id); } @@ -40,10 +40,10 @@ index 5f7a44233f04adddf7f5a4cd9b40fc0497961fbc..2ce30e48d579fbd06efb6b8464dce7d4 int world_id) { for (auto& observer : observers_) diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h -index 240152022c7d489d81fbadddcb672b02d87443c4..6c8f1e51d646d7925801111ee857af569f28033d 100644 +index e3807f9844b07b080bb61cff047ccd31613f69a0..17abba3fbb003812db02ab9d35ea7e156d452383 100644 --- a/content/renderer/render_frame_impl.h +++ b/content/renderer/render_frame_impl.h -@@ -586,6 +586,8 @@ class CONTENT_EXPORT RenderFrameImpl +@@ -587,6 +587,8 @@ class CONTENT_EXPORT RenderFrameImpl blink::WebLocalFrameClient::LazyLoadBehavior lazy_load_behavior) override; void DidCreateScriptContext(v8::Local context, int world_id) override; diff --git a/patches/chromium/build_add_electron_tracing_category.patch b/patches/chromium/build_add_electron_tracing_category.patch index 1fcb3e407a128..6f08b26a45bcf 100644 --- a/patches/chromium/build_add_electron_tracing_category.patch +++ b/patches/chromium/build_add_electron_tracing_category.patch @@ -8,7 +8,7 @@ categories in use are known / declared. This patch is required for us to introduce a new Electron category for Electron-specific tracing. diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h -index a9616406d4d3742c90aa0d1cf65ab84cfb8890ed..32142ed13cfca009e09578dff79e94030233cfbf 100644 +index bb47926b3d3ee58e11e9814223384690dd68dac1..f92d53109c9c02c2d144c7397b3653402a09cab0 100644 --- a/base/trace_event/builtin_categories.h +++ b/base/trace_event/builtin_categories.h @@ -77,6 +77,7 @@ diff --git a/patches/chromium/can_create_window.patch b/patches/chromium/can_create_window.patch index 97ab5df2bfc58..3a5394ccf97da 100644 --- a/patches/chromium/can_create_window.patch +++ b/patches/chromium/can_create_window.patch @@ -9,7 +9,7 @@ potentially prevent a window from being created. TODO(loc): this patch is currently broken. diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc -index ee638fbd09ad247756659a5345ee58abed7dc6cd..c842246f9250c45793c4e763f1de3f2b486a56aa 100644 +index 4f87e25cc2e51a120c210ef0939daf4271717e77..f96dd88ce1caf154743b30e10db387de42ed37c8 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc @@ -6280,6 +6280,7 @@ void RenderFrameHostImpl::CreateNewWindow( diff --git a/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch b/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch index 55759d0ea055c..ed9c8f337e75d 100644 --- a/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch +++ b/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch @@ -362,7 +362,7 @@ index bb90319f768ed2f3a3e530d64bf622de585ce163..d84de1d218267887f6b8624f913438eb content::RenderFrameHost* opener, content::SiteInstance* source_site_instance, diff --git a/fuchsia/engine/browser/frame_impl.cc b/fuchsia/engine/browser/frame_impl.cc -index bfe73ea9811890f3a0175f2b8cd14459fec980c1..fc4a2a879cd4b1914849b5cadba78caf4c16d804 100644 +index 3fe03fbabb182fa38f0bb17d4904f645531a536f..3f6c4bb2437b5032b758a0ba486fb0967408ecb7 100644 --- a/fuchsia/engine/browser/frame_impl.cc +++ b/fuchsia/engine/browser/frame_impl.cc @@ -388,8 +388,7 @@ bool FrameImpl::IsWebContentsCreationOverridden( diff --git a/patches/chromium/desktop_media_list.patch b/patches/chromium/desktop_media_list.patch index 9e233c1a94721..230c294f4bdc7 100644 --- a/patches/chromium/desktop_media_list.patch +++ b/patches/chromium/desktop_media_list.patch @@ -128,7 +128,7 @@ index ad7f766a36b1b6b2a8bc0f96369f1aaadf6681f7..f6c6c14a0937430df62c9b9c1132c591 protected: virtual ~DesktopMediaListObserver() {} diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc -index 0d38b92ccb7ef1ada0d2165d714d80a844c999b8..d1254c8e1acbadb3a1976097031889f19a02554d 100644 +index 5a851f4c89b4ed2b41640bf8bad47b7d8eba8ca1..b016a6268f6ca2517c69954499ba5b1433bfca9b 100644 --- a/chrome/browser/media/webrtc/native_desktop_media_list.cc +++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc @@ -11,15 +11,16 @@ @@ -149,7 +149,7 @@ index 0d38b92ccb7ef1ada0d2165d714d80a844c999b8..d1254c8e1acbadb3a1976097031889f1 #include "media/base/video_util.h" #include "third_party/libyuv/include/libyuv/scale_argb.h" #include "third_party/skia/include/core/SkBitmap.h" -@@ -266,6 +267,8 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() { +@@ -271,6 +272,8 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() { FROM_HERE, base::BindOnce(&NativeDesktopMediaList::UpdateNativeThumbnailsFinished, media_list_)); diff --git a/patches/chromium/disable_color_correct_rendering.patch b/patches/chromium/disable_color_correct_rendering.patch index a75ee980e6772..e994406f5cf50 100644 --- a/patches/chromium/disable_color_correct_rendering.patch +++ b/patches/chromium/disable_color_correct_rendering.patch @@ -241,7 +241,7 @@ index 59b34cdb1dc63b8d239cae5397b2a5a4f607bf1c..e2f556532459b1129465ca2b83aa1485 sandbox::policy::switches::kGpuSandboxAllowSysVShm, sandbox::policy::switches::kGpuSandboxFailuresFatal, diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index 224e23ad3584dd4511a4173d632547d4a2ee4e9c..0dbb7fad5c9f3b3889b0825d553992d6fe2745f9 100644 +index 700aca3c0ecb6e200a1db375b5ca730f6ed46012..b2fc3a92f79d71a1229e2f6890ee1f94c79511e8 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -217,6 +217,7 @@ @@ -252,7 +252,7 @@ index 224e23ad3584dd4511a4173d632547d4a2ee4e9c..0dbb7fad5c9f3b3889b0825d553992d6 #include "ui/gl/gl_switches.h" #include "ui/native_theme/native_theme_features.h" #include "url/origin.h" -@@ -3368,6 +3369,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( +@@ -3399,6 +3400,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( // Propagate the following switches to the renderer command line (along // with any associated values) if present in the browser command line. static const char* const kSwitchNames[] = { diff --git a/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch b/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch index a4b57eb0aa8b9..7b0f2b70f9dcd 100644 --- a/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch +++ b/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch @@ -11,10 +11,10 @@ This regressed in https://chromium-review.googlesource.com/c/chromium/src/+/2572 Upstream: https://chromium-review.googlesource.com/c/chromium/src/+/2598393 diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index 2ce30e48d579fbd06efb6b8464dce7d483bbd6b3..71f8b79a09ff12482f530e94a0b22503f4a66a65 100644 +index 6452ed9146a51730ef61fc7500d3eec52205704b..a84e1b7407c2151cbc890369f2c8ee3b39ad7558 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -2355,7 +2355,7 @@ const blink::WebView* RenderFrameImpl::GetWebView() const { +@@ -2356,7 +2356,7 @@ const blink::WebView* RenderFrameImpl::GetWebView() const { } const blink::web_pref::WebPreferences& RenderFrameImpl::GetBlinkPreferences() { diff --git a/patches/chromium/notification_provenance.patch b/patches/chromium/notification_provenance.patch index 5bbe67884907a..e99a7d9747007 100644 --- a/patches/chromium/notification_provenance.patch +++ b/patches/chromium/notification_provenance.patch @@ -108,10 +108,10 @@ index b195cb84d8bba3c51b04f8c32cf909d15bf34335..37528715db985d12771ba2dca86dcec8 const GURL& document_url, mojo::PendingReceiver receiver); diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index 8135d0ff1d476b06cc24abb010ad988eb880b557..55c4e3c2bb0b353724c6a1a2f6f853705d1ba501 100644 +index fd1de106ba4598b8c6c2fea281f0781b7b593df2..7db50804c40d23d2bc17efe5b0d5a8341e7988d0 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -2301,7 +2301,7 @@ void RenderProcessHostImpl::CreateNotificationService( +@@ -2324,7 +2324,7 @@ void RenderProcessHostImpl::CreateNotificationService( document_url = rfh->GetLastCommittedURL(); storage_partition_impl_->GetPlatformNotificationContext()->CreateService( diff --git a/patches/chromium/support_mixed_sandbox_with_zygote.patch b/patches/chromium/support_mixed_sandbox_with_zygote.patch index b437aecfaa250..2afdb672c4ff8 100644 --- a/patches/chromium/support_mixed_sandbox_with_zygote.patch +++ b/patches/chromium/support_mixed_sandbox_with_zygote.patch @@ -22,7 +22,7 @@ However, the patch would need to be reviewed by the security team, as it does touch a security-sensitive class. diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index 55c4e3c2bb0b353724c6a1a2f6f853705d1ba501..224e23ad3584dd4511a4173d632547d4a2ee4e9c 100644 +index 7db50804c40d23d2bc17efe5b0d5a8341e7988d0..700aca3c0ecb6e200a1db375b5ca730f6ed46012 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -428,10 +428,18 @@ class RendererSandboxedProcessLauncherDelegate @@ -66,7 +66,7 @@ index 55c4e3c2bb0b353724c6a1a2f6f853705d1ba501..224e23ad3584dd4511a4173d632547d4 if (is_jit_disabled) { dynamic_code_can_be_disabled_ = true; return; -@@ -2016,9 +2032,15 @@ bool RenderProcessHostImpl::Init() { +@@ -2039,9 +2055,15 @@ bool RenderProcessHostImpl::Init() { std::unique_ptr sandbox_delegate = std::make_unique( cmd_line.get(), IsJitDisabled()); diff --git a/patches/chromium/webview_fullscreen.patch b/patches/chromium/webview_fullscreen.patch index d427a2a7aad81..7d3e51d60c629 100644 --- a/patches/chromium/webview_fullscreen.patch +++ b/patches/chromium/webview_fullscreen.patch @@ -14,7 +14,7 @@ Note that we also need to manually update embedder's `api::WebContents::IsFullscreenForTabOrPending` value. diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc -index c842246f9250c45793c4e763f1de3f2b486a56aa..d993cd6651689818ef4deb4caa02737644bdafb5 100644 +index f96dd88ce1caf154743b30e10db387de42ed37c8..93d649b7f1d40479f4b20259eca8ff790e76942b 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc @@ -5716,6 +5716,15 @@ void RenderFrameHostImpl::EnterFullscreen( From 4fd18bee7c839895c610ab1f7d23580eb6f5f6e5 Mon Sep 17 00:00:00 2001 From: Jeremy Rose Date: Tue, 27 Jul 2021 10:35:16 -0700 Subject: [PATCH 04/12] test fix for (unrelated) bug showing up on linux-asan (cherry picked from commit a65d2dacd3b2bfdd9473dc892a161c95a1f5da58) --- patches/config.json | 2 ++ patches/webrtc/.patches | 1 + .../add_thread_local_to_x_error_trap_cc.patch | 24 +++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 patches/webrtc/.patches create mode 100644 patches/webrtc/add_thread_local_to_x_error_trap_cc.patch diff --git a/patches/config.json b/patches/config.json index b0156f7d1c057..e9a2297ba10f2 100644 --- a/patches/config.json +++ b/patches/config.json @@ -3,6 +3,8 @@ "src/electron/patches/boringssl": "src/third_party/boringssl/src", + "src/electron/patches/webrtc": "src/third_party/webrtc", + "src/electron/patches/v8": "src/v8", "src/electron/patches/node": "src/third_party/electron_node", diff --git a/patches/webrtc/.patches b/patches/webrtc/.patches new file mode 100644 index 0000000000000..9cde1db8895b3 --- /dev/null +++ b/patches/webrtc/.patches @@ -0,0 +1 @@ +add_thread_local_to_x_error_trap_cc.patch diff --git a/patches/webrtc/add_thread_local_to_x_error_trap_cc.patch b/patches/webrtc/add_thread_local_to_x_error_trap_cc.patch new file mode 100644 index 0000000000000..0be67e3ccafd1 --- /dev/null +++ b/patches/webrtc/add_thread_local_to_x_error_trap_cc.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jeremy Rose +Date: Tue, 27 Jul 2021 10:32:54 -0700 +Subject: add thread_local to x_error_trap.cc + +Per https://bugs.chromium.org/p/chromium/issues/detail?id=781618#c6. + +To fix this DCHECK firing: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/desktop_capture/linux/x_error_trap.cc;l=35;drc=25ab3228f3e473f2226f219531ec617d2daa175e + +diff --git a/modules/desktop_capture/linux/x_error_trap.cc b/modules/desktop_capture/linux/x_error_trap.cc +index 13233d827470d9d42be0333c3080e3d107f86fd5..62efb5b5b5194fc8961a27fe2a1efcd77e385d08 100644 +--- a/modules/desktop_capture/linux/x_error_trap.cc ++++ b/modules/desktop_capture/linux/x_error_trap.cc +@@ -19,8 +19,8 @@ namespace webrtc { + namespace { + + // TODO(sergeyu): This code is not thread safe. Fix it. Bug 2202. +-static bool g_xserver_error_trap_enabled = false; +-static int g_last_xserver_error_code = 0; ++static thread_local bool g_xserver_error_trap_enabled = false; ++static thread_local int g_last_xserver_error_code = 0; + + int XServerErrorHandler(Display* display, XErrorEvent* error_event) { + RTC_DCHECK(g_xserver_error_trap_enabled); From 7bf5200efda35817a59a378c148ccd81a6235706 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Tue, 17 Aug 2021 16:17:45 -0400 Subject: [PATCH 05/12] Disable kDesktopCaptureMacV2 https: //chromium-review.googlesource.com/c/chromium/src/+/3069272 (cherry picked from commit 4b308cb8c37b8d84bce8f037d11c242ce9d45845) Co-Authored-By: Robo --- shell/browser/feature_list.cc | 6 ------ shell/browser/native_window_mac.mm | 8 ++++++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/shell/browser/feature_list.cc b/shell/browser/feature_list.cc index 8a488a08294c3..366eec41403f4 100644 --- a/shell/browser/feature_list.cc +++ b/shell/browser/feature_list.cc @@ -48,12 +48,6 @@ void InitializeFeatureList() { // an empty suggestions list to be returned disable_features += std::string(",") + spellcheck::kWinRetrieveSuggestionsOnlyOnDemand.name; -#endif -#if defined(OS_MAC) - // Disable kWindowCaptureMacV2, which causes the wrong window id to - // be returned (this has been disabled in upstream Chromium here): - // https://chromium-review.googlesource.com/c/chromium/src/+/3069272 - disable_features += std::string(",") + features::kWindowCaptureMacV2.name; #endif base::FeatureList::InitializeInstance(enable_features, disable_features); } diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index 9fdc15144d2e6..2d31320a95034 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -23,7 +23,6 @@ #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/desktop_media_id.h" -#include "content/public/common/content_features.h" #include "shell/browser/javascript_environment.h" #include "shell/browser/native_browser_view_mac.h" #include "shell/browser/ui/cocoa/electron_native_widget_mac.h" @@ -256,6 +255,11 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { [self setFrame:[[self superview] bounds]]; } +// Refs https://github.com/electron/electron/pull/30507 +// TODO: Enable this flag to match upstream +const base::Feature kWindowCaptureMacV2{"WindowCaptureMacV2", + base::FEATURE_DISABLED_BY_DEFAULT}; + } // namespace NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options, @@ -1256,7 +1260,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { content::DesktopMediaID::TYPE_WINDOW, GetAcceleratedWidget()); // c.f. // https://source.chromium.org/chromium/chromium/src/+/master:chrome/browser/media/webrtc/native_desktop_media_list.cc;l=372?q=kWindowCaptureMacV2&ss=chromium - if (base::FeatureList::IsEnabled(features::kWindowCaptureMacV2)) { + if (base::FeatureList::IsEnabled(kWindowCaptureMacV2)) { if (remote_cocoa::ScopedCGWindowID::Get(desktop_media_id.id)) { desktop_media_id.window_id = desktop_media_id.id; } From 28dc56aa53f28762a95bf1c7e6c83b665202cdfe Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Tue, 17 Aug 2021 14:15:29 -0700 Subject: [PATCH 06/12] chore: fix lint (cherry picked from commit ed0d9adef6b9c5fb8c2b4bcf6783a3bd58605d51) --- shell/browser/native_window_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index 2d31320a95034..00b4517f2fae9 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -256,7 +256,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { } // Refs https://github.com/electron/electron/pull/30507 -// TODO: Enable this flag to match upstream +// TODO(deepak1556): Enable this flag to match upstream const base::Feature kWindowCaptureMacV2{"WindowCaptureMacV2", base::FEATURE_DISABLED_BY_DEFAULT}; From 7b634dead1ada3ddb1c73d5cd0e63c756331428e Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Wed, 18 Aug 2021 10:04:40 -0400 Subject: [PATCH 07/12] fixup Disable kDesktopCaptureMacV2 --- shell/browser/native_window_mac.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index 00b4517f2fae9..d2d7898c81a0c 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -257,9 +257,10 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { // Refs https://github.com/electron/electron/pull/30507 // TODO(deepak1556): Enable this flag to match upstream +#if 0 const base::Feature kWindowCaptureMacV2{"WindowCaptureMacV2", base::FEATURE_DISABLED_BY_DEFAULT}; - +#endif } // namespace NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options, @@ -1260,11 +1261,15 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { content::DesktopMediaID::TYPE_WINDOW, GetAcceleratedWidget()); // c.f. // https://source.chromium.org/chromium/chromium/src/+/master:chrome/browser/media/webrtc/native_desktop_media_list.cc;l=372?q=kWindowCaptureMacV2&ss=chromium +// Refs https://github.com/electron/electron/pull/30507 +// TODO(deepak1556): Enable this flag to match upstream WindowCaptureMacV2" +#if 0 if (base::FeatureList::IsEnabled(kWindowCaptureMacV2)) { if (remote_cocoa::ScopedCGWindowID::Get(desktop_media_id.id)) { desktop_media_id.window_id = desktop_media_id.id; } } +#endif return desktop_media_id; } From 4b930be18e0849a3bc3d9f71ddd5a83eb0f11cf7 Mon Sep 17 00:00:00 2001 From: "electron-roller[bot]" <84116207+electron-roller[bot]@users.noreply.github.com> Date: Thu, 19 Aug 2021 13:01:10 +0000 Subject: [PATCH 08/12] chore: bump chromium in DEPS to 93.0.4577.51 --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index b1682fceb681a..55d987e981325 100644 --- a/DEPS +++ b/DEPS @@ -15,7 +15,7 @@ gclient_gn_args = [ vars = { 'chromium_version': - '93.0.4577.42', + '93.0.4577.51', 'node_version': 'v14.17.0', 'nan_version': From a84547702245f72f255c09ac8dccfe11d9594c16 Mon Sep 17 00:00:00 2001 From: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Date: Thu, 19 Aug 2021 13:14:04 +0000 Subject: [PATCH 09/12] chore: update patches --- .../chromium/add_didinstallconditionalfeatures.patch | 8 ++++---- ...ld_do_not_depend_on_packed_resource_integrity.patch | 2 +- patches/chromium/can_create_window.patch | 2 +- patches/chromium/disable_color_correct_rendering.patch | 4 ++-- ...tially_null_getwebframe_-_view_when_get_blink.patch | 4 ++-- patches/chromium/notification_provenance.patch | 4 ++-- .../chromium/support_mixed_sandbox_with_zygote.patch | 10 +++++----- patches/chromium/webview_fullscreen.patch | 2 +- patches/v8/dcheck.patch | 4 ++-- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/patches/chromium/add_didinstallconditionalfeatures.patch b/patches/chromium/add_didinstallconditionalfeatures.patch index 3c41cb4ca7b73..7f7fcda3d4e39 100644 --- a/patches/chromium/add_didinstallconditionalfeatures.patch +++ b/patches/chromium/add_didinstallconditionalfeatures.patch @@ -23,10 +23,10 @@ index e24c169444c699f295de2c1f1f42683eeca73436..4675cdccb1876a318a9a0253cdf552bb int32_t world_id) {} virtual void DidClearWindowObject() {} diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index c8139a90c462297ceaed71c5db1be8b35e310f20..6452ed9146a51730ef61fc7500d3eec52205704b 100644 +index 118192cb4ea365f4b8fc84a802b9c6bb030461fc..6d1d25efeb8529c8af54d5429bf33a9dcad286aa 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -4435,6 +4435,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local context, +@@ -4456,6 +4456,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local context, observer.DidCreateScriptContext(context, world_id); } @@ -40,10 +40,10 @@ index c8139a90c462297ceaed71c5db1be8b35e310f20..6452ed9146a51730ef61fc7500d3eec5 int world_id) { for (auto& observer : observers_) diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h -index e3807f9844b07b080bb61cff047ccd31613f69a0..17abba3fbb003812db02ab9d35ea7e156d452383 100644 +index aff9b0217d9baf1cdb0724c1ecf9676c136c334d..64253b0e96aa12273ea4c8181274e58e139829e6 100644 --- a/content/renderer/render_frame_impl.h +++ b/content/renderer/render_frame_impl.h -@@ -587,6 +587,8 @@ class CONTENT_EXPORT RenderFrameImpl +@@ -589,6 +589,8 @@ class CONTENT_EXPORT RenderFrameImpl blink::WebLocalFrameClient::LazyLoadBehavior lazy_load_behavior) override; void DidCreateScriptContext(v8::Local context, int world_id) override; diff --git a/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch b/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch index 6bc8c9fd80113..dbfe62e038246 100644 --- a/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch +++ b/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch @@ -46,7 +46,7 @@ index 17e03f58263b5254cec991386536286de3b41600..65fdfcec6894249996fa12b947136247 } diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn -index 1625f8917ac257f11f4637ea60eca586ec2492a3..dc0f43e955994fba9dc597c08133a4438ebf1c45 100644 +index 139a04d6cbc1376340cf73a395e051fd2c7c9b11..73f0b275da7fef57f6c9956a16b5370f6771feac 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn @@ -5281,7 +5281,6 @@ test("unit_tests") { diff --git a/patches/chromium/can_create_window.patch b/patches/chromium/can_create_window.patch index 3a5394ccf97da..aaee7ed804ee3 100644 --- a/patches/chromium/can_create_window.patch +++ b/patches/chromium/can_create_window.patch @@ -9,7 +9,7 @@ potentially prevent a window from being created. TODO(loc): this patch is currently broken. diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc -index 4f87e25cc2e51a120c210ef0939daf4271717e77..f96dd88ce1caf154743b30e10db387de42ed37c8 100644 +index d0899ee86e4cd3906bc324bc7879d458d204ebc8..ecfa972c0e169f235a98239022681b423ce06b78 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc @@ -6280,6 +6280,7 @@ void RenderFrameHostImpl::CreateNewWindow( diff --git a/patches/chromium/disable_color_correct_rendering.patch b/patches/chromium/disable_color_correct_rendering.patch index e994406f5cf50..b6a2dd72e1264 100644 --- a/patches/chromium/disable_color_correct_rendering.patch +++ b/patches/chromium/disable_color_correct_rendering.patch @@ -241,7 +241,7 @@ index 59b34cdb1dc63b8d239cae5397b2a5a4f607bf1c..e2f556532459b1129465ca2b83aa1485 sandbox::policy::switches::kGpuSandboxAllowSysVShm, sandbox::policy::switches::kGpuSandboxFailuresFatal, diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index 700aca3c0ecb6e200a1db375b5ca730f6ed46012..b2fc3a92f79d71a1229e2f6890ee1f94c79511e8 100644 +index 9e9316c0bbbecbf425fb04f2cef9bb4f5caf98c6..bd24cb0f6edc37bf23c40f0a7839a2f5d85c9a01 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -217,6 +217,7 @@ @@ -252,7 +252,7 @@ index 700aca3c0ecb6e200a1db375b5ca730f6ed46012..b2fc3a92f79d71a1229e2f6890ee1f94 #include "ui/gl/gl_switches.h" #include "ui/native_theme/native_theme_features.h" #include "url/origin.h" -@@ -3399,6 +3400,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( +@@ -3426,6 +3427,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( // Propagate the following switches to the renderer command line (along // with any associated values) if present in the browser command line. static const char* const kSwitchNames[] = { diff --git a/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch b/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch index 7b0f2b70f9dcd..760360a97442c 100644 --- a/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch +++ b/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch @@ -11,10 +11,10 @@ This regressed in https://chromium-review.googlesource.com/c/chromium/src/+/2572 Upstream: https://chromium-review.googlesource.com/c/chromium/src/+/2598393 diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index 6452ed9146a51730ef61fc7500d3eec52205704b..a84e1b7407c2151cbc890369f2c8ee3b39ad7558 100644 +index 6d1d25efeb8529c8af54d5429bf33a9dcad286aa..36f28a560701c72b8369d657b673480968be07a9 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -2356,7 +2356,7 @@ const blink::WebView* RenderFrameImpl::GetWebView() const { +@@ -2357,7 +2357,7 @@ const blink::WebView* RenderFrameImpl::GetWebView() const { } const blink::web_pref::WebPreferences& RenderFrameImpl::GetBlinkPreferences() { diff --git a/patches/chromium/notification_provenance.patch b/patches/chromium/notification_provenance.patch index e99a7d9747007..cd5b89741a0f4 100644 --- a/patches/chromium/notification_provenance.patch +++ b/patches/chromium/notification_provenance.patch @@ -108,10 +108,10 @@ index b195cb84d8bba3c51b04f8c32cf909d15bf34335..37528715db985d12771ba2dca86dcec8 const GURL& document_url, mojo::PendingReceiver receiver); diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index fd1de106ba4598b8c6c2fea281f0781b7b593df2..7db50804c40d23d2bc17efe5b0d5a8341e7988d0 100644 +index 8d65e805544579ad06a8f6d532104f29d3742a1e..a5e1e13fb11996d4df926480ded2b901de08b75a 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -2324,7 +2324,7 @@ void RenderProcessHostImpl::CreateNotificationService( +@@ -2341,7 +2341,7 @@ void RenderProcessHostImpl::CreateNotificationService( document_url = rfh->GetLastCommittedURL(); storage_partition_impl_->GetPlatformNotificationContext()->CreateService( diff --git a/patches/chromium/support_mixed_sandbox_with_zygote.patch b/patches/chromium/support_mixed_sandbox_with_zygote.patch index 2afdb672c4ff8..350ee60b098b1 100644 --- a/patches/chromium/support_mixed_sandbox_with_zygote.patch +++ b/patches/chromium/support_mixed_sandbox_with_zygote.patch @@ -22,10 +22,10 @@ However, the patch would need to be reviewed by the security team, as it does touch a security-sensitive class. diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index 7db50804c40d23d2bc17efe5b0d5a8341e7988d0..700aca3c0ecb6e200a1db375b5ca730f6ed46012 100644 +index a5e1e13fb11996d4df926480ded2b901de08b75a..9e9316c0bbbecbf425fb04f2cef9bb4f5caf98c6 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -428,10 +428,18 @@ class RendererSandboxedProcessLauncherDelegate +@@ -429,10 +429,18 @@ class RendererSandboxedProcessLauncherDelegate public: RendererSandboxedProcessLauncherDelegate() = default; @@ -44,7 +44,7 @@ index 7db50804c40d23d2bc17efe5b0d5a8341e7988d0..700aca3c0ecb6e200a1db375b5ca730f const base::CommandLine& browser_command_line = *base::CommandLine::ForCurrentProcess(); base::CommandLine::StringType renderer_prefix = -@@ -449,6 +457,11 @@ class RendererSandboxedProcessLauncherDelegate +@@ -450,6 +458,11 @@ class RendererSandboxedProcessLauncherDelegate sandbox::policy::SandboxType GetSandboxType() override { return sandbox::policy::SandboxType::kRenderer; } @@ -56,7 +56,7 @@ index 7db50804c40d23d2bc17efe5b0d5a8341e7988d0..700aca3c0ecb6e200a1db375b5ca730f }; #if defined(OS_WIN) -@@ -460,6 +473,9 @@ class RendererSandboxedProcessLauncherDelegateWin +@@ -461,6 +474,9 @@ class RendererSandboxedProcessLauncherDelegateWin bool is_jit_disabled) : renderer_code_integrity_enabled_( GetContentClient()->browser()->IsRendererCodeIntegrityEnabled()) { @@ -66,7 +66,7 @@ index 7db50804c40d23d2bc17efe5b0d5a8341e7988d0..700aca3c0ecb6e200a1db375b5ca730f if (is_jit_disabled) { dynamic_code_can_be_disabled_ = true; return; -@@ -2039,9 +2055,15 @@ bool RenderProcessHostImpl::Init() { +@@ -2056,9 +2072,15 @@ bool RenderProcessHostImpl::Init() { std::unique_ptr sandbox_delegate = std::make_unique( cmd_line.get(), IsJitDisabled()); diff --git a/patches/chromium/webview_fullscreen.patch b/patches/chromium/webview_fullscreen.patch index 7d3e51d60c629..180d4b22d1411 100644 --- a/patches/chromium/webview_fullscreen.patch +++ b/patches/chromium/webview_fullscreen.patch @@ -14,7 +14,7 @@ Note that we also need to manually update embedder's `api::WebContents::IsFullscreenForTabOrPending` value. diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc -index f96dd88ce1caf154743b30e10db387de42ed37c8..93d649b7f1d40479f4b20259eca8ff790e76942b 100644 +index ecfa972c0e169f235a98239022681b423ce06b78..854c6753bd8a8140746a40601f45109722c7fc6e 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc @@ -5716,6 +5716,15 @@ void RenderFrameHostImpl::EnterFullscreen( diff --git a/patches/v8/dcheck.patch b/patches/v8/dcheck.patch index 3311535f5835a..858ad73c9cf06 100644 --- a/patches/v8/dcheck.patch +++ b/patches/v8/dcheck.patch @@ -19,10 +19,10 @@ index 84295e5cde0b2828d965b423e088793864ce29db..63aed17828461e5491904f368ef914ed isolate->default_microtask_queue()->PerformCheckpoint(this); } diff --git a/src/heap/heap.cc b/src/heap/heap.cc -index a4c0e4a728dc474c958014c148f0b9dce77218d5..b8d453270cb27940782079064049afe61d792db4 100644 +index bb5e91a829444d10dcdf5fe426aed59223353819..c1eed7de2f24154f029ac928a21daa2304070516 100644 --- a/src/heap/heap.cc +++ b/src/heap/heap.cc -@@ -5945,9 +5945,9 @@ void Heap::DeinitSharedSpaces() { +@@ -5951,9 +5951,9 @@ void Heap::DeinitSharedSpaces() { void Heap::AddGCPrologueCallback(v8::Isolate::GCCallbackWithData callback, GCType gc_type, void* data) { DCHECK_NOT_NULL(callback); From fe17ff1f2d8eeb490fc01923c3786028e7fa7d32 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Thu, 19 Aug 2021 16:06:42 -0700 Subject: [PATCH 10/12] Disable kDesktopCaptureMacV2 https://chromium-review.googlesource.com/c/chromium/src/+/3069272 (cherry picked from commit 205e4770374aba520f7c45dca8bb13f8d54bb1a9) --- shell/browser/native_window_mac.mm | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index d2d7898c81a0c..3e483a1537c5b 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -255,12 +255,6 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { [self setFrame:[[self superview] bounds]]; } -// Refs https://github.com/electron/electron/pull/30507 -// TODO(deepak1556): Enable this flag to match upstream -#if 0 -const base::Feature kWindowCaptureMacV2{"WindowCaptureMacV2", - base::FEATURE_DISABLED_BY_DEFAULT}; -#endif } // namespace NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options, @@ -1261,14 +1255,12 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { content::DesktopMediaID::TYPE_WINDOW, GetAcceleratedWidget()); // c.f. // https://source.chromium.org/chromium/chromium/src/+/master:chrome/browser/media/webrtc/native_desktop_media_list.cc;l=372?q=kWindowCaptureMacV2&ss=chromium -// Refs https://github.com/electron/electron/pull/30507 -// TODO(deepak1556): Enable this flag to match upstream WindowCaptureMacV2" + // Refs https://github.com/electron/electron/pull/30507 + // TODO(deepak1556): Match upstream for `kWindowCaptureMacV2` #if 0 - if (base::FeatureList::IsEnabled(kWindowCaptureMacV2)) { if (remote_cocoa::ScopedCGWindowID::Get(desktop_media_id.id)) { desktop_media_id.window_id = desktop_media_id.id; } - } #endif return desktop_media_id; } From 29ff074f1e8aba4cb9baacb4916090db295e2eac Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Thu, 8 Jul 2021 14:14:04 -0400 Subject: [PATCH 11/12] ci: run main and remote woa tests separately (cherry picked from commit 1de8f746b5c304d45002731283552ef2bf6ba0f9) --- azure-pipelines-woa.yml | 31 ++++++++++++++++-- script/spec-runner.js | 69 ++++++++++++++++++++++++----------------- 2 files changed, 68 insertions(+), 32 deletions(-) diff --git a/azure-pipelines-woa.yml b/azure-pipelines-woa.yml index a2e68aa95ac43..f58cf5d2152cd 100644 --- a/azure-pipelines-woa.yml +++ b/azure-pipelines-woa.yml @@ -53,6 +53,16 @@ steps: env: APPVEYOR_TOKEN: $(APPVEYOR_TOKEN) +- powershell: | + $localArtifactPath = "$pwd\src\pdb.zip" + $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/pdb.zip" + Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" } + cd src + & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -y pdb.zip + displayName: 'Download pdb files for detailed stacktraces' + env: + APPVEYOR_TOKEN: $(APPVEYOR_TOKEN) + - powershell: | New-Item src\out\Default\gen\node_headers\Release -Type directory Copy-Item -path src\out\Default\electron.lib -destination src\out\Default\gen\node_headers\Release\node.lib @@ -63,15 +73,30 @@ steps: set npm_config_nodedir=%cd%\out\Default\gen\node_headers set npm_config_arch=arm64 cd electron - # CalculateNativeWinOcclusion is disabled due to https://bugs.chromium.org/p/chromium/issues/detail?id=1139022 - node script/yarn test -- --enable-logging --verbose --disable-features=CalculateNativeWinOcclusion - displayName: 'Run Electron tests' + node script/yarn test --runners=main --runTestFilesSeperately --enable-logging --disable-features=CalculateNativeWinOcclusion + displayName: 'Run Electron Main process tests' + env: + ELECTRON_ENABLE_STACK_DUMPING: true + ELECTRON_OUT_DIR: Default + IGNORE_YARN_INSTALL_ERROR: 1 + ELECTRON_TEST_RESULTS_DIR: junit + MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap' + MOCHA_REPORTER: mocha-multi-reporters + +- script: | + cd src + set npm_config_nodedir=%cd%\out\Default\gen\node_headers + set npm_config_arch=arm64 + cd electron + node script/yarn test --runners=remote --enable-logging --disable-features=CalculateNativeWinOcclusion + displayName: 'Run Electron Remote based tests' env: ELECTRON_OUT_DIR: Default IGNORE_YARN_INSTALL_ERROR: 1 ELECTRON_TEST_RESULTS_DIR: junit MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap' MOCHA_REPORTER: mocha-multi-reporters + condition: always() - task: PublishTestResults@2 displayName: 'Publish Test Results' diff --git a/script/spec-runner.js b/script/spec-runner.js index 7775eb3b5460f..31162d32a76e1 100755 --- a/script/spec-runner.js +++ b/script/spec-runner.js @@ -13,7 +13,7 @@ const fail = '✗'.red; const args = require('minimist')(process.argv, { string: ['runners', 'target'], - boolean: ['buildNativeTests'], + boolean: ['buildNativeTests', 'runTestFilesSeperately'], unknown: arg => unknownFlags.push(arg) }); @@ -123,24 +123,55 @@ async function runElectronTests () { } } -async function runRemoteBasedElectronTests () { +async function runTestUsingElectron (specDir, testName) { let exe = path.resolve(BASE, utils.getElectronExec()); - const runnerArgs = ['electron/spec', ...unknownArgs.slice(2)]; + const runnerArgs = [`electron/${specDir}`, ...unknownArgs.slice(2)]; if (process.platform === 'linux') { runnerArgs.unshift(path.resolve(__dirname, 'dbus_mock.py'), exe); exe = 'python3'; } - - const { status } = childProcess.spawnSync(exe, runnerArgs, { + const { status, signal } = childProcess.spawnSync(exe, runnerArgs, { cwd: path.resolve(__dirname, '../..'), stdio: 'inherit' }); if (status !== 0) { - const textStatus = process.platform === 'win32' ? `0x${status.toString(16)}` : status.toString(); - console.log(`${fail} Electron tests failed with code ${textStatus}.`); + if (status) { + const textStatus = process.platform === 'win32' ? `0x${status.toString(16)}` : status.toString(); + console.log(`${fail} Electron tests failed with code ${textStatus}.`); + } else { + console.log(`${fail} Electron tests failed with kill signal ${signal}.`); + } process.exit(1); } - console.log(`${pass} Electron remote process tests passed.`); + console.log(`${pass} Electron ${testName} process tests passed.`); +} + +const specFilter = (file) => { + if (!/-spec\.[tj]s$/.test(file)) { + return false; + } else { + return true; + } +}; + +async function runTests (specDir, testName) { + if (args.runTestFilesSeperately) { + const getFiles = require('../spec/static/get-files'); + const testFiles = await getFiles(path.resolve(__dirname, `../${specDir}`), { filter: specFilter }); + const baseElectronDir = path.resolve(__dirname, '..'); + unknownArgs.splice(unknownArgs.length, 0, '--files', ''); + testFiles.sort().forEach(async (file) => { + unknownArgs.splice((unknownArgs.length - 1), 1, path.relative(baseElectronDir, file)); + console.log(`Running tests for ${unknownArgs[unknownArgs.length - 1]}`); + await runTestUsingElectron(specDir, testName); + }); + } else { + await runTestUsingElectron(specDir, testName); + } +} + +async function runRemoteBasedElectronTests () { + await runTests('spec', 'remote'); } async function runNativeElectronTests () { @@ -195,27 +226,7 @@ async function runNativeElectronTests () { } async function runMainProcessElectronTests () { - let exe = path.resolve(BASE, utils.getElectronExec()); - const runnerArgs = ['electron/spec-main', ...unknownArgs.slice(2)]; - if (process.platform === 'linux') { - runnerArgs.unshift(path.resolve(__dirname, 'dbus_mock.py'), exe); - exe = 'python3'; - } - - const { status, signal } = childProcess.spawnSync(exe, runnerArgs, { - cwd: path.resolve(__dirname, '../..'), - stdio: 'inherit' - }); - if (status !== 0) { - if (status) { - const textStatus = process.platform === 'win32' ? `0x${status.toString(16)}` : status.toString(); - console.log(`${fail} Electron tests failed with code ${textStatus}.`); - } else { - console.log(`${fail} Electron tests failed with kill signal ${signal}.`); - } - process.exit(1); - } - console.log(`${pass} Electron main process tests passed.`); + await runTests('spec-main', 'main'); } async function installSpecModules (dir) { From 807efab4323124883265dfe2c0f826629f8a53a8 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Thu, 19 Aug 2021 20:15:13 -0700 Subject: [PATCH 12/12] fixup! Disable kDesktopCaptureMacV2 (cherry picked from commit bc6b9746478554223cfd80d8bffcbc3903ec580a) --- patches/chromium/desktop_media_list.patch | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/patches/chromium/desktop_media_list.patch b/patches/chromium/desktop_media_list.patch index 230c294f4bdc7..1b3739be50dc2 100644 --- a/patches/chromium/desktop_media_list.patch +++ b/patches/chromium/desktop_media_list.patch @@ -20,6 +20,7 @@ the implementation in a given frame. but this call is not a one-shot but rather repeats the observer signals for every frame. This is the call which chrome currently uses. +* Disabled WindowCaptureMacV2 feature for https://github.com/electron/electron/pull/30507 This patch allows us to get the one-shot effect with the above classes. @@ -128,7 +129,7 @@ index ad7f766a36b1b6b2a8bc0f96369f1aaadf6681f7..f6c6c14a0937430df62c9b9c1132c591 protected: virtual ~DesktopMediaListObserver() {} diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc -index 5a851f4c89b4ed2b41640bf8bad47b7d8eba8ca1..b016a6268f6ca2517c69954499ba5b1433bfca9b 100644 +index 5a851f4c89b4ed2b41640bf8bad47b7d8eba8ca1..7687bad18acad2cd607d14d3d3ac39f81e7dcc8a 100644 --- a/chrome/browser/media/webrtc/native_desktop_media_list.cc +++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc @@ -11,15 +11,16 @@ @@ -149,7 +150,18 @@ index 5a851f4c89b4ed2b41640bf8bad47b7d8eba8ca1..b016a6268f6ca2517c69954499ba5b14 #include "media/base/video_util.h" #include "third_party/libyuv/include/libyuv/scale_argb.h" #include "third_party/skia/include/core/SkBitmap.h" -@@ -271,6 +272,8 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() { +@@ -94,8 +95,9 @@ gfx::ImageSkia ScaleDesktopFrame(std::unique_ptr frame, + } + + #if defined(OS_MAC) ++// Refs https://github.com/electron/electron/pull/30507 + const base::Feature kWindowCaptureMacV2{"WindowCaptureMacV2", +- base::FEATURE_ENABLED_BY_DEFAULT}; ++ base::FEATURE_DISABLED_BY_DEFAULT}; + #endif + + } // namespace +@@ -271,6 +273,8 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() { FROM_HERE, base::BindOnce(&NativeDesktopMediaList::UpdateNativeThumbnailsFinished, media_list_));