From 2ef5090928a5eddd2bc7de27bb1550d5b9f09108 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 26 Oct 2022 14:57:07 -0700 Subject: [PATCH] re-enable the menu plugin test format --- .../macos/framework/Source/FlutterMenuPluginTest.mm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm b/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm index 326863c1b8e09..915df002c3d12 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm +++ b/shell/platform/darwin/macos/framework/Source/FlutterMenuPluginTest.mm @@ -25,6 +25,11 @@ - (bool)testSetMenu; @implementation FlutterMenuPluginTestObjc - (bool)testSetMenu { + // Workaround to deflake the test. + // See: https://github.com/flutter/flutter/issues/104748#issuecomment-1159336728 + NSView* view = [[NSView alloc] initWithFrame:NSZeroRect]; + view.wantsLayer = YES; + // Build a simulation of the default main menu. NSMenu* mainMenu = [[NSMenu alloc] init]; NSMenuItem* appNameMenu = [[NSMenuItem alloc] initWithTitle:@"APP_NAME" @@ -175,9 +180,7 @@ - (bool)testSetMenu { @end namespace flutter::testing { -// TODO(gspencergoog): Re-enabled when deflaked -// https://github.com/flutter/flutter/issues/106589 -TEST(FlutterMenuPluginTest, DISABLED_TestSetMenu) { +TEST(FlutterMenuPluginTest, TestSetMenu) { ASSERT_TRUE([[FlutterMenuPluginTestObjc alloc] testSetMenu]); } } // namespace flutter::testing