Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: ash/test/ash_test_base.cc

Issue 2852403002: Make virtual keyboard work on supervised user creation (Closed)
Patch Set: nit. Restore DCHECK and updated comment. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/shell_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/extended_mouse_warp_controller.h" 10 #include "ash/display/extended_mouse_warp_controller.h"
(...skipping 30 matching lines...) Expand all
41 #include "ui/aura/window.h" 41 #include "ui/aura/window.h"
42 #include "ui/aura/window_delegate.h" 42 #include "ui/aura/window_delegate.h"
43 #include "ui/aura/window_tree_host.h" 43 #include "ui/aura/window_tree_host.h"
44 #include "ui/base/ime/input_method_initializer.h" 44 #include "ui/base/ime/input_method_initializer.h"
45 #include "ui/display/display.h" 45 #include "ui/display/display.h"
46 #include "ui/display/screen.h" 46 #include "ui/display/screen.h"
47 #include "ui/display/test/display_manager_test_api.h" 47 #include "ui/display/test/display_manager_test_api.h"
48 #include "ui/display/types/display_constants.h" 48 #include "ui/display/types/display_constants.h"
49 #include "ui/events/gesture_detection/gesture_configuration.h" 49 #include "ui/events/gesture_detection/gesture_configuration.h"
50 #include "ui/gfx/geometry/point.h" 50 #include "ui/gfx/geometry/point.h"
51 #include "ui/keyboard/keyboard_controller.h"
51 #include "ui/wm/core/coordinate_conversion.h" 52 #include "ui/wm/core/coordinate_conversion.h"
52 53
53 #if defined(USE_X11) 54 #if defined(USE_X11)
54 #include "ui/gfx/x/x11_connection.h" // nogncheck 55 #include "ui/gfx/x/x11_connection.h" // nogncheck
55 #endif 56 #endif
56 57
57 namespace ash { 58 namespace ash {
58 namespace test { 59 namespace test {
59 namespace { 60 namespace {
60 61
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 163
163 void AshTestBase::SetUp() { 164 void AshTestBase::SetUp() {
164 setup_called_ = true; 165 setup_called_ = true;
165 166
166 // Clears the saved state so that test doesn't use on the wrong 167 // Clears the saved state so that test doesn't use on the wrong
167 // default state. 168 // default state.
168 shell::ToplevelWindow::ClearSavedStateForTest(); 169 shell::ToplevelWindow::ClearSavedStateForTest();
169 170
170 ash_test_helper_->SetUp(start_session_); 171 ash_test_helper_->SetUp(start_session_);
171 172
173 // The following function should be invoked from
174 // ChromeBrowserMainExtraPartsAsh::PostProfileInit
175 // on real Chrome OS. Without this,
176 // LockActionHandlerLayoutManagerTest.KeyboardBounds fails on
177 // ShowKeyboard(true).
178 ash::Shell::GetPrimaryRootWindowController()->ActivateKeyboard(
179 keyboard::KeyboardController::GetInstance());
xiyuan 2017/06/07 15:08:13 If only that test fails without this, should this
oka 2017/06/07 15:45:19 ash_test_helper_->SetUp() initializes the keyboard
xiyuan 2017/06/07 16:18:13 But Shell::CreateKeyboard calls ActivateKeyboard t
180
172 Shell::GetPrimaryRootWindow()->Show(); 181 Shell::GetPrimaryRootWindow()->Show();
173 Shell::GetPrimaryRootWindow()->GetHost()->Show(); 182 Shell::GetPrimaryRootWindow()->GetHost()->Show();
174 // Move the mouse cursor to far away so that native events doesn't 183 // Move the mouse cursor to far away so that native events doesn't
175 // interfere test expectations. 184 // interfere test expectations.
176 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); 185 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000));
177 // TODO: mus/mash needs to support CursorManager. http://crbug.com/637853. 186 // TODO: mus/mash needs to support CursorManager. http://crbug.com/637853.
178 if (Shell::GetAshConfig() == Config::CLASSIC) 187 if (Shell::GetAshConfig() == Config::CLASSIC)
179 Shell::Get()->cursor_manager()->EnableMouseEvents(); 188 Shell::Get()->cursor_manager()->EnableMouseEvents();
180 189
181 UnblockCompositors(); 190 UnblockCompositors();
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 return display::Screen::GetScreen()->GetDisplayNearestWindow( 512 return display::Screen::GetScreen()->GetDisplayNearestWindow(
504 Shell::GetPrimaryRootWindow()); 513 Shell::GetPrimaryRootWindow());
505 } 514 }
506 515
507 display::Display AshTestBase::GetSecondaryDisplay() { 516 display::Display AshTestBase::GetSecondaryDisplay() {
508 return ash_test_helper_->GetSecondaryDisplay(); 517 return ash_test_helper_->GetSecondaryDisplay();
509 } 518 }
510 519
511 } // namespace test 520 } // namespace test
512 } // namespace ash 521 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698