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

Side by Side Diff: content/renderer/input/main_thread_event_queue_unittest.cc

Issue 2740613002: Reland fix unit tests to enable them testing with the rAF aligned touch input. (Closed)
Patch Set: Created 3 years, 9 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 | « content/renderer/input/input_handler_manager.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <new> 7 #include <new>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } // namespace 52 } // namespace
53 53
54 class MainThreadEventQueueTest : public testing::TestWithParam<unsigned>, 54 class MainThreadEventQueueTest : public testing::TestWithParam<unsigned>,
55 public MainThreadEventQueueClient { 55 public MainThreadEventQueueClient {
56 public: 56 public:
57 MainThreadEventQueueTest() 57 MainThreadEventQueueTest()
58 : main_task_runner_(new base::TestSimpleTaskRunner()), 58 : main_task_runner_(new base::TestSimpleTaskRunner()),
59 raf_aligned_input_setting_(GetParam()), 59 raf_aligned_input_setting_(GetParam()),
60 needs_main_frame_(false) { 60 needs_main_frame_(false) {
61 std::vector<std::string> features; 61 std::vector<std::string> features;
62 if (raf_aligned_input_setting_ & kRafAlignedEnabledTouch) 62 std::vector<std::string> disabled_features;
63 if (raf_aligned_input_setting_ & kRafAlignedEnabledTouch) {
63 features.push_back(features::kRafAlignedTouchInputEvents.name); 64 features.push_back(features::kRafAlignedTouchInputEvents.name);
64 if (raf_aligned_input_setting_ & kRafAlignedEnabledMouse) 65 } else {
66 disabled_features.push_back(features::kRafAlignedTouchInputEvents.name);
67 }
68 if (raf_aligned_input_setting_ & kRafAlignedEnabledMouse) {
65 features.push_back(features::kRafAlignedMouseInputEvents.name); 69 features.push_back(features::kRafAlignedMouseInputEvents.name);
70 } else {
71 disabled_features.push_back(features::kRafAlignedMouseInputEvents.name);
72 }
66 73
67 feature_list_.InitFromCommandLine(base::JoinString(features, ","), 74 feature_list_.InitFromCommandLine(base::JoinString(features, ","),
68 std::string()); 75 base::JoinString(disabled_features, ","));
69 } 76 }
70 77
71 void SetUp() override { 78 void SetUp() override {
72 queue_ = new MainThreadEventQueue(kTestRoutingID, this, main_task_runner_, 79 queue_ = new MainThreadEventQueue(kTestRoutingID, this, main_task_runner_,
73 &renderer_scheduler_); 80 &renderer_scheduler_);
74 } 81 }
75 82
76 void HandleEventOnMainThread(int routing_id, 83 void HandleEventOnMainThread(int routing_id,
77 const blink::WebCoalescedInputEvent* event, 84 const blink::WebCoalescedInputEvent* event,
78 const ui::LatencyInfo& latency, 85 const ui::LatencyInfo& latency,
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 "MainThreadResponsivenessScrollIntervention", "Control"); 829 "MainThreadResponsivenessScrollIntervention", "Control");
823 queue_ = new MainThreadEventQueue(kTestRoutingID, 830 queue_ = new MainThreadEventQueue(kTestRoutingID,
824 &dummy_main_thread_event_queue_client_, 831 &dummy_main_thread_event_queue_client_,
825 main_task_runner_, &renderer_scheduler_); 832 main_task_runner_, &renderer_scheduler_);
826 EXPECT_FALSE(enable_non_blocking_due_to_main_thread_responsiveness_flag()); 833 EXPECT_FALSE(enable_non_blocking_due_to_main_thread_responsiveness_flag());
827 EXPECT_EQ(base::TimeDelta::FromMilliseconds(0), 834 EXPECT_EQ(base::TimeDelta::FromMilliseconds(0),
828 main_thread_responsiveness_threshold()); 835 main_thread_responsiveness_threshold());
829 } 836 }
830 837
831 } // namespace content 838 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/input/input_handler_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698