| 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/main/athena_launcher.h" | 7 #include "athena/main/athena_launcher.h" |
| 8 #include "athena/test/sample_activity_factory.h" |
| 8 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 10 #include "ui/aura/client/aura_constants.h" | 11 #include "ui/aura/client/aura_constants.h" |
| 11 #include "ui/aura/env.h" | 12 #include "ui/aura/env.h" |
| 12 #include "ui/aura/input_state_lookup.h" | 13 #include "ui/aura/input_state_lookup.h" |
| 13 #include "ui/aura/test/env_test_helper.h" | 14 #include "ui/aura/test/env_test_helper.h" |
| 14 #include "ui/aura/test/test_focus_client.h" | 15 #include "ui/aura/test/test_focus_client.h" |
| 15 #include "ui/aura/test/test_screen.h" | 16 #include "ui/aura/test/test_screen.h" |
| 16 #include "ui/aura/window_event_dispatcher.h" | 17 #include "ui/aura/window_event_dispatcher.h" |
| 17 #include "ui/base/ime/input_method_initializer.h" | 18 #include "ui/base/ime/input_method_initializer.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // TODO(oshima): Switch to athena implementation. | 71 // TODO(oshima): Switch to athena implementation. |
| 71 focus_client_.reset(new aura::test::TestFocusClient); | 72 focus_client_.reset(new aura::test::TestFocusClient); |
| 72 aura::client::SetFocusClient(root_window(), | 73 aura::client::SetFocusClient(root_window(), |
| 73 focus_client_.get()); | 74 focus_client_.get()); |
| 74 new ::wm::DefaultActivationClient(root_window()); | 75 new ::wm::DefaultActivationClient(root_window()); |
| 75 | 76 |
| 76 root_window()->Show(); | 77 root_window()->Show(); |
| 77 // Ensure width != height so tests won't confuse them. | 78 // Ensure width != height so tests won't confuse them. |
| 78 host()->SetBounds(gfx::Rect(800, 600)); | 79 host()->SetBounds(gfx::Rect(800, 600)); |
| 79 | 80 |
| 80 athena::StartAthena(root_window()); | 81 athena::StartAthena(root_window(), new SampleActivityFactory()); |
| 81 } | 82 } |
| 82 | 83 |
| 83 void AthenaTestHelper::TearDown() { | 84 void AthenaTestHelper::TearDown() { |
| 84 teardown_called_ = true; | 85 teardown_called_ = true; |
| 85 | 86 |
| 86 athena::ShutdownAthena(); | 87 athena::ShutdownAthena(); |
| 87 | 88 |
| 88 aura::client::SetFocusClient(root_window(), NULL); | 89 aura::client::SetFocusClient(root_window(), NULL); |
| 89 focus_client_.reset(); | 90 focus_client_.reset(); |
| 90 input_method_filter_.reset(); | 91 input_method_filter_.reset(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 105 | 106 |
| 106 void AthenaTestHelper::RunAllPendingInMessageLoop() { | 107 void AthenaTestHelper::RunAllPendingInMessageLoop() { |
| 107 // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them | 108 // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them |
| 108 // use run_loop.QuitClosure(). | 109 // use run_loop.QuitClosure(). |
| 109 base::RunLoop run_loop; | 110 base::RunLoop run_loop; |
| 110 run_loop.RunUntilIdle(); | 111 run_loop.RunUntilIdle(); |
| 111 } | 112 } |
| 112 | 113 |
| 113 } // namespace test | 114 } // namespace test |
| 114 } // namespace athena | 115 } // namespace athena |
| OLD | NEW |