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/display/display_controller.h" | 10 #include "ash/display/display_controller.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "ui/base/ime/text_input_test_support.h" | 28 #include "ui/base/ime/text_input_test_support.h" |
29 #include "ui/compositor/layer_animator.h" | 29 #include "ui/compositor/layer_animator.h" |
30 #include "ui/gfx/display.h" | 30 #include "ui/gfx/display.h" |
31 #include "ui/gfx/screen.h" | 31 #include "ui/gfx/screen.h" |
32 | 32 |
33 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
34 #include "ash/test/test_metro_viewer_process_host.h" | 34 #include "ash/test/test_metro_viewer_process_host.h" |
35 #include "base/win/windows_version.h" | 35 #include "base/win/windows_version.h" |
36 #include "ui/aura/remote_root_window_host_win.h" | 36 #include "ui/aura/remote_root_window_host_win.h" |
37 #include "ui/aura/root_window_host_win.h" | 37 #include "ui/aura/root_window_host_win.h" |
| 38 #include "win8/test/test_registrar_constants.h" |
38 #endif | 39 #endif |
39 | 40 |
40 namespace ash { | 41 namespace ash { |
41 namespace test { | 42 namespace test { |
42 namespace { | 43 namespace { |
43 | 44 |
44 class AshEventGeneratorDelegate : public aura::test::EventGeneratorDelegate { | 45 class AshEventGeneratorDelegate : public aura::test::EventGeneratorDelegate { |
45 public: | 46 public: |
46 AshEventGeneratorDelegate() {} | 47 AshEventGeneratorDelegate() {} |
47 virtual ~AshEventGeneratorDelegate() {} | 48 virtual ~AshEventGeneratorDelegate() {} |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 Shell::GetPrimaryRootWindow()->ShowRootWindow(); | 100 Shell::GetPrimaryRootWindow()->ShowRootWindow(); |
100 // Move the mouse cursor to far away so that native events doesn't | 101 // Move the mouse cursor to far away so that native events doesn't |
101 // interfere test expectations. | 102 // interfere test expectations. |
102 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); | 103 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); |
103 Shell::GetInstance()->cursor_manager()->EnableMouseEvents(); | 104 Shell::GetInstance()->cursor_manager()->EnableMouseEvents(); |
104 | 105 |
105 #if defined(OS_WIN) | 106 #if defined(OS_WIN) |
106 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { | 107 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { |
107 metro_viewer_host_.reset(new TestMetroViewerProcessHost("viewer")); | 108 metro_viewer_host_.reset(new TestMetroViewerProcessHost("viewer")); |
108 ASSERT_TRUE( | 109 ASSERT_TRUE( |
109 metro_viewer_host_->LaunchImmersiveChromeAndWaitForConnection()); | 110 metro_viewer_host_->LaunchImmersiveChromeAndWaitForConnection( |
| 111 win8::test::kDefaultTestAppUserModelId)); |
110 aura::RemoteRootWindowHostWin* root_window_host = | 112 aura::RemoteRootWindowHostWin* root_window_host = |
111 aura::RemoteRootWindowHostWin::Instance(); | 113 aura::RemoteRootWindowHostWin::Instance(); |
112 ASSERT_TRUE(root_window_host != NULL); | 114 ASSERT_TRUE(root_window_host != NULL); |
113 } | 115 } |
114 #endif | 116 #endif |
115 } | 117 } |
116 | 118 |
117 void AshTestBase::TearDown() { | 119 void AshTestBase::TearDown() { |
118 // Flush the message loop to finish pending release tasks. | 120 // Flush the message loop to finish pending release tasks. |
119 RunAllPendingInMessageLoop(); | 121 RunAllPendingInMessageLoop(); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 void AshTestBase::SetUserLoggedIn(bool user_logged_in) { | 245 void AshTestBase::SetUserLoggedIn(bool user_logged_in) { |
244 test_shell_delegate_->SetUserLoggedIn(user_logged_in); | 246 test_shell_delegate_->SetUserLoggedIn(user_logged_in); |
245 } | 247 } |
246 | 248 |
247 void AshTestBase::SetCanLockScreen(bool can_lock_screen) { | 249 void AshTestBase::SetCanLockScreen(bool can_lock_screen) { |
248 test_shell_delegate_->SetCanLockScreen(can_lock_screen); | 250 test_shell_delegate_->SetCanLockScreen(can_lock_screen); |
249 } | 251 } |
250 | 252 |
251 } // namespace test | 253 } // namespace test |
252 } // namespace ash | 254 } // namespace ash |
OLD | NEW |