OLD | NEW |
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 22 matching lines...) Expand all Loading... |
33 METRO_SNAP, | 33 METRO_SNAP, |
34 TO_NORMAL, | 34 TO_NORMAL, |
35 TO_FULLSCREEN, | 35 TO_FULLSCREEN, |
36 }; | 36 }; |
37 | 37 |
38 FullscreenControllerTestWindow(); | 38 FullscreenControllerTestWindow(); |
39 virtual ~FullscreenControllerTestWindow() {} | 39 virtual ~FullscreenControllerTestWindow() {} |
40 | 40 |
41 // BrowserWindow Interface: | 41 // BrowserWindow Interface: |
42 virtual void EnterFullscreen(const GURL& url, | 42 virtual void EnterFullscreen(const GURL& url, |
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 bool IsFullscreenWithChrome() OVERRIDE; | 53 virtual bool IsFullscreenWithChrome() override; |
54 virtual bool IsFullscreenWithoutChrome() OVERRIDE; | 54 virtual bool IsFullscreenWithoutChrome() override; |
55 #endif | 55 #endif |
56 | 56 |
57 static const char* GetWindowStateString(WindowState state); | 57 static const char* GetWindowStateString(WindowState state); |
58 WindowState state() const { return state_; } | 58 WindowState state() const { return state_; } |
59 void set_browser(Browser* browser) { browser_ = browser; } | 59 void set_browser(Browser* browser) { browser_ = browser; } |
60 | 60 |
61 // Simulates the window changing state. | 61 // Simulates the window changing state. |
62 void ChangeWindowFullscreenState(); | 62 void ChangeWindowFullscreenState(); |
63 | 63 |
64 private: | 64 private: |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 // FullscreenControllerStateUnitTest ------------------------------------------- | 206 // FullscreenControllerStateUnitTest ------------------------------------------- |
207 | 207 |
208 // Unit test fixture testing Fullscreen Controller through its states. Most of | 208 // Unit test fixture testing Fullscreen Controller through its states. Most of |
209 // the test logic comes from FullscreenControllerStateTest. | 209 // the test logic comes from FullscreenControllerStateTest. |
210 class FullscreenControllerStateUnitTest : public BrowserWithTestWindowTest, | 210 class FullscreenControllerStateUnitTest : public BrowserWithTestWindowTest, |
211 public FullscreenControllerStateTest { | 211 public FullscreenControllerStateTest { |
212 public: | 212 public: |
213 FullscreenControllerStateUnitTest(); | 213 FullscreenControllerStateUnitTest(); |
214 | 214 |
215 // FullscreenControllerStateTest: | 215 // FullscreenControllerStateTest: |
216 virtual void SetUp() OVERRIDE; | 216 virtual void SetUp() override; |
217 virtual BrowserWindow* CreateBrowserWindow() OVERRIDE; | 217 virtual BrowserWindow* CreateBrowserWindow() override; |
218 virtual void ChangeWindowFullscreenState() OVERRIDE; | 218 virtual void ChangeWindowFullscreenState() override; |
219 virtual const char* GetWindowStateString() OVERRIDE; | 219 virtual const char* GetWindowStateString() override; |
220 virtual void VerifyWindowState() OVERRIDE; | 220 virtual void VerifyWindowState() override; |
221 | 221 |
222 protected: | 222 protected: |
223 // FullscreenControllerStateTest: | 223 // FullscreenControllerStateTest: |
224 virtual bool ShouldSkipStateAndEventPair(State state, Event event) OVERRIDE; | 224 virtual bool ShouldSkipStateAndEventPair(State state, Event event) override; |
225 virtual Browser* GetBrowser() OVERRIDE; | 225 virtual Browser* GetBrowser() override; |
226 FullscreenControllerTestWindow* window_; | 226 FullscreenControllerTestWindow* window_; |
227 }; | 227 }; |
228 | 228 |
229 FullscreenControllerStateUnitTest::FullscreenControllerStateUnitTest () | 229 FullscreenControllerStateUnitTest::FullscreenControllerStateUnitTest () |
230 : window_(NULL) { | 230 : window_(NULL) { |
231 } | 231 } |
232 | 232 |
233 void FullscreenControllerStateUnitTest::SetUp() { | 233 void FullscreenControllerStateUnitTest::SetUp() { |
234 BrowserWithTestWindowTest::SetUp(); | 234 BrowserWithTestWindowTest::SetUp(); |
235 window_->set_browser(browser()); | 235 window_->set_browser(browser()); |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 EXPECT_FALSE(browser()->window()->IsFullscreen()); | 782 EXPECT_FALSE(browser()->window()->IsFullscreen()); |
783 EXPECT_FALSE(wc_delegate->IsFullscreenForTabOrPending(tab)); | 783 EXPECT_FALSE(wc_delegate->IsFullscreenForTabOrPending(tab)); |
784 EXPECT_FALSE(second_wc_delegate->IsFullscreenForTabOrPending(tab)); | 784 EXPECT_FALSE(second_wc_delegate->IsFullscreenForTabOrPending(tab)); |
785 EXPECT_FALSE(GetFullscreenController()->IsWindowFullscreenForTabOrPending()); | 785 EXPECT_FALSE(GetFullscreenController()->IsWindowFullscreenForTabOrPending()); |
786 EXPECT_FALSE(second_browser->fullscreen_controller()-> | 786 EXPECT_FALSE(second_browser->fullscreen_controller()-> |
787 IsWindowFullscreenForTabOrPending()); | 787 IsWindowFullscreenForTabOrPending()); |
788 | 788 |
789 // Required tear-down specific to this test. | 789 // Required tear-down specific to this test. |
790 second_browser->tab_strip_model()->CloseAllTabs(); | 790 second_browser->tab_strip_model()->CloseAllTabs(); |
791 } | 791 } |
OLD | NEW |