diff --git a/tests/cefclient/cefclient_mac.mm b/tests/cefclient/cefclient_mac.mm index 16dd355b9..9c09f6a83 100644 --- a/tests/cefclient/cefclient_mac.mm +++ b/tests/cefclient/cefclient_mac.mm @@ -522,6 +522,14 @@ void RemoveMenuItem(NSMenu* menu, SEL action_selector) { } return NO; } + +// Requests that any state restoration archive be created with secure encoding +// (macOS 12+ only). See https://crrev.com/c737387656 for details. This also +// fixes an issue with macOS default behavior incorrectly restoring windows +// after hard reset (holding down the power button). +- (BOOL)applicationSupportsSecureRestorableState:(NSApplication*)app { + return YES; +} @end namespace client { diff --git a/tests/cefsimple/cefsimple_mac.mm b/tests/cefsimple/cefsimple_mac.mm index 939fd9955..7121f6665 100644 --- a/tests/cefsimple/cefsimple_mac.mm +++ b/tests/cefsimple/cefsimple_mac.mm @@ -119,6 +119,14 @@ } return NO; } + +// Requests that any state restoration archive be created with secure encoding +// (macOS 12+ only). See https://crrev.com/c737387656 for details. This also +// fixes an issue with macOS default behavior incorrectly restoring windows +// after hard reset (holding down the power button). +- (BOOL)applicationSupportsSecureRestorableState:(NSApplication*)app { + return YES; +} @end // Entry point function for the browser process.