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

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

Issue 789403002: Rename fullscreen_exit_bubble_* to exclusive_access_bubble_* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated based on CR comments Created 6 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 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 22 matching lines...) Expand all
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 ~FullscreenControllerTestWindow() override {} 39 ~FullscreenControllerTestWindow() override {}
40 40
41 // BrowserWindow Interface: 41 // BrowserWindow Interface:
42 void EnterFullscreen(const GURL& url, 42 void EnterFullscreen(const GURL& url,
43 FullscreenExitBubbleType type, 43 ExclusiveAccessBubbleType type,
44 bool with_toolbar) override; 44 bool with_toolbar) override;
45 void ExitFullscreen() override; 45 void ExitFullscreen() override;
46 bool ShouldHideUIForFullscreen() const override; 46 bool ShouldHideUIForFullscreen() const override;
47 bool IsFullscreen() const override; 47 bool IsFullscreen() const override;
48 bool SupportsFullscreenWithToolbar() const override; 48 bool SupportsFullscreenWithToolbar() const override;
49 void UpdateFullscreenWithToolbar(bool with_toolbar) override; 49 void UpdateFullscreenWithToolbar(bool with_toolbar) override;
50 bool IsFullscreenWithToolbar() const override; 50 bool IsFullscreenWithToolbar() const override;
51 #if defined(OS_WIN) 51 #if defined(OS_WIN)
52 virtual void SetMetroSnapMode(bool enable) override; 52 virtual void SetMetroSnapMode(bool enable) override;
53 virtual bool IsInMetroSnapMode() const override; 53 virtual bool IsInMetroSnapMode() const override;
(...skipping 20 matching lines...) Expand all
74 }; 74 };
75 75
76 FullscreenControllerTestWindow::FullscreenControllerTestWindow() 76 FullscreenControllerTestWindow::FullscreenControllerTestWindow()
77 : state_(NORMAL), 77 : state_(NORMAL),
78 mac_with_toolbar_mode_(false), 78 mac_with_toolbar_mode_(false),
79 browser_(NULL) { 79 browser_(NULL) {
80 } 80 }
81 81
82 void FullscreenControllerTestWindow::EnterFullscreen( 82 void FullscreenControllerTestWindow::EnterFullscreen(
83 const GURL& url, 83 const GURL& url,
84 FullscreenExitBubbleType type, 84 ExclusiveAccessBubbleType type,
85 bool with_toolbar) { 85 bool with_toolbar) {
86 EnterFullscreen(with_toolbar); 86 EnterFullscreen(with_toolbar);
87 } 87 }
88 88
89 void FullscreenControllerTestWindow::ExitFullscreen() { 89 void FullscreenControllerTestWindow::ExitFullscreen() {
90 if (IsFullscreen()) { 90 if (IsFullscreen()) {
91 state_ = TO_NORMAL; 91 state_ = TO_NORMAL;
92 mac_with_toolbar_mode_ = false; 92 mac_with_toolbar_mode_ = false;
93 93
94 if (IsTransitionReentrant(false, false)) 94 if (IsTransitionReentrant(false, false))
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 // This currently occurs when an extension exits fullscreen via changing the 420 // This currently occurs when an extension exits fullscreen via changing the
421 // browser bounds. 421 // browser bounds.
422 TEST_F(FullscreenControllerStateUnitTest, ExitFullscreenViaBrowserWindow) { 422 TEST_F(FullscreenControllerStateUnitTest, ExitFullscreenViaBrowserWindow) {
423 AddTab(browser(), GURL(url::kAboutBlankURL)); 423 AddTab(browser(), GURL(url::kAboutBlankURL));
424 ASSERT_TRUE(InvokeEvent(TOGGLE_FULLSCREEN)); 424 ASSERT_TRUE(InvokeEvent(TOGGLE_FULLSCREEN));
425 ASSERT_TRUE(InvokeEvent(WINDOW_CHANGE)); 425 ASSERT_TRUE(InvokeEvent(WINDOW_CHANGE));
426 ASSERT_TRUE(browser()->window()->IsFullscreen()); 426 ASSERT_TRUE(browser()->window()->IsFullscreen());
427 // Exit fullscreen without going through fullscreen controller. 427 // Exit fullscreen without going through fullscreen controller.
428 browser()->window()->ExitFullscreen(); 428 browser()->window()->ExitFullscreen();
429 ChangeWindowFullscreenState(); 429 ChangeWindowFullscreenState();
430 EXPECT_EQ(FEB_TYPE_NONE, 430 EXPECT_EQ(EXCLUSIVE_ACCESS_BUBBLE_TYPE_NONE,
431 browser()->fullscreen_controller()->GetFullscreenExitBubbleType()); 431 browser()->fullscreen_controller()->GetExclusiveAccessBubbleType());
432 } 432 }
433 433
434 // Test that switching tabs takes the browser out of tab fullscreen. 434 // Test that switching tabs takes the browser out of tab fullscreen.
435 TEST_F(FullscreenControllerStateUnitTest, ExitTabFullscreenViaSwitchingTab) { 435 TEST_F(FullscreenControllerStateUnitTest, ExitTabFullscreenViaSwitchingTab) {
436 AddTab(browser(), GURL(url::kAboutBlankURL)); 436 AddTab(browser(), GURL(url::kAboutBlankURL));
437 AddTab(browser(), GURL(url::kAboutBlankURL)); 437 AddTab(browser(), GURL(url::kAboutBlankURL));
438 ASSERT_TRUE(InvokeEvent(TAB_FULLSCREEN_TRUE)); 438 ASSERT_TRUE(InvokeEvent(TAB_FULLSCREEN_TRUE));
439 ASSERT_TRUE(InvokeEvent(WINDOW_CHANGE)); 439 ASSERT_TRUE(InvokeEvent(WINDOW_CHANGE));
440 ASSERT_TRUE(browser()->window()->IsFullscreen()); 440 ASSERT_TRUE(browser()->window()->IsFullscreen());
441 441
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 EXPECT_FALSE(browser()->window()->IsFullscreen()); 785 EXPECT_FALSE(browser()->window()->IsFullscreen());
786 EXPECT_FALSE(wc_delegate->IsFullscreenForTabOrPending(tab)); 786 EXPECT_FALSE(wc_delegate->IsFullscreenForTabOrPending(tab));
787 EXPECT_FALSE(second_wc_delegate->IsFullscreenForTabOrPending(tab)); 787 EXPECT_FALSE(second_wc_delegate->IsFullscreenForTabOrPending(tab));
788 EXPECT_FALSE(GetFullscreenController()->IsWindowFullscreenForTabOrPending()); 788 EXPECT_FALSE(GetFullscreenController()->IsWindowFullscreenForTabOrPending());
789 EXPECT_FALSE(second_browser->fullscreen_controller()-> 789 EXPECT_FALSE(second_browser->fullscreen_controller()->
790 IsWindowFullscreenForTabOrPending()); 790 IsWindowFullscreenForTabOrPending());
791 791
792 // Required tear-down specific to this test. 792 // Required tear-down specific to this test.
793 second_browser->tab_strip_model()->CloseAllTabs(); 793 second_browser->tab_strip_model()->CloseAllTabs();
794 } 794 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/fullscreen/fullscreen_controller.cc ('k') | chrome/browser/ui/fullscreen/fullscreen_controller_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698