| 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 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #import "base/mac/mac_util.h" | 8 #import "base/mac/mac_util.h" |
| 9 | 9 |
| 10 #include "base/mac/sdk_forward_declarations.h" | 10 #include "base/mac/sdk_forward_declarations.h" |
| (...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 // Tests that the preference is set to true by default. | 754 // Tests that the preference is set to true by default. |
| 755 PrefService* prefs = browser()->profile()->GetPrefs(); | 755 PrefService* prefs = browser()->profile()->GetPrefs(); |
| 756 EXPECT_TRUE(prefs->GetBoolean(prefs::kShowFullscreenToolbar)); | 756 EXPECT_TRUE(prefs->GetBoolean(prefs::kShowFullscreenToolbar)); |
| 757 | 757 |
| 758 // Toggle fullscreen and check if the toolbar is shown. | 758 // Toggle fullscreen and check if the toolbar is shown. |
| 759 ToggleFullscreenAndWaitForNotification(); | 759 ToggleFullscreenAndWaitForNotification(); |
| 760 VerifyFullscreenToolbarVisibility(fullscreen_mac::OMNIBOX_TABS_PRESENT); | 760 VerifyFullscreenToolbarVisibility(fullscreen_mac::OMNIBOX_TABS_PRESENT); |
| 761 | 761 |
| 762 // Toggle the visibility of the fullscreen toolbar. Verify that the toolbar | 762 // Toggle the visibility of the fullscreen toolbar. Verify that the toolbar |
| 763 // is hidden and the preference is correctly updated. | 763 // is hidden and the preference is correctly updated. |
| 764 [[controller() fullscreenToolbarController] setToolbarFraction:0.0]; | |
| 765 [[controller() fullscreenToolbarController] setMenuBarRevealProgress:0.0]; | 764 [[controller() fullscreenToolbarController] setMenuBarRevealProgress:0.0]; |
| 766 chrome::ExecuteCommand(browser(), IDC_TOGGLE_FULLSCREEN_TOOLBAR); | 765 chrome::ExecuteCommand(browser(), IDC_TOGGLE_FULLSCREEN_TOOLBAR); |
| 767 EXPECT_FALSE(prefs->GetBoolean(prefs::kShowFullscreenToolbar)); | 766 EXPECT_FALSE(prefs->GetBoolean(prefs::kShowFullscreenToolbar)); |
| 768 VerifyFullscreenToolbarVisibility(fullscreen_mac::OMNIBOX_TABS_HIDDEN); | 767 VerifyFullscreenToolbarVisibility(fullscreen_mac::OMNIBOX_TABS_HIDDEN); |
| 769 | 768 |
| 770 // Toggle out and back into fullscreen and verify that the toolbar is still | 769 // Toggle out and back into fullscreen and verify that the toolbar is still |
| 771 // hidden. | 770 // hidden. |
| 772 ToggleFullscreenAndWaitForNotification(); | 771 ToggleFullscreenAndWaitForNotification(); |
| 773 ToggleFullscreenAndWaitForNotification(); | 772 ToggleFullscreenAndWaitForNotification(); |
| 774 [[controller() fullscreenToolbarController] setMenuBarRevealProgress:0.0]; | 773 [[controller() fullscreenToolbarController] setMenuBarRevealProgress:0.0]; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 EXPECT_FALSE([fullscreenToolbarController isRevealingToolbarForTabstrip]); | 814 EXPECT_FALSE([fullscreenToolbarController isRevealingToolbarForTabstrip]); |
| 816 [fullscreenToolbarController resetToolbarFlag]; | 815 [fullscreenToolbarController resetToolbarFlag]; |
| 817 | 816 |
| 818 // Switch to a non-NTP tab. | 817 // Switch to a non-NTP tab. |
| 819 TabStripModel* model = browser()->tab_strip_model(); | 818 TabStripModel* model = browser()->tab_strip_model(); |
| 820 model->ActivateTabAt(1, true); | 819 model->ActivateTabAt(1, true); |
| 821 ASSERT_FALSE([[controller() toolbarController] isLocationBarFocused]); | 820 ASSERT_FALSE([[controller() toolbarController] isLocationBarFocused]); |
| 822 EXPECT_TRUE([fullscreenToolbarController isRevealingToolbarForTabstrip]); | 821 EXPECT_TRUE([fullscreenToolbarController isRevealingToolbarForTabstrip]); |
| 823 [fullscreenToolbarController resetToolbarFlag]; | 822 [fullscreenToolbarController resetToolbarFlag]; |
| 824 } | 823 } |
| OLD | NEW |