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 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 [fullscreenToolbarController resetToolbarFlag]; | 772 [fullscreenToolbarController resetToolbarFlag]; |
773 | 773 |
774 // Insert a new tab in the background. | 774 // Insert a new tab in the background. |
775 AddTabAtBackground(0, GURL("about:blank")); | 775 AddTabAtBackground(0, GURL("about:blank")); |
776 EXPECT_TRUE([fullscreenToolbarController isRevealingToolbarForTabstrip]); | 776 EXPECT_TRUE([fullscreenToolbarController isRevealingToolbarForTabstrip]); |
777 [fullscreenToolbarController resetToolbarFlag]; | 777 [fullscreenToolbarController resetToolbarFlag]; |
778 | 778 |
779 // Insert a NTP new tab in the foreground. | 779 // Insert a NTP new tab in the foreground. |
780 AddTabAtIndex(0, GURL("about:blank"), ui::PAGE_TRANSITION_LINK); | 780 AddTabAtIndex(0, GURL("about:blank"), ui::PAGE_TRANSITION_LINK); |
781 ASSERT_TRUE([[controller() toolbarController] isLocationBarFocused]); | 781 ASSERT_TRUE([[controller() toolbarController] isLocationBarFocused]); |
782 EXPECT_FALSE([fullscreenToolbarController isRevealingToolbarForTabstrip]); | 782 EXPECT_TRUE([fullscreenToolbarController isRevealingToolbarForTabstrip]); |
783 [fullscreenToolbarController resetToolbarFlag]; | 783 [fullscreenToolbarController resetToolbarFlag]; |
784 | 784 |
785 // Insert a new tab in the background. The animation should not be triggered | |
786 // since the location bar should still be focused. | |
787 AddTabAtBackground(1, GURL("http://google.com")); | 785 AddTabAtBackground(1, GURL("http://google.com")); |
788 ASSERT_TRUE([[controller() toolbarController] isLocationBarFocused]); | 786 ASSERT_TRUE([[controller() toolbarController] isLocationBarFocused]); |
789 EXPECT_FALSE([fullscreenToolbarController isRevealingToolbarForTabstrip]); | 787 EXPECT_TRUE([fullscreenToolbarController isRevealingToolbarForTabstrip]); |
790 [fullscreenToolbarController resetToolbarFlag]; | 788 [fullscreenToolbarController resetToolbarFlag]; |
791 | 789 |
792 // Switch to a non-NTP tab. | 790 // Switch to a non-NTP tab. |
793 TabStripModel* model = browser()->tab_strip_model(); | 791 TabStripModel* model = browser()->tab_strip_model(); |
794 model->ActivateTabAt(1, true); | 792 model->ActivateTabAt(1, true); |
795 ASSERT_FALSE([[controller() toolbarController] isLocationBarFocused]); | 793 ASSERT_FALSE([[controller() toolbarController] isLocationBarFocused]); |
796 EXPECT_TRUE([fullscreenToolbarController isRevealingToolbarForTabstrip]); | 794 EXPECT_TRUE([fullscreenToolbarController isRevealingToolbarForTabstrip]); |
797 [fullscreenToolbarController resetToolbarFlag]; | 795 [fullscreenToolbarController resetToolbarFlag]; |
798 } | 796 } |
OLD | NEW |