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

Side by Side Diff: third_party/WebKit/Source/core/dom/IdleDeadlineTest.cpp

Issue 2588403002: TestingPlatformSupport: register Platform instance correctly (Closed)
Patch Set: review #32 Created 3 years, 11 months 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 | « no previous file | third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "public/platform/Platform.h" 8 #include "public/platform/Platform.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "wtf/CurrentTime.h" 10 #include "wtf/CurrentTime.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 EXPECT_FLOAT_EQ(249.995, deadline->timeRemaining()); 68 EXPECT_FLOAT_EQ(249.995, deadline->timeRemaining());
69 } 69 }
70 70
71 TEST_F(IdleDeadlineTest, deadlineInPast) { 71 TEST_F(IdleDeadlineTest, deadlineInPast) {
72 IdleDeadline* deadline = 72 IdleDeadline* deadline =
73 IdleDeadline::create(0.75, IdleDeadline::CallbackType::CalledWhenIdle); 73 IdleDeadline::create(0.75, IdleDeadline::CallbackType::CalledWhenIdle);
74 EXPECT_FLOAT_EQ(0, deadline->timeRemaining()); 74 EXPECT_FLOAT_EQ(0, deadline->timeRemaining());
75 } 75 }
76 76
77 TEST_F(IdleDeadlineTest, yieldForHighPriorityWork) { 77 TEST_F(IdleDeadlineTest, yieldForHighPriorityWork) {
78 MockPlatform platform; 78 ScopedTestingPlatformSupport<MockPlatform> platform;
79 79
80 IdleDeadline* deadline = 80 IdleDeadline* deadline =
81 IdleDeadline::create(1.25, IdleDeadline::CallbackType::CalledWhenIdle); 81 IdleDeadline::create(1.25, IdleDeadline::CallbackType::CalledWhenIdle);
82 EXPECT_FLOAT_EQ(0, deadline->timeRemaining()); 82 EXPECT_FLOAT_EQ(0, deadline->timeRemaining());
83 } 83 }
84 84
85 } // namespace blink 85 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698