Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Unified Diff: chrome/browser/ui/cocoa/constrained_window/constrained_window_mac_browsertest.mm

Issue 1495623008: Polish Tabstrip and Overlay Issues in Fullscreen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: SSLCertificateViewerCocoaTest fixed Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());
+ browser()
+ ->exclusive_access_manager()
+ ->fullscreen_controller()
+ ->ToggleBrowserFullscreenMode();
+ waiter->Wait();
+ }
+ EXPECT_EQ(1.0, [sheet_window_ alphaValue]);
+ }
+
+ dialog.CloseWebContentsModalDialog();
+}

Powered by Google App Engine
This is Rietveld 408576698