Commit d7db0e94 authored by Robert Sesek's avatar Robert Sesek Committed by Commit Bot

[Mac] Give FullscreenControllerTest a ScopedFakeNSWindowFullscreen.

This may resolve crashes seen in the WindowServer on swarming.

Tbr: miu@chromium.org
Bug: 828031
Change-Id: Iadbb4bcd74b03ab6abe75efc9b1f02a704ca3b74
Reviewed-on: https://chromium-review.googlesource.com/992453
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Reviewed-by: default avatarErik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547803}
parent 70ed485e
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "build/build_config.h"
#include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_hide_callback.h" #include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_hide_callback.h"
#include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h" #include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h"
...@@ -15,6 +16,10 @@ ...@@ -15,6 +16,10 @@
#include "content/public/browser/notification_service.h" #include "content/public/browser/notification_service.h"
#include "content/public/test/test_utils.h" #include "content/public/test/test_utils.h"
#if defined(OS_MACOSX)
#include "ui/base/test/scoped_fake_nswindow_fullscreen.h"
#endif
// Observer for NOTIFICATION_FULLSCREEN_CHANGED notifications. // Observer for NOTIFICATION_FULLSCREEN_CHANGED notifications.
class FullscreenNotificationObserver class FullscreenNotificationObserver
: public content::WindowedNotificationObserver { : public content::WindowedNotificationObserver {
...@@ -75,6 +80,13 @@ class FullscreenControllerTest : public InProcessBrowserTest { ...@@ -75,6 +80,13 @@ class FullscreenControllerTest : public InProcessBrowserTest {
void ToggleTabFullscreen_Internal(bool enter_fullscreen, void ToggleTabFullscreen_Internal(bool enter_fullscreen,
bool retry_until_success); bool retry_until_success);
#if defined(OS_MACOSX)
// On Mac, entering into the system fullscreen mode can tickle crashes in
// the WindowServer (c.f. https://crbug.com/828031), so provide a fake for
// testing.
ui::test::ScopedFakeNSWindowFullscreen fake_fullscreen_window_;
#endif
base::WeakPtrFactory<FullscreenControllerTest> weak_ptr_factory_; base::WeakPtrFactory<FullscreenControllerTest> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(FullscreenControllerTest); DISALLOW_COPY_AND_ASSIGN(FullscreenControllerTest);
......
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