| OLD | NEW |
| 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 Loading... |
| 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 std::vector<std::string> disabled_features; | 62 if (raf_aligned_input_setting_ & kRafAlignedEnabledTouch) |
| 63 if (raf_aligned_input_setting_ & kRafAlignedEnabledTouch) { | |
| 64 features.push_back(features::kRafAlignedTouchInputEvents.name); | 63 features.push_back(features::kRafAlignedTouchInputEvents.name); |
| 65 } else { | 64 if (raf_aligned_input_setting_ & kRafAlignedEnabledMouse) |
| 66 disabled_features.push_back(features::kRafAlignedTouchInputEvents.name); | |
| 67 } | |
| 68 if (raf_aligned_input_setting_ & kRafAlignedEnabledMouse) { | |
| 69 features.push_back(features::kRafAlignedMouseInputEvents.name); | 65 features.push_back(features::kRafAlignedMouseInputEvents.name); |
| 70 } else { | |
| 71 disabled_features.push_back(features::kRafAlignedMouseInputEvents.name); | |
| 72 } | |
| 73 | 66 |
| 74 feature_list_.InitFromCommandLine(base::JoinString(features, ","), | 67 feature_list_.InitFromCommandLine(base::JoinString(features, ","), |
| 75 base::JoinString(disabled_features, ",")); | 68 std::string()); |
| 76 } | 69 } |
| 77 | 70 |
| 78 void SetUp() override { | 71 void SetUp() override { |
| 79 queue_ = new MainThreadEventQueue(kTestRoutingID, this, main_task_runner_, | 72 queue_ = new MainThreadEventQueue(kTestRoutingID, this, main_task_runner_, |
| 80 &renderer_scheduler_); | 73 &renderer_scheduler_); |
| 81 } | 74 } |
| 82 | 75 |
| 83 void HandleEventOnMainThread(int routing_id, | 76 void HandleEventOnMainThread(int routing_id, |
| 84 const blink::WebCoalescedInputEvent* event, | 77 const blink::WebCoalescedInputEvent* event, |
| 85 const ui::LatencyInfo& latency, | 78 const ui::LatencyInfo& latency, |
| (...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 "MainThreadResponsivenessScrollIntervention", "Control"); | 822 "MainThreadResponsivenessScrollIntervention", "Control"); |
| 830 queue_ = new MainThreadEventQueue(kTestRoutingID, | 823 queue_ = new MainThreadEventQueue(kTestRoutingID, |
| 831 &dummy_main_thread_event_queue_client_, | 824 &dummy_main_thread_event_queue_client_, |
| 832 main_task_runner_, &renderer_scheduler_); | 825 main_task_runner_, &renderer_scheduler_); |
| 833 EXPECT_FALSE(enable_non_blocking_due_to_main_thread_responsiveness_flag()); | 826 EXPECT_FALSE(enable_non_blocking_due_to_main_thread_responsiveness_flag()); |
| 834 EXPECT_EQ(base::TimeDelta::FromMilliseconds(0), | 827 EXPECT_EQ(base::TimeDelta::FromMilliseconds(0), |
| 835 main_thread_responsiveness_threshold()); | 828 main_thread_responsiveness_threshold()); |
| 836 } | 829 } |
| 837 | 830 |
| 838 } // namespace content | 831 } // namespace content |
| OLD | NEW |