1 // Copyright 2019 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "base/task/thread_pool/environment_config.h" 6 7 #include "build/build_config.h" 8 #include "testing/gtest/include/gtest/gtest.h" 9 10 namespace base { 11 namespace internal { 12 13 // This test summarizes which platforms use background thread priority. TEST(ThreadPoolEnvironmentConfig,CanUseBackgroundPriorityForWorker)14TEST(ThreadPoolEnvironmentConfig, CanUseBackgroundPriorityForWorker) { 15 #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) 16 EXPECT_TRUE(CanUseBackgroundThreadTypeForWorkerThread()); 17 #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \ 18 BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_NACL) 19 EXPECT_FALSE(CanUseBackgroundThreadTypeForWorkerThread()); 20 #else 21 #error Platform doesn't match any block 22 #endif 23 24 #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID) 25 EXPECT_TRUE(CanUseUtilityThreadTypeForWorkerThread()); 26 #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_FUCHSIA) || \ 27 BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_NACL) 28 EXPECT_FALSE(CanUseUtilityThreadTypeForWorkerThread()); 29 #else 30 #error Platform doesn't match any block 31 #endif 32 } 33 34 } // namespace internal 35 } // namespace base 36