| 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/test/aura_test_helper.h" | 7 #include "ui/aura/test/aura_test_helper.h" |
| 8 #include "ui/aura/window.h" |
| 8 #include "ui/base/gestures/gesture_configuration.h" | 9 #include "ui/base/gestures/gesture_configuration.h" |
| 9 #include "ui/base/ime/text_input_test_support.h" | 10 #include "ui/base/ime/text_input_test_support.h" |
| 10 | 11 |
| 11 namespace aura { | 12 namespace aura { |
| 12 namespace test { | 13 namespace test { |
| 13 | 14 |
| 14 AuraTestBase::AuraTestBase() { | 15 AuraTestBase::AuraTestBase() { |
| 15 } | 16 } |
| 16 | 17 |
| 17 AuraTestBase::~AuraTestBase() { | 18 AuraTestBase::~AuraTestBase() { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 void AuraTestBase::TearDown() { | 62 void AuraTestBase::TearDown() { |
| 62 // Flush the message loop because we have pending release tasks | 63 // Flush the message loop because we have pending release tasks |
| 63 // and these tasks if un-executed would upset Valgrind. | 64 // and these tasks if un-executed would upset Valgrind. |
| 64 RunAllPendingInMessageLoop(); | 65 RunAllPendingInMessageLoop(); |
| 65 | 66 |
| 66 helper_->TearDown(); | 67 helper_->TearDown(); |
| 67 ui::TextInputTestSupport::Shutdown(); | 68 ui::TextInputTestSupport::Shutdown(); |
| 68 testing::Test::TearDown(); | 69 testing::Test::TearDown(); |
| 69 } | 70 } |
| 70 | 71 |
| 72 Window* AuraTestBase::CreateTransientChild(int id, Window* parent) { |
| 73 Window* window = new Window(NULL); |
| 74 window->set_id(id); |
| 75 window->SetType(aura::client::WINDOW_TYPE_NORMAL); |
| 76 window->Init(ui::LAYER_TEXTURED); |
| 77 window->SetDefaultParentByRoot(root_window(), gfx::Rect()); |
| 78 parent->AddTransientChild(window); |
| 79 return window; |
| 80 } |
| 81 |
| 82 void AuraTestBase::SetDefaultParentByPrimaryRootWindow(aura::Window* window) { |
| 83 window->SetDefaultParentByRoot(root_window(), gfx::Rect()); |
| 84 } |
| 85 |
| 71 void AuraTestBase::RunAllPendingInMessageLoop() { | 86 void AuraTestBase::RunAllPendingInMessageLoop() { |
| 72 helper_->RunAllPendingInMessageLoop(); | 87 helper_->RunAllPendingInMessageLoop(); |
| 73 } | 88 } |
| 74 | 89 |
| 75 } // namespace test | 90 } // namespace test |
| 76 } // namespace aura | 91 } // namespace aura |
| OLD | NEW |