This source file includes following definitions.
- IN_PROC_BROWSER_TEST_F
- IN_PROC_BROWSER_TEST_F
#include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
#include "chrome/browser/ui/fullscreen/fullscreen_controller_test.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/immersive_mode_controller.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
typedef InProcessBrowserTest ZoomBubbleBrowserTest;
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA)
#define MAYBE_NonImmersiveFullscreen DISABLED_NonImmersiveFullscreen
#else
#define MAYBE_NonImmersiveFullscreen NonImmersiveFullscreen
#endif
IN_PROC_BROWSER_TEST_F(ZoomBubbleBrowserTest, MAYBE_NonImmersiveFullscreen) {
BrowserView* browser_view = static_cast<BrowserView*>(browser()->window());
content::WebContents* web_contents = browser_view->GetActiveWebContents();
ZoomBubbleView::ShowBubble(web_contents, true);
ASSERT_TRUE(ZoomBubbleView::IsShowing());
const ZoomBubbleView* zoom_bubble = ZoomBubbleView::GetZoomBubbleForTest();
EXPECT_TRUE(zoom_bubble->GetAnchorView());
{
scoped_ptr<FullscreenNotificationObserver> waiter(
new FullscreenNotificationObserver());
browser()->fullscreen_controller()->ToggleFullscreenModeForTab(
web_contents, true);
waiter->Wait();
}
ASSERT_FALSE(browser_view->immersive_mode_controller()->IsEnabled());
EXPECT_FALSE(ZoomBubbleView::IsShowing());
ZoomBubbleView::ShowBubble(web_contents, true);
ASSERT_TRUE(ZoomBubbleView::IsShowing());
zoom_bubble = ZoomBubbleView::GetZoomBubbleForTest();
EXPECT_FALSE(zoom_bubble->GetAnchorView());
{
scoped_ptr<FullscreenNotificationObserver> waiter(
new FullscreenNotificationObserver());
chrome::ToggleFullscreenMode(browser());
waiter->Wait();
}
}
#if defined(OS_CHROMEOS)
IN_PROC_BROWSER_TEST_F(ZoomBubbleBrowserTest, ImmersiveFullscreen) {
BrowserView* browser_view = static_cast<BrowserView*>(browser()->window());
content::WebContents* web_contents = browser_view->GetActiveWebContents();
ImmersiveModeController* immersive_controller =
browser_view->immersive_mode_controller();
immersive_controller->SetupForTest();
{
scoped_ptr<FullscreenNotificationObserver> waiter(
new FullscreenNotificationObserver());
chrome::ToggleFullscreenMode(browser());
waiter->Wait();
}
ASSERT_TRUE(immersive_controller->IsEnabled());
ASSERT_FALSE(immersive_controller->IsRevealed());
ZoomBubbleView::ShowBubble(web_contents, true);
ASSERT_TRUE(ZoomBubbleView::IsShowing());
const ZoomBubbleView* zoom_bubble = ZoomBubbleView::GetZoomBubbleForTest();
EXPECT_FALSE(zoom_bubble->GetAnchorView());
scoped_ptr<ImmersiveRevealedLock> immersive_reveal_lock(
immersive_controller->GetRevealedLock(
ImmersiveModeController::ANIMATE_REVEAL_NO));
ASSERT_TRUE(immersive_controller->IsRevealed());
EXPECT_FALSE(ZoomBubbleView::IsShowing());
ZoomBubbleView::ShowBubble(web_contents, true);
ASSERT_TRUE(ZoomBubbleView::IsShowing());
zoom_bubble = ZoomBubbleView::GetZoomBubbleForTest();
EXPECT_TRUE(zoom_bubble->GetAnchorView());
immersive_reveal_lock.reset();
EXPECT_TRUE(immersive_controller->IsRevealed());
ZoomBubbleView::CloseBubble();
content::RunAllPendingInMessageLoop();
EXPECT_FALSE(immersive_controller->IsRevealed());
{
scoped_ptr<FullscreenNotificationObserver> waiter(
new FullscreenNotificationObserver());
chrome::ToggleFullscreenMode(browser());
waiter->Wait();
}
}
#endif