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

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

Issue 1029803002: Move IdleTask to WebThread side 3/3 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase 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 | « no previous file | 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 25 matching lines...) Expand all
36 : m_shouldYieldForHighPriorityWork(false) 36 : m_shouldYieldForHighPriorityWork(false)
37 { 37 {
38 } 38 }
39 39
40 // WebScheduler implementation: 40 // WebScheduler implementation:
41 bool shouldYieldForHighPriorityWork() override 41 bool shouldYieldForHighPriorityWork() override
42 { 42 {
43 return m_shouldYieldForHighPriorityWork; 43 return m_shouldYieldForHighPriorityWork;
44 } 44 }
45 45
46 void postIdleTask(const WebTraceLocation&, IdleTask* task) override 46 void postIdleTask(const WebTraceLocation&, blink::WebThread::IdleTask* task) override
47 { 47 {
48 m_latestIdleTask = adoptPtr(task); 48 m_latestIdleTask = adoptPtr(task);
49 } 49 }
50 50
51 void setShouldYieldForHighPriorityWork(bool shouldYieldForHighPriorityWork) 51 void setShouldYieldForHighPriorityWork(bool shouldYieldForHighPriorityWork)
52 { 52 {
53 m_shouldYieldForHighPriorityWork = shouldYieldForHighPriorityWork; 53 m_shouldYieldForHighPriorityWork = shouldYieldForHighPriorityWork;
54 } 54 }
55 55
56 void runLatestIdleTask(double deadlineSeconds) 56 void runLatestIdleTask(double deadlineSeconds)
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 | « no previous file | public/platform/WebScheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698