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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 1, -0.0238095f); | 66 1, -0.0238095f); |
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 ui::GestureConfiguration::set_min_swipe_speed(10); | 72 ui::GestureConfiguration::set_min_swipe_speed(10); |
73 | 73 |
74 // The ContextFactory must exist before any Compositors are created. | 74 // The ContextFactory must exist before any Compositors are created. |
75 bool enable_pixel_output = false; | 75 bool enable_pixel_output = false; |
76 ui::InitializeContextFactoryForTests(enable_pixel_output); | 76 ui::ContextFactory* context_factory = |
| 77 ui::InitializeContextFactoryForTests(enable_pixel_output); |
77 | 78 |
78 helper_.reset(new AuraTestHelper(&message_loop_)); | 79 helper_.reset(new AuraTestHelper(&message_loop_)); |
79 helper_->SetUp(); | 80 helper_->SetUp(context_factory); |
80 } | 81 } |
81 | 82 |
82 void AuraTestBase::TearDown() { | 83 void AuraTestBase::TearDown() { |
83 teardown_called_ = true; | 84 teardown_called_ = true; |
84 | 85 |
85 // Flush the message loop because we have pending release tasks | 86 // Flush the message loop because we have pending release tasks |
86 // and these tasks if un-executed would upset Valgrind. | 87 // and these tasks if un-executed would upset Valgrind. |
87 RunAllPendingInMessageLoop(); | 88 RunAllPendingInMessageLoop(); |
88 | 89 |
89 helper_->TearDown(); | 90 helper_->TearDown(); |
(...skipping 25 matching lines...) Expand all Loading... |
115 | 116 |
116 bool AuraTestBase::DispatchEventUsingWindowDispatcher(ui::Event* event) { | 117 bool AuraTestBase::DispatchEventUsingWindowDispatcher(ui::Event* event) { |
117 ui::EventDispatchDetails details = | 118 ui::EventDispatchDetails details = |
118 event_processor()->OnEventFromSource(event); | 119 event_processor()->OnEventFromSource(event); |
119 CHECK(!details.dispatcher_destroyed); | 120 CHECK(!details.dispatcher_destroyed); |
120 return event->handled(); | 121 return event->handled(); |
121 } | 122 } |
122 | 123 |
123 } // namespace test | 124 } // namespace test |
124 } // namespace aura | 125 } // namespace aura |
OLD | NEW |