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

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

Issue 2303453003: Revert of Moves ash content specific tests into ash_content_unittests (Closed)
Patch Set: Created 4 years, 3 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/test/ash_test_base.h ('k') | ash/test/ash_test_environment.h » ('j') | 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/common/ash_switches.h" 10 #include "ash/common/ash_switches.h"
11 #include "ash/common/wm/window_positioner.h" 11 #include "ash/common/wm/window_positioner.h"
12 #include "ash/common/wm_root_window_controller.h" 12 #include "ash/common/wm_root_window_controller.h"
13 #include "ash/common/wm_shell.h" 13 #include "ash/common/wm_shell.h"
14 #include "ash/common/wm_window.h" 14 #include "ash/common/wm_window.h"
15 #include "ash/display/window_tree_host_manager.h" 15 #include "ash/display/window_tree_host_manager.h"
16 #include "ash/ime/input_method_event_handler.h" 16 #include "ash/ime/input_method_event_handler.h"
17 #include "ash/shell.h" 17 #include "ash/shell.h"
18 #include "ash/shell/toplevel_window.h" 18 #include "ash/shell/toplevel_window.h"
19 #include "ash/test/ash_test_environment.h"
20 #include "ash/test/ash_test_helper.h" 19 #include "ash/test/ash_test_helper.h"
21 #include "ash/test/display_manager_test_api.h" 20 #include "ash/test/display_manager_test_api.h"
22 #include "ash/test/test_session_state_delegate.h" 21 #include "ash/test/test_session_state_delegate.h"
23 #include "ash/test/test_shell_delegate.h" 22 #include "ash/test/test_shell_delegate.h"
24 #include "ash/test/test_system_tray_delegate.h" 23 #include "ash/test/test_system_tray_delegate.h"
25 #include "base/command_line.h" 24 #include "base/command_line.h"
26 #include "ui/aura/client/aura_constants.h" 25 #include "ui/aura/client/aura_constants.h"
27 #include "ui/aura/client/screen_position_client.h" 26 #include "ui/aura/client/screen_position_client.h"
28 #include "ui/aura/client/window_tree_client.h" 27 #include "ui/aura/client/window_tree_client.h"
29 #include "ui/aura/test/event_generator_delegate_aura.h" 28 #include "ui/aura/test/event_generator_delegate_aura.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 teardown_called_(false), 95 teardown_called_(false),
97 start_session_(true), 96 start_session_(true),
98 material_mode_(MaterialDesignController::Mode::UNINITIALIZED) { 97 material_mode_(MaterialDesignController::Mode::UNINITIALIZED) {
99 #if defined(USE_X11) 98 #if defined(USE_X11)
100 // This is needed for tests which use this base class but are run in browser 99 // This is needed for tests which use this base class but are run in browser
101 // test binaries so don't get the default initialization in the unit test 100 // test binaries so don't get the default initialization in the unit test
102 // suite. 101 // suite.
103 gfx::InitializeThreadedX11(); 102 gfx::InitializeThreadedX11();
104 #endif 103 #endif
105 104
106 ash_test_environment_ = AshTestEnvironment::Create(); 105 thread_bundle_.reset(new content::TestBrowserThreadBundle);
107
108 // Must initialize |ash_test_helper_| here because some tests rely on 106 // Must initialize |ash_test_helper_| here because some tests rely on
109 // AshTestBase methods before they call AshTestBase::SetUp(). 107 // AshTestBase methods before they call AshTestBase::SetUp().
110 ash_test_helper_.reset(new AshTestHelper(ash_test_environment_.get())); 108 ash_test_helper_.reset(new AshTestHelper(base::MessageLoopForUI::current()));
111 } 109 }
112 110
113 AshTestBase::~AshTestBase() { 111 AshTestBase::~AshTestBase() {
114 CHECK(setup_called_) 112 CHECK(setup_called_)
115 << "You have overridden SetUp but never called AshTestBase::SetUp"; 113 << "You have overridden SetUp but never called AshTestBase::SetUp";
116 CHECK(teardown_called_) 114 CHECK(teardown_called_)
117 << "You have overridden TearDown but never called AshTestBase::TearDown"; 115 << "You have overridden TearDown but never called AshTestBase::TearDown";
118 } 116 }
119 117
120 void AshTestBase::SetUp() { 118 void AshTestBase::SetUp() {
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 378
381 void AshTestBase::DisableIME() { 379 void AshTestBase::DisableIME() {
382 Shell::GetInstance()->RemovePreTargetHandler( 380 Shell::GetInstance()->RemovePreTargetHandler(
383 Shell::GetInstance() 381 Shell::GetInstance()
384 ->window_tree_host_manager() 382 ->window_tree_host_manager()
385 ->input_method_event_handler()); 383 ->input_method_event_handler());
386 } 384 }
387 385
388 } // namespace test 386 } // namespace test
389 } // namespace ash 387 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/ash_test_base.h ('k') | ash/test/ash_test_environment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698