| 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 "core/dom/IdleDeadline.h" | 5 #include "core/dom/IdleDeadline.h" |
| 6 | 6 |
| 7 #include "platform/testing/TestingPlatformSupport.h" | 7 #include "platform/testing/TestingPlatformSupport.h" |
| 8 #include "platform/wtf/CurrentTime.h" |
| 8 #include "public/platform/Platform.h" | 9 #include "public/platform/Platform.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "wtf/CurrentTime.h" | |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 class MockScheduler final : public WebScheduler { | 15 class MockScheduler final : public WebScheduler { |
| 16 public: | 16 public: |
| 17 MockScheduler() {} | 17 MockScheduler() {} |
| 18 ~MockScheduler() override {} | 18 ~MockScheduler() override {} |
| 19 | 19 |
| 20 // WebScheduler implementation: | 20 // WebScheduler implementation: |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 TEST_F(IdleDeadlineTest, yieldForHighPriorityWork) { | 95 TEST_F(IdleDeadlineTest, yieldForHighPriorityWork) { |
| 96 ScopedTestingPlatformSupport<MockPlatform> platform; | 96 ScopedTestingPlatformSupport<MockPlatform> platform; |
| 97 | 97 |
| 98 IdleDeadline* deadline = | 98 IdleDeadline* deadline = |
| 99 IdleDeadline::Create(1.25, IdleDeadline::CallbackType::kCalledWhenIdle); | 99 IdleDeadline::Create(1.25, IdleDeadline::CallbackType::kCalledWhenIdle); |
| 100 EXPECT_FLOAT_EQ(0, deadline->timeRemaining()); | 100 EXPECT_FLOAT_EQ(0, deadline->timeRemaining()); |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // namespace blink | 103 } // namespace blink |
| OLD | NEW |