Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Side by Side Diff: ui/aura/test/aura_test_base.cc

Issue 630003003: Change GestureConfiguration types to be consistent with each other and with the (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Really fix compile Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/aura/gestures/gesture_recognizer_unittest.cc ('k') | ui/aura/window_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 19 matching lines...) Expand all
30 } 30 }
31 31
32 void AuraTestBase::SetUp() { 32 void AuraTestBase::SetUp() {
33 setup_called_ = true; 33 setup_called_ = true;
34 testing::Test::SetUp(); 34 testing::Test::SetUp();
35 ui::InitializeInputMethodForTesting(); 35 ui::InitializeInputMethodForTesting();
36 36
37 // Changing the parameters for gesture recognition shouldn't cause 37 // Changing the parameters for gesture recognition shouldn't cause
38 // tests to fail, so we use a separate set of parameters for unit 38 // tests to fail, so we use a separate set of parameters for unit
39 // testing. 39 // testing.
40 ui::GestureConfiguration::set_long_press_time_in_seconds(1.0); 40 ui::GestureConfiguration::set_long_press_time_in_ms(1000);
41 ui::GestureConfiguration::set_semi_long_press_time_in_seconds(0.4); 41 ui::GestureConfiguration::set_semi_long_press_time_in_ms(400);
42 ui::GestureConfiguration::set_show_press_delay_in_ms(5); 42 ui::GestureConfiguration::set_show_press_delay_in_ms(5);
43 ui::GestureConfiguration::set_max_distance_for_two_finger_tap_in_pixels(300); 43 ui::GestureConfiguration::set_max_distance_for_two_finger_tap_in_pixels(300);
44 ui::GestureConfiguration::set_max_seconds_between_double_click(0.7); 44 ui::GestureConfiguration::set_max_time_between_double_click_in_ms(700);
45 ui::GestureConfiguration:: 45 ui::GestureConfiguration::
46 set_max_separation_for_gesture_touches_in_pixels(150); 46 set_max_separation_for_gesture_touches_in_pixels(150);
47 ui::GestureConfiguration:: 47 ui::GestureConfiguration::set_max_touch_down_duration_for_click_in_ms(800);
48 set_max_touch_down_duration_in_seconds_for_click(0.8);
49 ui::GestureConfiguration::set_max_touch_move_in_pixels_for_click(5); 48 ui::GestureConfiguration::set_max_touch_move_in_pixels_for_click(5);
50 ui::GestureConfiguration::set_max_distance_between_taps_for_double_tap(20); 49 ui::GestureConfiguration::set_max_distance_between_taps_for_double_tap(20);
51 ui::GestureConfiguration::set_min_distance_for_pinch_scroll_in_pixels(20); 50 ui::GestureConfiguration::set_min_distance_for_pinch_scroll_in_pixels(20);
52 ui::GestureConfiguration::set_min_pinch_update_distance_in_pixels(5); 51 ui::GestureConfiguration::set_min_pinch_update_distance_in_pixels(5);
53 ui::GestureConfiguration::set_default_radius(0); 52 ui::GestureConfiguration::set_default_radius(0);
54 ui::GestureConfiguration::set_fling_velocity_cap(15000.0f); 53 ui::GestureConfiguration::set_fling_velocity_cap(15000);
55 ui::GestureConfiguration::set_min_swipe_speed(10); 54 ui::GestureConfiguration::set_min_swipe_speed(10);
56 55
57 // The ContextFactory must exist before any Compositors are created. 56 // The ContextFactory must exist before any Compositors are created.
58 bool enable_pixel_output = false; 57 bool enable_pixel_output = false;
59 ui::ContextFactory* context_factory = 58 ui::ContextFactory* context_factory =
60 ui::InitializeContextFactoryForTests(enable_pixel_output); 59 ui::InitializeContextFactoryForTests(enable_pixel_output);
61 60
62 helper_.reset(new AuraTestHelper(&message_loop_)); 61 helper_.reset(new AuraTestHelper(&message_loop_));
63 helper_->SetUp(context_factory); 62 helper_->SetUp(context_factory);
64 } 63 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 98
100 bool AuraTestBase::DispatchEventUsingWindowDispatcher(ui::Event* event) { 99 bool AuraTestBase::DispatchEventUsingWindowDispatcher(ui::Event* event) {
101 ui::EventDispatchDetails details = 100 ui::EventDispatchDetails details =
102 event_processor()->OnEventFromSource(event); 101 event_processor()->OnEventFromSource(event);
103 CHECK(!details.dispatcher_destroyed); 102 CHECK(!details.dispatcher_destroyed);
104 return event->handled(); 103 return event->handled();
105 } 104 }
106 105
107 } // namespace test 106 } // namespace test
108 } // namespace aura 107 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/gestures/gesture_recognizer_unittest.cc ('k') | ui/aura/window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698