OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/test/athena_test_helper.h" | 5 #include "athena/test/athena_test_helper.h" |
6 | 6 |
7 #include "athena/env/public/athena_env.h" | 7 #include "athena/env/public/athena_env.h" |
8 #include "athena/extensions/public/extensions_delegate.h" | 8 #include "athena/extensions/public/extensions_delegate.h" |
9 #include "athena/main/public/athena_launcher.h" | 9 #include "athena/main/public/athena_launcher.h" |
10 #include "athena/test/sample_activity_factory.h" | 10 #include "athena/test/sample_activity_factory.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 chromeos::NetworkHandler::Initialize(); | 53 chromeos::NetworkHandler::Initialize(); |
54 ui::InitializeInputMethodForTesting(); | 54 ui::InitializeInputMethodForTesting(); |
55 aura::Env::CreateInstance(true); | 55 aura::Env::CreateInstance(true); |
56 aura::Env::GetInstance()->set_context_factory(context_factory); | 56 aura::Env::GetInstance()->set_context_factory(context_factory); |
57 | 57 |
58 // Unit tests generally don't want to query the system, rather use the state | 58 // Unit tests generally don't want to query the system, rather use the state |
59 // from RootWindow. | 59 // from RootWindow. |
60 aura::test::EnvTestHelper(aura::Env::GetInstance()) | 60 aura::test::EnvTestHelper(aura::Env::GetInstance()) |
61 .SetInputStateLookup(scoped_ptr<aura::InputStateLookup>()); | 61 .SetInputStateLookup(scoped_ptr<aura::InputStateLookup>()); |
62 | 62 |
| 63 // TODO(oshima): Use a BlockingPool task runner. |
63 athena::StartAthenaEnv(file_thread_->message_loop_proxy()); | 64 athena::StartAthenaEnv(file_thread_->message_loop_proxy()); |
64 athena::ExtensionsDelegate::CreateExtensionsDelegateForTest(); | 65 athena::ExtensionsDelegate::CreateExtensionsDelegateForTest(); |
65 athena::StartAthenaSession(new SampleActivityFactory(), | 66 athena::StartAthenaSession(new SampleActivityFactory(), |
66 new TestAppModelBuilder()); | 67 new TestAppModelBuilder()); |
67 } | 68 } |
68 | 69 |
69 void AthenaTestHelper::TearDown() { | 70 void AthenaTestHelper::TearDown() { |
70 teardown_called_ = true; | 71 teardown_called_ = true; |
71 | 72 |
72 athena::ShutdownAthena(); | 73 athena::ShutdownAthena(); |
(...skipping 18 matching lines...) Expand all Loading... |
91 | 92 |
92 void AthenaTestHelper::RunAllPendingInMessageLoop() { | 93 void AthenaTestHelper::RunAllPendingInMessageLoop() { |
93 // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them | 94 // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them |
94 // use run_loop.QuitClosure(). | 95 // use run_loop.QuitClosure(). |
95 base::RunLoop run_loop; | 96 base::RunLoop run_loop; |
96 run_loop.RunUntilIdle(); | 97 run_loop.RunUntilIdle(); |
97 } | 98 } |
98 | 99 |
99 } // namespace test | 100 } // namespace test |
100 } // namespace athena | 101 } // namespace athena |
OLD | NEW |