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. | |
64 athena::StartAthenaEnv(file_thread_->message_loop_proxy()); | 63 athena::StartAthenaEnv(file_thread_->message_loop_proxy()); |
65 athena::ExtensionsDelegate::CreateExtensionsDelegateForTest(); | 64 athena::ExtensionsDelegate::CreateExtensionsDelegateForTest(); |
66 athena::StartAthenaSession(new SampleActivityFactory(), | 65 athena::StartAthenaSession(new SampleActivityFactory(), |
67 new TestAppModelBuilder()); | 66 new TestAppModelBuilder()); |
68 } | 67 } |
69 | 68 |
70 void AthenaTestHelper::TearDown() { | 69 void AthenaTestHelper::TearDown() { |
71 teardown_called_ = true; | 70 teardown_called_ = true; |
72 | 71 |
73 athena::ShutdownAthena(); | 72 athena::ShutdownAthena(); |
(...skipping 18 matching lines...) Expand all Loading... |
92 | 91 |
93 void AthenaTestHelper::RunAllPendingInMessageLoop() { | 92 void AthenaTestHelper::RunAllPendingInMessageLoop() { |
94 // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them | 93 // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them |
95 // use run_loop.QuitClosure(). | 94 // use run_loop.QuitClosure(). |
96 base::RunLoop run_loop; | 95 base::RunLoop run_loop; |
97 run_loop.RunUntilIdle(); | 96 run_loop.RunUntilIdle(); |
98 } | 97 } |
99 | 98 |
100 } // namespace test | 99 } // namespace test |
101 } // namespace athena | 100 } // namespace athena |
OLD | NEW |