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

Side by Side Diff: chrome/browser/ui/views/location_bar/zoom_bubble_view_browsertest.cc

Issue 836933005: Refactor fullscreen_controller. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" 5 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h"
6 6
7 #include "chrome/browser/ui/browser_commands.h" 7 #include "chrome/browser/ui/browser_commands.h"
8 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" 8 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h"
9 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h" 9 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h"
10 #include "chrome/browser/ui/views/frame/browser_view.h" 10 #include "chrome/browser/ui/views/frame/browser_view.h"
(...skipping 20 matching lines...) Expand all
31 const ZoomBubbleView* zoom_bubble = ZoomBubbleView::GetZoomBubbleForTest(); 31 const ZoomBubbleView* zoom_bubble = ZoomBubbleView::GetZoomBubbleForTest();
32 EXPECT_TRUE(zoom_bubble->GetAnchorView()); 32 EXPECT_TRUE(zoom_bubble->GetAnchorView());
33 33
34 // Entering fullscreen should close the bubble. (We enter into tab fullscreen 34 // Entering fullscreen should close the bubble. (We enter into tab fullscreen
35 // here because tab fullscreen is non-immersive even on Chrome OS.) 35 // here because tab fullscreen is non-immersive even on Chrome OS.)
36 { 36 {
37 // NOTIFICATION_FULLSCREEN_CHANGED is sent asynchronously. Wait for the 37 // NOTIFICATION_FULLSCREEN_CHANGED is sent asynchronously. Wait for the
38 // notification before testing the zoom bubble visibility. 38 // notification before testing the zoom bubble visibility.
39 scoped_ptr<FullscreenNotificationObserver> waiter( 39 scoped_ptr<FullscreenNotificationObserver> waiter(
40 new FullscreenNotificationObserver()); 40 new FullscreenNotificationObserver());
41 browser()->fullscreen_controller()->ToggleFullscreenModeForTab( 41 browser()->ToggleFullscreenModeForTab(web_contents, true);
42 web_contents, true);
43 waiter->Wait(); 42 waiter->Wait();
44 } 43 }
45 ASSERT_FALSE(browser_view->immersive_mode_controller()->IsEnabled()); 44 ASSERT_FALSE(browser_view->immersive_mode_controller()->IsEnabled());
46 EXPECT_FALSE(ZoomBubbleView::IsShowing()); 45 EXPECT_FALSE(ZoomBubbleView::IsShowing());
47 46
48 // The bubble should not be anchored when it is shown in non-immersive 47 // The bubble should not be anchored when it is shown in non-immersive
49 // fullscreen. 48 // fullscreen.
50 ZoomBubbleView::ShowBubble(web_contents, true); 49 ZoomBubbleView::ShowBubble(web_contents, true);
51 ASSERT_TRUE(ZoomBubbleView::IsShowing()); 50 ASSERT_TRUE(ZoomBubbleView::IsShowing());
52 zoom_bubble = ZoomBubbleView::GetZoomBubbleForTest(); 51 zoom_bubble = ZoomBubbleView::GetZoomBubbleForTest();
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 115
117 // Exit fullscreen before ending the test for the sake of sanity. 116 // Exit fullscreen before ending the test for the sake of sanity.
118 { 117 {
119 scoped_ptr<FullscreenNotificationObserver> waiter( 118 scoped_ptr<FullscreenNotificationObserver> waiter(
120 new FullscreenNotificationObserver()); 119 new FullscreenNotificationObserver());
121 chrome::ToggleFullscreenMode(browser()); 120 chrome::ToggleFullscreenMode(browser());
122 waiter->Wait(); 121 waiter->Wait();
123 } 122 }
124 } 123 }
125 #endif // OS_CHROMEOS 124 #endif // OS_CHROMEOS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698