Index: chrome/browser/ui/views/frame/immersive_mode_controller_ash_unittest.cc |
diff --git a/chrome/browser/ui/views/frame/immersive_mode_controller_ash_unittest.cc b/chrome/browser/ui/views/frame/immersive_mode_controller_ash_unittest.cc |
index 7a061f8b3cbabd85ec9c5e215bba9bae5eee9a83..2bb693564abf1b57ea2488694d0234b9f06d6433 100644 |
--- a/chrome/browser/ui/views/frame/immersive_mode_controller_ash_unittest.cc |
+++ b/chrome/browser/ui/views/frame/immersive_mode_controller_ash_unittest.cc |
@@ -5,6 +5,7 @@ |
#include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h" |
#include "ash/display/display_manager.h" |
+#include "ash/screen_ash.h" |
#include "ash/shell.h" |
#include "ash/test/ash_test_base.h" |
#include "chrome/app/chrome_command_ids.h" |
@@ -17,11 +18,13 @@ |
#include "chrome/browser/ui/views/frame/top_container_view.h" |
#include "chrome/browser/ui/views/tabs/tab_strip.h" |
#include "chrome/browser/ui/views/toolbar_view.h" |
+#include "ui/aura/client/aura_constants.h" |
#include "ui/aura/client/cursor_client.h" |
#include "ui/aura/env.h" |
#include "ui/aura/root_window.h" |
#include "ui/aura/test/event_generator.h" |
#include "ui/aura/window.h" |
+#include "ui/base/ui_base_types.h" |
#include "ui/gfx/animation/slide_animation.h" |
#include "ui/views/bubble/bubble_delegate.h" |
#include "ui/views/controls/webview/webview.h" |
@@ -95,12 +98,15 @@ class ImmersiveModeControllerAshTest : public ash::test::AshTestBase { |
widget_ = new views::Widget(); |
views::Widget::InitParams params; |
params.context = CurrentContext(); |
- params.bounds = gfx::Rect(0, 0, 500, 500); |
widget_->Init(params); |
widget_->Show(); |
+ widget_->GetNativeWindow()->SetProperty(aura::client::kShowStateKey, |
+ ui::SHOW_STATE_FULLSCREEN); |
+ |
top_container_ = new views::View(); |
- top_container_->SetBounds(0, 0, 500, 100); |
+ top_container_->SetBounds( |
+ 0, 0, widget_->GetWindowBoundsInScreen().width(), 100); |
top_container_->set_focusable(true); |
widget_->GetContentsView()->AddChildView(top_container_); |
@@ -250,6 +256,12 @@ TEST_F(ImmersiveModeControllerAshTest, ImmersiveModeControllerAsh) { |
// Test mouse event processing for top-of-screen reveal triggering. |
TEST_F(ImmersiveModeControllerAshTest, OnMouseEvent) { |
// Set up initial state. |
+ UpdateDisplay("800x600,800x600"); |
+ ash::DisplayLayout display_layout(ash::DisplayLayout::RIGHT, 0); |
+ ash::Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays( |
+ display_layout); |
+ |
+ // Set up initial state. |
controller()->SetEnabled(true); |
ASSERT_TRUE(controller()->IsEnabled()); |
ASSERT_FALSE(controller()->IsRevealed()); |
@@ -301,8 +313,7 @@ TEST_F(ImmersiveModeControllerAshTest, OnMouseEvent) { |
EXPECT_EQ(top_edge_pos.x() + 100, mouse_x_when_hit_top()); |
// Moving off the top edge horizontally stops the timer. |
- EXPECT_GT(CurrentContext()->bounds().width(), top_container()->width()); |
- event_generator.MoveMouseTo(top_container_bounds_in_screen.right(), |
+ event_generator.MoveMouseTo(top_container_bounds_in_screen.right() + 1, |
top_container_bounds_in_screen.y()); |
EXPECT_FALSE(top_edge_hover_timer_running()); |