| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "platform/scheduler/renderer/user_model.h" | 5 #include "platform/scheduler/renderer/user_model.h" |
| 6 | 6 |
| 7 #include "base/test/simple_test_tick_clock.h" | 7 #include "base/test/simple_test_tick_clock.h" |
| 8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 base::TimeDelta delta(base::TimeDelta::FromMilliseconds( | 245 base::TimeDelta delta(base::TimeDelta::FromMilliseconds( |
| 246 UserModel::kMedianGestureDurationMillis * 2)); | 246 UserModel::kMedianGestureDurationMillis * 2)); |
| 247 clock_->Advance(delta); | 247 clock_->Advance(delta); |
| 248 | 248 |
| 249 base::TimeDelta prediction_valid_duration; | 249 base::TimeDelta prediction_valid_duration; |
| 250 EXPECT_FALSE(user_model_->IsGestureExpectedToContinue( | 250 EXPECT_FALSE(user_model_->IsGestureExpectedToContinue( |
| 251 clock_->NowTicks(), &prediction_valid_duration)); | 251 clock_->NowTicks(), &prediction_valid_duration)); |
| 252 EXPECT_EQ(base::TimeDelta(), prediction_valid_duration); | 252 EXPECT_EQ(base::TimeDelta(), prediction_valid_duration); |
| 253 } | 253 } |
| 254 | 254 |
| 255 TEST_F(UserModelTest, ResetPendingInputCount) { |
| 256 user_model_->DidStartProcessingInputEvent( |
| 257 blink::WebInputEvent::Type::GestureScrollBegin, clock_->NowTicks()); |
| 258 EXPECT_EQ(priority_escalation_after_input_duration(), |
| 259 user_model_->TimeLeftInUserGesture(clock_->NowTicks())); |
| 260 user_model_->Reset(clock_->NowTicks()); |
| 261 EXPECT_EQ(base::TimeDelta(), |
| 262 user_model_->TimeLeftInUserGesture(clock_->NowTicks())); |
| 263 } |
| 264 |
| 255 } // namespace scheduler | 265 } // namespace scheduler |
| 256 } // namespace blink | 266 } // namespace blink |
| OLD | NEW |