| 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 |
| 11 namespace blink { | 11 namespace blink { |
| 12 namespace scheduler { | 12 namespace scheduler { |
| 13 | 13 |
| 14 class UserModelTest : public testing::Test { | 14 class UserModelTest : public ::testing::Test { |
| 15 public: | 15 public: |
| 16 UserModelTest() {} | 16 UserModelTest() {} |
| 17 ~UserModelTest() override {} | 17 ~UserModelTest() override {} |
| 18 | 18 |
| 19 void SetUp() override { | 19 void SetUp() override { |
| 20 clock_.reset(new base::SimpleTestTickClock()); | 20 clock_.reset(new base::SimpleTestTickClock()); |
| 21 clock_->Advance(base::TimeDelta::FromMicroseconds(5000)); | 21 clock_->Advance(base::TimeDelta::FromMicroseconds(5000)); |
| 22 | 22 |
| 23 user_model_.reset(new UserModel()); | 23 user_model_.reset(new UserModel()); |
| 24 } | 24 } |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 blink::WebInputEvent::Type::kGestureScrollBegin, clock_->NowTicks()); | 257 blink::WebInputEvent::Type::kGestureScrollBegin, clock_->NowTicks()); |
| 258 EXPECT_EQ(priority_escalation_after_input_duration(), | 258 EXPECT_EQ(priority_escalation_after_input_duration(), |
| 259 user_model_->TimeLeftInUserGesture(clock_->NowTicks())); | 259 user_model_->TimeLeftInUserGesture(clock_->NowTicks())); |
| 260 user_model_->Reset(clock_->NowTicks()); | 260 user_model_->Reset(clock_->NowTicks()); |
| 261 EXPECT_EQ(base::TimeDelta(), | 261 EXPECT_EQ(base::TimeDelta(), |
| 262 user_model_->TimeLeftInUserGesture(clock_->NowTicks())); | 262 user_model_->TimeLeftInUserGesture(clock_->NowTicks())); |
| 263 } | 263 } |
| 264 | 264 |
| 265 } // namespace scheduler | 265 } // namespace scheduler |
| 266 } // namespace blink | 266 } // namespace blink |
| OLD | NEW |