| 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 #include "ash/test/ash_test_base.h" | 5 #include "ash/test/ash_test_base.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 public: | 56 public: |
| 57 AshEventGeneratorDelegate() {} | 57 AshEventGeneratorDelegate() {} |
| 58 virtual ~AshEventGeneratorDelegate() {} | 58 virtual ~AshEventGeneratorDelegate() {} |
| 59 | 59 |
| 60 // aura::test::EventGeneratorDelegate overrides: | 60 // aura::test::EventGeneratorDelegate overrides: |
| 61 virtual aura::WindowEventDispatcher* GetDispatcherAt( | 61 virtual aura::WindowEventDispatcher* GetDispatcherAt( |
| 62 const gfx::Point& point_in_screen) const OVERRIDE { | 62 const gfx::Point& point_in_screen) const OVERRIDE { |
| 63 gfx::Screen* screen = Shell::GetScreen(); | 63 gfx::Screen* screen = Shell::GetScreen(); |
| 64 gfx::Display display = screen->GetDisplayNearestPoint(point_in_screen); | 64 gfx::Display display = screen->GetDisplayNearestPoint(point_in_screen); |
| 65 return Shell::GetInstance()->display_controller()-> | 65 return Shell::GetInstance()->display_controller()-> |
| 66 GetRootWindowForDisplayId(display.id())->GetDispatcher(); | 66 GetRootWindowForDisplayId(display.id())->GetHost()->dispatcher(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 virtual aura::client::ScreenPositionClient* GetScreenPositionClient( | 69 virtual aura::client::ScreenPositionClient* GetScreenPositionClient( |
| 70 const aura::Window* window) const OVERRIDE { | 70 const aura::Window* window) const OVERRIDE { |
| 71 return aura::client::GetScreenPositionClient(window->GetRootWindow()); | 71 return aura::client::GetScreenPositionClient(window->GetRootWindow()); |
| 72 } | 72 } |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 DISALLOW_COPY_AND_ASSIGN(AshEventGeneratorDelegate); | 75 DISALLOW_COPY_AND_ASSIGN(AshEventGeneratorDelegate); |
| 76 }; | 76 }; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 if (!command_line->HasSwitch(switches::kAshHostWindowBounds)) { | 116 if (!command_line->HasSwitch(switches::kAshHostWindowBounds)) { |
| 117 command_line->AppendSwitchASCII( | 117 command_line->AppendSwitchASCII( |
| 118 switches::kAshHostWindowBounds, "1+1-800x600"); | 118 switches::kAshHostWindowBounds, "1+1-800x600"); |
| 119 } | 119 } |
| 120 #if defined(OS_WIN) | 120 #if defined(OS_WIN) |
| 121 aura::test::SetUsePopupAsRootWindowForTest(true); | 121 aura::test::SetUsePopupAsRootWindowForTest(true); |
| 122 #endif | 122 #endif |
| 123 ash_test_helper_->SetUp(start_session_); | 123 ash_test_helper_->SetUp(start_session_); |
| 124 | 124 |
| 125 Shell::GetPrimaryRootWindow()->Show(); | 125 Shell::GetPrimaryRootWindow()->Show(); |
| 126 Shell::GetPrimaryRootWindow()->GetDispatcher()->host()->Show(); | 126 Shell::GetPrimaryRootWindow()->GetHost()->Show(); |
| 127 // Move the mouse cursor to far away so that native events doesn't | 127 // Move the mouse cursor to far away so that native events doesn't |
| 128 // interfere test expectations. | 128 // interfere test expectations. |
| 129 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); | 129 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); |
| 130 ash::Shell::GetInstance()->cursor_manager()->EnableMouseEvents(); | 130 ash::Shell::GetInstance()->cursor_manager()->EnableMouseEvents(); |
| 131 | 131 |
| 132 // Changing GestureConfiguration shouldn't make tests fail. | 132 // Changing GestureConfiguration shouldn't make tests fail. |
| 133 ui::GestureConfiguration::set_max_touch_move_in_pixels_for_click(5); | 133 ui::GestureConfiguration::set_max_touch_move_in_pixels_for_click(5); |
| 134 | 134 |
| 135 #if defined(OS_WIN) | 135 #if defined(OS_WIN) |
| 136 if (!command_line->HasSwitch(ash::switches::kForceAshToDesktop)) { | 136 if (!command_line->HasSwitch(ash::switches::kForceAshToDesktop)) { |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 | 340 |
| 341 void AshTestBase::UnblockUserSession() { | 341 void AshTestBase::UnblockUserSession() { |
| 342 Shell::GetInstance()->session_state_delegate()->UnlockScreen(); | 342 Shell::GetInstance()->session_state_delegate()->UnlockScreen(); |
| 343 SetSessionStarted(true); | 343 SetSessionStarted(true); |
| 344 SetUserAddingScreenRunning(false); | 344 SetUserAddingScreenRunning(false); |
| 345 } | 345 } |
| 346 | 346 |
| 347 | 347 |
| 348 } // namespace test | 348 } // namespace test |
| 349 } // namespace ash | 349 } // namespace ash |
| OLD | NEW |