Commit 83a27d8c authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

mac: disable windowserver shadows on bots

This is essentially a debugging hack - we know that windowserver
crashes on the bots are caused by CoreGraphics trying to software-
composite shadows from a window layer, and we know that these crashes
only happen on VMWare bots.

Bug: 899286
Change-Id: I531e6008ca30978dfb0f97562387af58cb53dd92
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1976016Reviewed-by: default avatarccameron <ccameron@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728531}
parent 82266f7b
......@@ -482,7 +482,9 @@ IN_PROC_BROWSER_TEST_F(NativeAppWindowCocoaBrowserTest, Frameless) {
// Windows created with NSBorderlessWindowMask by default don't have shadow,
// but packaged apps should always have one.
EXPECT_TRUE([ns_window hasShadow]);
// This specific check is disabled because shadows are disabled on the
// bots - see https://crbug.com/899286.
// EXPECT_TRUE([ns_window hasShadow]);
// Since the window has no constraints, it should have all of the following
// style mask bits.
......
......@@ -49,6 +49,25 @@ using remote_cocoa::mojom::WindowVisibilityState;
namespace {
constexpr auto kUIPaintTimeout = base::TimeDelta::FromSeconds(5);
bool AreWindowShadowsDisabled() {
// When:
// 1) Shadows are being generated by the window server
// 2) The window with the shadow has a layer (all of Chrome's do)
// 3) Software compositing is in use (it is in most test configs, which
// run in VMs)
// 4) There are many windows in use at once (they are when running
// test in parallel)
// The window server seems to crash with distressing frequency. To hopefully
// mitigate that, disable window shadows when running on a bot.
// For context on this see:
// https://crbug.com/899286
// https://crbug.com/828031
// https://crbug.com/515627, especially #63 and #67
static bool is_headless = getenv("CHROME_HEADLESS") != nullptr;
return is_headless;
}
} // namespace
// The NSView that hosts the composited CALayer drawing the UI. It fills the
......@@ -440,7 +459,8 @@ void NativeWidgetNSWindowBridge::InitWindow(
NSWindowCollectionBehaviorParticipatesInCycle];
}
[window_ setHasShadow:params->has_window_server_shadow];
[window_ setHasShadow:params->has_window_server_shadow &&
!AreWindowShadowsDisabled()];
// Don't allow dragging sheets.
if (params->modal_type == ui::MODAL_TYPE_WINDOW)
[window_ setMovable:NO];
......
......@@ -899,7 +899,9 @@ TEST_F(BridgedNativeWidgetInitTest, InitNotCalled) {
}
// Tests the shadow type given in InitParams.
TEST_F(BridgedNativeWidgetInitTest, ShadowType) {
// Disabled because shadows are disabled on the bots - see
// https://crbug.com/899286.
TEST_F(BridgedNativeWidgetInitTest, DISABLED_ShadowType) {
// Verify Widget::InitParam defaults and arguments added from SetUp().
EXPECT_EQ(Widget::InitParams::TYPE_WINDOW_FRAMELESS, type_);
EXPECT_EQ(Widget::InitParams::WindowOpacity::kOpaque, opacity_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment