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

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm

Issue 2516803002: [Mac] Tests for FullscreenToolbarController (Closed)
Patch Set: Fix for rsesek Created 4 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_animation_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm b/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm
index 6168e31f2302d7fb5ebadd549116eef2598ebf47..463d4b53b4982542d96d25487ef75e3b79cca37d 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm
@@ -352,19 +352,6 @@ class BrowserWindowControllerTest : public InProcessBrowserTest {
runner->Run();
}
- void VerifyFullscreenToolbarVisibility(FullscreenToolbarStyle style) {
- EXPECT_EQ(
- [[controller() fullscreenToolbarController] computeLayout].toolbarStyle,
- style);
-
- NSRect toolbarFrame = [[[controller() toolbarController] view] frame];
- NSRect screenFrame = [[[controller() window] screen] frame];
- if (style == FullscreenToolbarStyle::TOOLBAR_PRESENT)
- EXPECT_LE(NSMaxY(toolbarFrame), NSMaxY(screenFrame));
- else
- EXPECT_GE(NSMinY(toolbarFrame), NSMaxY(screenFrame));
- }
-
NSInteger GetExpectedTopInfoBarTipHeight() {
InfoBarContainerController* info_bar_container_controller =
[controller() infoBarContainerController];
@@ -731,30 +718,35 @@ IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, FullscreenResizeFlags) {
// Tests that the omnibox and tabs are hidden/visible in fullscreen mode.
// Ensure that when the user toggles this setting, the omnibox, tabs and
// preferences are updated correctly.
-// Flakily times out. http://crbug.com/599119
IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest,
- DISABLED_FullscreenToolbarIsVisibleAccordingToPrefs) {
+ FullscreenToolbarIsVisibleAccordingToPrefs) {
// Tests that the preference is set to true by default.
PrefService* prefs = browser()->profile()->GetPrefs();
EXPECT_TRUE(prefs->GetBoolean(prefs::kShowFullscreenToolbar));
+ [[controller() fullscreenToolbarController] setMenubarTracker:nil];
+
// Toggle fullscreen and check if the toolbar is shown.
ToggleFullscreenAndWaitForNotification();
- VerifyFullscreenToolbarVisibility(FullscreenToolbarStyle::TOOLBAR_PRESENT);
+ EXPECT_EQ(
+ FullscreenToolbarStyle::TOOLBAR_PRESENT,
+ [[controller() fullscreenToolbarController] computeLayout].toolbarStyle);
// Toggle the visibility of the fullscreen toolbar. Verify that the toolbar
// is hidden and the preference is correctly updated.
- [[controller() fullscreenToolbarController] setMenuBarRevealProgress:0.0];
chrome::ExecuteCommand(browser(), IDC_TOGGLE_FULLSCREEN_TOOLBAR);
EXPECT_FALSE(prefs->GetBoolean(prefs::kShowFullscreenToolbar));
- VerifyFullscreenToolbarVisibility(FullscreenToolbarStyle::TOOLBAR_HIDDEN);
+ EXPECT_EQ(
+ [[controller() fullscreenToolbarController] computeLayout].toolbarStyle,
Robert Sesek 2016/11/23 18:11:36 Flip these EXPECT_ too.
spqchan 2016/11/23 18:39:36 Done.
+ FullscreenToolbarStyle::TOOLBAR_HIDDEN);
// Toggle out and back into fullscreen and verify that the toolbar is still
// hidden.
ToggleFullscreenAndWaitForNotification();
ToggleFullscreenAndWaitForNotification();
- [[controller() fullscreenToolbarController] setMenuBarRevealProgress:0.0];
- VerifyFullscreenToolbarVisibility(FullscreenToolbarStyle::TOOLBAR_HIDDEN);
+ EXPECT_EQ(
+ [[controller() fullscreenToolbarController] computeLayout].toolbarStyle,
+ FullscreenToolbarStyle::TOOLBAR_HIDDEN);
chrome::ExecuteCommand(browser(), IDC_TOGGLE_FULLSCREEN_TOOLBAR);
EXPECT_TRUE(prefs->GetBoolean(prefs::kShowFullscreenToolbar));
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_animation_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698