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

Side by Side Diff: Source/platform/scheduler/SchedulerTest.cpp

Issue 1031843002: Move IdleTask to WebThread side 1/3 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix compile Created 5 years, 9 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 | « Source/platform/scheduler/Scheduler.cpp ('k') | public/platform/WebScheduler.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "config.h" 5 #include "config.h"
6 #include "platform/scheduler/Scheduler.h" 6 #include "platform/scheduler/Scheduler.h"
7 7
8 #include "platform/RuntimeEnabledFeatures.h" 8 #include "platform/RuntimeEnabledFeatures.h"
9 #include "platform/TestingPlatformSupport.h" 9 #include "platform/TestingPlatformSupport.h"
10 #include "public/platform/Platform.h" 10 #include "public/platform/Platform.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 void runLatestIdleTask(double deadlineSeconds) 56 void runLatestIdleTask(double deadlineSeconds)
57 { 57 {
58 m_latestIdleTask->run(deadlineSeconds); 58 m_latestIdleTask->run(deadlineSeconds);
59 m_latestIdleTask.clear(); 59 m_latestIdleTask.clear();
60 } 60 }
61 61
62 protected: 62 protected:
63 bool m_shouldYieldForHighPriorityWork; 63 bool m_shouldYieldForHighPriorityWork;
64 64
65 OwnPtr<WebScheduler::IdleTask> m_latestIdleTask; 65 OwnPtr<blink::WebThread::IdleTask> m_latestIdleTask;
66 }; 66 };
67 67
68 class SchedulerTest : public testing::Test { 68 class SchedulerTest : public testing::Test {
69 public: 69 public:
70 SchedulerTest() 70 SchedulerTest()
71 { 71 {
72 blink::RuntimeEnabledFeatures::setBlinkSchedulerEnabled(true); 72 blink::RuntimeEnabledFeatures::setBlinkSchedulerEnabled(true);
73 m_webScheduler = adoptPtr(new WebSchedulerForTest()); 73 m_webScheduler = adoptPtr(new WebSchedulerForTest());
74 m_scheduler = adoptPtr(new SchedulerForTest(m_webScheduler.get())); 74 m_scheduler = adoptPtr(new SchedulerForTest(m_webScheduler.get()));
75 } 75 }
(...skipping 16 matching lines...) Expand all
92 } 92 }
93 93
94 TEST_F(SchedulerTest, TestIdleTasks) 94 TEST_F(SchedulerTest, TestIdleTasks)
95 { 95 {
96 double deadline = 1.1; 96 double deadline = 1.1;
97 m_scheduler->postIdleTask(FROM_HERE, WTF::bind<double>(&idleTestTask, deadli ne)); 97 m_scheduler->postIdleTask(FROM_HERE, WTF::bind<double>(&idleTestTask, deadli ne));
98 m_webScheduler->runLatestIdleTask(deadline); 98 m_webScheduler->runLatestIdleTask(deadline);
99 } 99 }
100 100
101 } // namespace 101 } // namespace
OLDNEW
« no previous file with comments | « Source/platform/scheduler/Scheduler.cpp ('k') | public/platform/WebScheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698