scoped_set_task_priority_for_current_thread_unittest.cc 860 B

12345678910111213141516171819202122232425
  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
  3. // found in the LICENSE file.
  4. #include "base/task/scoped_set_task_priority_for_current_thread.h"
  5. #include "base/task/task_traits.h"
  6. #include "testing/gtest/include/gtest/gtest.h"
  7. namespace base {
  8. namespace internal {
  9. TEST(ScopedSetTaskPriorityForCurrentThreadTest,
  10. ScopedSetTaskPriorityForCurrentThread) {
  11. EXPECT_EQ(TaskPriority::USER_BLOCKING, GetTaskPriorityForCurrentThread());
  12. {
  13. ScopedSetTaskPriorityForCurrentThread
  14. scoped_set_task_priority_for_current_thread(TaskPriority::BEST_EFFORT);
  15. EXPECT_EQ(TaskPriority::BEST_EFFORT, GetTaskPriorityForCurrentThread());
  16. }
  17. EXPECT_EQ(TaskPriority::USER_BLOCKING, GetTaskPriorityForCurrentThread());
  18. }
  19. } // namespace internal
  20. } // namespace base