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

Side by Side Diff: chrome/browser/ui/fullscreen/fullscreen_controller_state_unittest.cc

Issue 652983005: mac: Fix bug where exiting tab fullscreen would cause Chrome menubar to disappear. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test. Created 6 years, 2 months 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 #include "chrome/browser/ui/browser.h" 7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/browser_tabstrip.h" 8 #include "chrome/browser/ui/browser_tabstrip.h"
9 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" 9 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
10 #include "chrome/browser/ui/fullscreen/fullscreen_controller_state_test.h" 10 #include "chrome/browser/ui/fullscreen/fullscreen_controller_state_test.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 FullscreenExitBubbleType type) override; 43 FullscreenExitBubbleType type) override;
44 virtual void ExitFullscreen() override; 44 virtual void ExitFullscreen() override;
45 virtual bool ShouldHideUIForFullscreen() const override; 45 virtual bool ShouldHideUIForFullscreen() const override;
46 virtual bool IsFullscreen() const override; 46 virtual bool IsFullscreen() const override;
47 #if defined(OS_WIN) 47 #if defined(OS_WIN)
48 virtual void SetMetroSnapMode(bool enable) override; 48 virtual void SetMetroSnapMode(bool enable) override;
49 virtual bool IsInMetroSnapMode() const override; 49 virtual bool IsInMetroSnapMode() const override;
50 #endif 50 #endif
51 #if defined(OS_MACOSX) 51 #if defined(OS_MACOSX)
52 virtual void EnterFullscreenWithChrome() override; 52 virtual void EnterFullscreenWithChrome() override;
53 virtual void EnterFullscreenWithoutChrome() override;
53 virtual bool IsFullscreenWithChrome() override; 54 virtual bool IsFullscreenWithChrome() override;
54 virtual bool IsFullscreenWithoutChrome() override; 55 virtual bool IsFullscreenWithoutChrome() override;
55 #endif 56 #endif
56 57
57 static const char* GetWindowStateString(WindowState state); 58 static const char* GetWindowStateString(WindowState state);
58 WindowState state() const { return state_; } 59 WindowState state() const { return state_; }
59 void set_browser(Browser* browser) { browser_ = browser; } 60 void set_browser(Browser* browser) { browser_ = browser; }
60 61
61 // Simulates the window changing state. 62 // Simulates the window changing state.
62 void ChangeWindowFullscreenState(); 63 void ChangeWindowFullscreenState();
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 bool FullscreenControllerTestWindow::IsInMetroSnapMode() const { 121 bool FullscreenControllerTestWindow::IsInMetroSnapMode() const {
121 return state_ == METRO_SNAP; 122 return state_ == METRO_SNAP;
122 } 123 }
123 #endif 124 #endif
124 125
125 #if defined(OS_MACOSX) 126 #if defined(OS_MACOSX)
126 void FullscreenControllerTestWindow::EnterFullscreenWithChrome() { 127 void FullscreenControllerTestWindow::EnterFullscreenWithChrome() {
127 EnterFullscreen(true); 128 EnterFullscreen(true);
128 } 129 }
129 130
131 void FullscreenControllerTestWindow::EnterFullscreenWithoutChrome() {
132 EnterFullscreen(false);
133 }
134
130 bool FullscreenControllerTestWindow::IsFullscreenWithChrome() { 135 bool FullscreenControllerTestWindow::IsFullscreenWithChrome() {
131 return IsFullscreen() && mac_with_chrome_mode_; 136 return IsFullscreen() && mac_with_chrome_mode_;
132 } 137 }
133 138
134 bool FullscreenControllerTestWindow::IsFullscreenWithoutChrome() { 139 bool FullscreenControllerTestWindow::IsFullscreenWithoutChrome() {
135 return IsFullscreen() && !mac_with_chrome_mode_; 140 return IsFullscreen() && !mac_with_chrome_mode_;
136 } 141 }
137 #endif 142 #endif
138 143
139 // static 144 // static
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 EXPECT_FALSE(browser()->window()->IsFullscreen()); 787 EXPECT_FALSE(browser()->window()->IsFullscreen());
783 EXPECT_FALSE(wc_delegate->IsFullscreenForTabOrPending(tab)); 788 EXPECT_FALSE(wc_delegate->IsFullscreenForTabOrPending(tab));
784 EXPECT_FALSE(second_wc_delegate->IsFullscreenForTabOrPending(tab)); 789 EXPECT_FALSE(second_wc_delegate->IsFullscreenForTabOrPending(tab));
785 EXPECT_FALSE(GetFullscreenController()->IsWindowFullscreenForTabOrPending()); 790 EXPECT_FALSE(GetFullscreenController()->IsWindowFullscreenForTabOrPending());
786 EXPECT_FALSE(second_browser->fullscreen_controller()-> 791 EXPECT_FALSE(second_browser->fullscreen_controller()->
787 IsWindowFullscreenForTabOrPending()); 792 IsWindowFullscreenForTabOrPending());
788 793
789 // Required tear-down specific to this test. 794 // Required tear-down specific to this test.
790 second_browser->tab_strip_model()->CloseAllTabs(); 795 second_browser->tab_strip_model()->CloseAllTabs();
791 } 796 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/fullscreen/fullscreen_controller.cc ('k') | chrome/test/base/test_browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698