| OLD | NEW |
| 1 |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 // 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 | 3 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 4 | 5 |
| 5 #include "ash/test/ash_test_base.h" | 6 #include "ash/test/ash_test_base.h" |
| 6 | 7 |
| 7 #include <string> | 8 #include <string> |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "ash/ash_switches.h" | 11 #include "ash/ash_switches.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "ui/gfx/display.h" | 33 #include "ui/gfx/display.h" |
| 33 #include "ui/gfx/screen.h" | 34 #include "ui/gfx/screen.h" |
| 34 | 35 |
| 35 #if defined(ENABLE_MESSAGE_CENTER) | 36 #if defined(ENABLE_MESSAGE_CENTER) |
| 36 #include "ui/message_center/message_center.h" | 37 #include "ui/message_center/message_center.h" |
| 37 #endif | 38 #endif |
| 38 | 39 |
| 39 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
| 40 #include "ash/test/test_metro_viewer_process_host.h" | 41 #include "ash/test/test_metro_viewer_process_host.h" |
| 41 #include "base/test/test_process_killer_win.h" | 42 #include "base/test/test_process_killer_win.h" |
| 43 #include "base/win/metro.h" |
| 42 #include "base/win/windows_version.h" | 44 #include "base/win/windows_version.h" |
| 43 #include "ui/aura/remote_root_window_host_win.h" | 45 #include "ui/aura/remote_root_window_host_win.h" |
| 44 #include "ui/aura/root_window_host_win.h" | 46 #include "ui/aura/root_window_host_win.h" |
| 47 #include "ui/base/ime/win/tsf_bridge.h" |
| 45 #include "win8/test/test_registrar_constants.h" | 48 #include "win8/test/test_registrar_constants.h" |
| 46 #endif | 49 #endif |
| 47 | 50 |
| 48 namespace ash { | 51 namespace ash { |
| 49 namespace test { | 52 namespace test { |
| 50 namespace { | 53 namespace { |
| 51 | 54 |
| 52 class AshEventGeneratorDelegate : public aura::test::EventGeneratorDelegate { | 55 class AshEventGeneratorDelegate : public aura::test::EventGeneratorDelegate { |
| 53 public: | 56 public: |
| 54 AshEventGeneratorDelegate() {} | 57 AshEventGeneratorDelegate() {} |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 AshTestBase::~AshTestBase() { | 91 AshTestBase::~AshTestBase() { |
| 89 } | 92 } |
| 90 | 93 |
| 91 void AshTestBase::SetUp() { | 94 void AshTestBase::SetUp() { |
| 92 // Use the origin (1,1) so that it doesn't over | 95 // Use the origin (1,1) so that it doesn't over |
| 93 // lap with the native mouse cursor. | 96 // lap with the native mouse cursor. |
| 94 CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 97 CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
| 95 switches::kAshHostWindowBounds, "1+1-800x600"); | 98 switches::kAshHostWindowBounds, "1+1-800x600"); |
| 96 #if defined(OS_WIN) | 99 #if defined(OS_WIN) |
| 97 aura::test::SetUsePopupAsRootWindowForTest(true); | 100 aura::test::SetUsePopupAsRootWindowForTest(true); |
| 101 if (base::win::IsTSFAwareRequired()) |
| 102 ui::TSFBridge::Initialize(); |
| 98 #endif | 103 #endif |
| 99 // Disable animations during tests. | 104 // Disable animations during tests. |
| 100 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( | 105 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( |
| 101 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); | 106 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); |
| 102 ui::TextInputTestSupport::Initialize(); | 107 ui::TextInputTestSupport::Initialize(); |
| 103 | 108 |
| 104 // Creates Shell and hook with Desktop. | 109 // Creates Shell and hook with Desktop. |
| 105 test_shell_delegate_ = new TestShellDelegate; | 110 test_shell_delegate_ = new TestShellDelegate; |
| 106 | 111 |
| 107 #if defined(ENABLE_MESSAGE_CENTER) | 112 #if defined(ENABLE_MESSAGE_CENTER) |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 void AshTestBase::SetUserLoggedIn(bool user_logged_in) { | 282 void AshTestBase::SetUserLoggedIn(bool user_logged_in) { |
| 278 test_shell_delegate_->SetUserLoggedIn(user_logged_in); | 283 test_shell_delegate_->SetUserLoggedIn(user_logged_in); |
| 279 } | 284 } |
| 280 | 285 |
| 281 void AshTestBase::SetCanLockScreen(bool can_lock_screen) { | 286 void AshTestBase::SetCanLockScreen(bool can_lock_screen) { |
| 282 test_shell_delegate_->SetCanLockScreen(can_lock_screen); | 287 test_shell_delegate_->SetCanLockScreen(can_lock_screen); |
| 283 } | 288 } |
| 284 | 289 |
| 285 } // namespace test | 290 } // namespace test |
| 286 } // namespace ash | 291 } // namespace ash |
| OLD | NEW |