Chromium Code Reviews| Index: chrome/browser/ui/cocoa/constrained_window/constrained_window_mac_browsertest.mm |
| diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac_browsertest.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac_browsertest.mm |
| index 5456a25e9436ba03c9852fa496a5d50ed6e0a273..8e6cedab97c2fa0af12b5d380dd5d67d514e8279 100644 |
| --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac_browsertest.mm |
| +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac_browsertest.mm |
| @@ -10,6 +10,8 @@ |
| #include "chrome/browser/ui/browser_window.h" |
| #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.h" |
| +#include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" |
| +#include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h" |
| #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| #include "chrome/test/base/in_process_browser_test.h" |
| #include "content/public/browser/web_contents.h" |
| @@ -154,3 +156,29 @@ IN_PROC_BROWSER_TEST_F(ConstrainedWindowMacTest, TabClose) { |
| TabStripModel::CLOSE_USER_GESTURE)); |
| EXPECT_EQ(1, tab_strip->count()); |
| } |
| + |
| +// Test that the sheet is still visible after entering and exiting fullscreen. |
| +IN_PROC_BROWSER_TEST_F(ConstrainedWindowMacTest, BrowserWindowFullscreen) { |
| + NiceMock<ConstrainedWindowDelegateMock> delegate; |
| + ConstrainedWindowMac dialog(&delegate, tab1_, sheet_); |
| + EXPECT_EQ(1.0, [sheet_window_ alphaValue]); |
| + |
| + // Toggle fullscreen twice: one for entering and one for exiting. |
| + // Check to see if the sheet is visible. |
| + for (int i = 0; i < 2; i++) { |
| + { |
| + // NOTIFICATION_FULLSCREEN_CHANGED is sent asynchronously. Wait for the |
| + // notification before testing the sheet's visibility. |
| + scoped_ptr<FullscreenNotificationObserver> waiter( |
| + new FullscreenNotificationObserver()); |
|
Robert Sesek
2015/12/09 16:29:05
This can probably be created on the stack ?
spqchan
2015/12/09 20:07:30
I tried it and it didn't work out.
I dug around an
|
| + browser() |
| + ->exclusive_access_manager() |
| + ->fullscreen_controller() |
| + ->ToggleBrowserFullscreenMode(); |
| + waiter->Wait(); |
|
Robert Sesek
2015/12/09 16:29:05
EXPECT that the alphaValue goes to 0 after the fir
spqchan
2015/12/09 20:07:30
No, since we are checking after it goes fullscreen
Robert Sesek
2015/12/09 20:12:27
Ah, right. I guess there isn't a good way to test
|
| + } |
| + EXPECT_EQ(1.0, [sheet_window_ alphaValue]); |
| + } |
| + |
| + dialog.CloseWebContentsModalDialog(); |
| +} |