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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/renderer/user_model_unittest.cc

Issue 2476263002: scheduler: Reset pending input event count on navigation (Closed)
Patch Set: Formatting Created 4 years, 1 month 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 | « third_party/WebKit/Source/platform/scheduler/renderer/user_model.cc ('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 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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/renderer/user_model.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698