| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 ui::GestureConfiguration::set_fling_acceleration_curve_coefficients( | 67 ui::GestureConfiguration::set_fling_acceleration_curve_coefficients( |
| 68 2, 0.0452381f); | 68 2, 0.0452381f); |
| 69 ui::GestureConfiguration::set_fling_acceleration_curve_coefficients( | 69 ui::GestureConfiguration::set_fling_acceleration_curve_coefficients( |
| 70 3, 0.8f); | 70 3, 0.8f); |
| 71 ui::GestureConfiguration::set_fling_velocity_cap(15000.0f); | 71 ui::GestureConfiguration::set_fling_velocity_cap(15000.0f); |
| 72 | 72 |
| 73 // The ContextFactory must exist before any Compositors are created. | 73 // The ContextFactory must exist before any Compositors are created. |
| 74 bool enable_pixel_output = false; | 74 bool enable_pixel_output = false; |
| 75 ui::InitializeContextFactoryForTests(enable_pixel_output); | 75 ui::InitializeContextFactoryForTests(enable_pixel_output); |
| 76 | 76 |
| 77 helper_.reset(new AuraTestHelper(&message_loop_)); | 77 helper_.reset(CreateHelper(&message_loop_)); |
| 78 helper_->SetUp(); | 78 helper_->SetUp(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void AuraTestBase::TearDown() { | 81 void AuraTestBase::TearDown() { |
| 82 teardown_called_ = true; | 82 teardown_called_ = true; |
| 83 | 83 |
| 84 // Flush the message loop because we have pending release tasks | 84 // Flush the message loop because we have pending release tasks |
| 85 // and these tasks if un-executed would upset Valgrind. | 85 // and these tasks if un-executed would upset Valgrind. |
| 86 RunAllPendingInMessageLoop(); | 86 RunAllPendingInMessageLoop(); |
| 87 | 87 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 112 client::ParentWindowWithContext(window, root_window(), gfx::Rect()); | 112 client::ParentWindowWithContext(window, root_window(), gfx::Rect()); |
| 113 } | 113 } |
| 114 | 114 |
| 115 bool AuraTestBase::DispatchEventUsingWindowDispatcher(ui::Event* event) { | 115 bool AuraTestBase::DispatchEventUsingWindowDispatcher(ui::Event* event) { |
| 116 ui::EventDispatchDetails details = | 116 ui::EventDispatchDetails details = |
| 117 event_processor()->OnEventFromSource(event); | 117 event_processor()->OnEventFromSource(event); |
| 118 CHECK(!details.dispatcher_destroyed); | 118 CHECK(!details.dispatcher_destroyed); |
| 119 return event->handled(); | 119 return event->handled(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 AuraTestHelper* AuraTestBase::CreateHelper( |
| 123 base::MessageLoopForUI* message_loop) { |
| 124 return new AuraTestHelper(message_loop); |
| 125 } |
| 126 |
| 122 } // namespace test | 127 } // namespace test |
| 123 } // namespace aura | 128 } // namespace aura |
| OLD | NEW |