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

Unified Diff: base/task_scheduler/task_scheduler_impl_unittest.cc

Issue 2208493002: TaskScheduler: No BACKGROUND threads when unsupported. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + CR robliao #6 (nit) Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/task_scheduler/scheduler_worker_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/task_scheduler_impl_unittest.cc
diff --git a/base/task_scheduler/task_scheduler_impl_unittest.cc b/base/task_scheduler/task_scheduler_impl_unittest.cc
index b49e5b9de94ce34b0907bea0d5bfbb29977a9593..fe5a98f132adbe9660666b2f3970ed817accb68a 100644
--- a/base/task_scheduler/task_scheduler_impl_unittest.cc
+++ b/base/task_scheduler/task_scheduler_impl_unittest.cc
@@ -15,6 +15,7 @@
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
+#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
#include "base/task_scheduler/scheduler_worker_pool_params.h"
#include "base/task_scheduler/task_traits.h"
@@ -53,7 +54,12 @@ bool GetIOAllowed() {
// to run a Task with |traits|.
// Note: ExecutionMode is verified inside TestTaskFactory.
void VerifyTaskEnvironement(const TaskTraits& traits) {
- EXPECT_EQ(traits.priority() == TaskPriority::BACKGROUND
+ const bool supports_background_priority =
+ Lock::HandlesMultipleThreadPriorities() &&
+ PlatformThread::CanIncreaseCurrentThreadPriority();
+
+ EXPECT_EQ(supports_background_priority &&
+ traits.priority() == TaskPriority::BACKGROUND
? ThreadPriority::BACKGROUND
: ThreadPriority::NORMAL,
PlatformThread::GetCurrentThreadPriority());
« no previous file with comments | « base/task_scheduler/scheduler_worker_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698