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/exclusive_access/fullscreen_controller.h" | 9 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" |
10 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_state_test.h" | 10 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_state_test.h" |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 browser()->tab_strip_model()->ActivateTabAt(1, true); | 633 browser()->tab_strip_model()->ActivateTabAt(1, true); |
634 ASSERT_TRUE(InvokeEvent(TAB_FULLSCREEN_TRUE)); | 634 ASSERT_TRUE(InvokeEvent(TAB_FULLSCREEN_TRUE)); |
635 ASSERT_TRUE(InvokeEvent(WINDOW_CHANGE)); | 635 ASSERT_TRUE(InvokeEvent(WINDOW_CHANGE)); |
636 EXPECT_TRUE(browser()->window()->IsFullscreen()); | 636 EXPECT_TRUE(browser()->window()->IsFullscreen()); |
637 EXPECT_TRUE(wc_delegate->IsFullscreenForTabOrPending(first_tab)); | 637 EXPECT_TRUE(wc_delegate->IsFullscreenForTabOrPending(first_tab)); |
638 EXPECT_TRUE(wc_delegate->IsFullscreenForTabOrPending(second_tab)); | 638 EXPECT_TRUE(wc_delegate->IsFullscreenForTabOrPending(second_tab)); |
639 EXPECT_TRUE(GetFullscreenController()->IsWindowFullscreenForTabOrPending()); | 639 EXPECT_TRUE(GetFullscreenController()->IsWindowFullscreenForTabOrPending()); |
640 | 640 |
641 // Now, the first tab (backgrounded) exits fullscreen. This should not affect | 641 // Now, the first tab (backgrounded) exits fullscreen. This should not affect |
642 // the second tab's fullscreen, nor the state of the browser window. | 642 // the second tab's fullscreen, nor the state of the browser window. |
643 GetFullscreenController()->ToggleFullscreenModeForTab(first_tab, false); | 643 GetFullscreenController()->ExitFullscreenModeForTab(first_tab); |
644 EXPECT_TRUE(browser()->window()->IsFullscreen()); | 644 EXPECT_TRUE(browser()->window()->IsFullscreen()); |
645 EXPECT_FALSE(wc_delegate->IsFullscreenForTabOrPending(first_tab)); | 645 EXPECT_FALSE(wc_delegate->IsFullscreenForTabOrPending(first_tab)); |
646 EXPECT_TRUE(wc_delegate->IsFullscreenForTabOrPending(second_tab)); | 646 EXPECT_TRUE(wc_delegate->IsFullscreenForTabOrPending(second_tab)); |
647 EXPECT_TRUE(GetFullscreenController()->IsWindowFullscreenForTabOrPending()); | 647 EXPECT_TRUE(GetFullscreenController()->IsWindowFullscreenForTabOrPending()); |
648 | 648 |
649 // Finally, exit fullscreen on the second tab. | 649 // Finally, exit fullscreen on the second tab. |
650 ASSERT_TRUE(InvokeEvent(TAB_FULLSCREEN_FALSE)); | 650 ASSERT_TRUE(InvokeEvent(TAB_FULLSCREEN_FALSE)); |
651 ASSERT_TRUE(InvokeEvent(WINDOW_CHANGE)); | 651 ASSERT_TRUE(InvokeEvent(WINDOW_CHANGE)); |
652 EXPECT_FALSE(browser()->window()->IsFullscreen()); | 652 EXPECT_FALSE(browser()->window()->IsFullscreen()); |
653 EXPECT_FALSE(wc_delegate->IsFullscreenForTabOrPending(first_tab)); | 653 EXPECT_FALSE(wc_delegate->IsFullscreenForTabOrPending(first_tab)); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
OLD | NEW |