OLD | NEW |
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 "ui/aura/test/aura_test_base.h" | 5 #include "ui/aura/test/aura_test_base.h" |
6 | 6 |
7 #include "ui/aura/client/window_tree_client.h" | 7 #include "ui/aura/client/window_tree_client.h" |
8 #include "ui/aura/test/aura_test_helper.h" | 8 #include "ui/aura/test/aura_test_helper.h" |
9 #include "ui/aura/test/test_window_delegate.h" | 9 #include "ui/aura/test/test_window_delegate.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 ui::ShutdownInputMethodForTesting(); | 87 ui::ShutdownInputMethodForTesting(); |
88 testing::Test::TearDown(); | 88 testing::Test::TearDown(); |
89 } | 89 } |
90 | 90 |
91 Window* AuraTestBase::CreateNormalWindow(int id, Window* parent, | 91 Window* AuraTestBase::CreateNormalWindow(int id, Window* parent, |
92 WindowDelegate* delegate) { | 92 WindowDelegate* delegate) { |
93 Window* window = new Window( | 93 Window* window = new Window( |
94 delegate ? delegate : | 94 delegate ? delegate : |
95 test::TestWindowDelegate::CreateSelfDestroyingDelegate()); | 95 test::TestWindowDelegate::CreateSelfDestroyingDelegate()); |
96 window->set_id(id); | 96 window->set_id(id); |
97 window->Init(aura::WINDOW_LAYER_TEXTURED); | 97 window->Init(ui::LAYER_TEXTURED); |
98 parent->AddChild(window); | 98 parent->AddChild(window); |
99 window->SetBounds(gfx::Rect(0, 0, 100, 100)); | 99 window->SetBounds(gfx::Rect(0, 0, 100, 100)); |
100 window->Show(); | 100 window->Show(); |
101 return window; | 101 return window; |
102 } | 102 } |
103 | 103 |
104 void AuraTestBase::RunAllPendingInMessageLoop() { | 104 void AuraTestBase::RunAllPendingInMessageLoop() { |
105 helper_->RunAllPendingInMessageLoop(); | 105 helper_->RunAllPendingInMessageLoop(); |
106 } | 106 } |
107 | 107 |
108 void AuraTestBase::ParentWindow(Window* window) { | 108 void AuraTestBase::ParentWindow(Window* window) { |
109 client::ParentWindowWithContext(window, root_window(), gfx::Rect()); | 109 client::ParentWindowWithContext(window, root_window(), gfx::Rect()); |
110 } | 110 } |
111 | 111 |
112 bool AuraTestBase::DispatchEventUsingWindowDispatcher(ui::Event* event) { | 112 bool AuraTestBase::DispatchEventUsingWindowDispatcher(ui::Event* event) { |
113 ui::EventDispatchDetails details = | 113 ui::EventDispatchDetails details = |
114 event_processor()->OnEventFromSource(event); | 114 event_processor()->OnEventFromSource(event); |
115 CHECK(!details.dispatcher_destroyed); | 115 CHECK(!details.dispatcher_destroyed); |
116 return event->handled(); | 116 return event->handled(); |
117 } | 117 } |
118 | 118 |
119 } // namespace test | 119 } // namespace test |
120 } // namespace aura | 120 } // namespace aura |
OLD | NEW |