| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 void AshTestBase::SetUp() { | 110 void AshTestBase::SetUp() { |
| 111 setup_called_ = true; | 111 setup_called_ = true; |
| 112 | 112 |
| 113 // Clears the saved state so that test doesn't use on the wrong | 113 // Clears the saved state so that test doesn't use on the wrong |
| 114 // default state. | 114 // default state. |
| 115 shell::ToplevelWindow::ClearSavedStateForTest(); | 115 shell::ToplevelWindow::ClearSavedStateForTest(); |
| 116 | 116 |
| 117 // TODO(jamescook): Can we do this without changing command line? | 117 // TODO(jamescook): Can we do this without changing command line? |
| 118 // Use the origin (1,1) so that it doesn't over | 118 // Use the origin (1,1) so that it doesn't over |
| 119 // lap with the native mouse cursor. | 119 // lap with the native mouse cursor. |
| 120 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 120 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 121 if (!command_line->HasSwitch(switches::kAshHostWindowBounds)) { | 121 if (!command_line->HasSwitch(switches::kAshHostWindowBounds)) { |
| 122 command_line->AppendSwitchASCII( | 122 command_line->AppendSwitchASCII( |
| 123 switches::kAshHostWindowBounds, "1+1-800x600"); | 123 switches::kAshHostWindowBounds, "1+1-800x600"); |
| 124 } | 124 } |
| 125 #if defined(OS_WIN) | 125 #if defined(OS_WIN) |
| 126 ui::test::SetUsePopupAsRootWindowForTest(true); | 126 ui::test::SetUsePopupAsRootWindowForTest(true); |
| 127 #endif | 127 #endif |
| 128 ash_test_helper_->SetUp(start_session_); | 128 ash_test_helper_->SetUp(start_session_); |
| 129 | 129 |
| 130 Shell::GetPrimaryRootWindow()->Show(); | 130 Shell::GetPrimaryRootWindow()->Show(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 158 #endif | 158 #endif |
| 159 } | 159 } |
| 160 | 160 |
| 161 void AshTestBase::TearDown() { | 161 void AshTestBase::TearDown() { |
| 162 teardown_called_ = true; | 162 teardown_called_ = true; |
| 163 // Flush the message loop to finish pending release tasks. | 163 // Flush the message loop to finish pending release tasks. |
| 164 RunAllPendingInMessageLoop(); | 164 RunAllPendingInMessageLoop(); |
| 165 | 165 |
| 166 #if defined(OS_WIN) | 166 #if defined(OS_WIN) |
| 167 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && | 167 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && |
| 168 !CommandLine::ForCurrentProcess()->HasSwitch( | 168 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 169 ash::switches::kForceAshToDesktop)) { | 169 ash::switches::kForceAshToDesktop)) { |
| 170 // Check that our viewer connection is still established. | 170 // Check that our viewer connection is still established. |
| 171 CHECK(!metro_viewer_host_->closed_unexpectedly()); | 171 CHECK(!metro_viewer_host_->closed_unexpectedly()); |
| 172 } | 172 } |
| 173 #endif | 173 #endif |
| 174 | 174 |
| 175 ash_test_helper_->TearDown(); | 175 ash_test_helper_->TearDown(); |
| 176 #if defined(OS_WIN) | 176 #if defined(OS_WIN) |
| 177 ui::test::SetUsePopupAsRootWindowForTest(false); | 177 ui::test::SetUsePopupAsRootWindowForTest(false); |
| 178 // Kill the viewer process if we spun one up. | 178 // Kill the viewer process if we spun one up. |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 | 332 |
| 333 void AshTestBase::UnblockUserSession() { | 333 void AshTestBase::UnblockUserSession() { |
| 334 Shell::GetInstance()->session_state_delegate()->UnlockScreen(); | 334 Shell::GetInstance()->session_state_delegate()->UnlockScreen(); |
| 335 SetSessionStarted(true); | 335 SetSessionStarted(true); |
| 336 SetUserAddingScreenRunning(false); | 336 SetUserAddingScreenRunning(false); |
| 337 } | 337 } |
| 338 | 338 |
| 339 | 339 |
| 340 } // namespace test | 340 } // namespace test |
| 341 } // namespace ash | 341 } // namespace ash |
| OLD | NEW |