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

Unified Diff: base/threading/platform_thread_unittest.cc

Issue 1051863003: Turn ThreadPriority enum into an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setthreadpri
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: base/threading/platform_thread_unittest.cc
diff --git a/base/threading/platform_thread_unittest.cc b/base/threading/platform_thread_unittest.cc
index 6e5605e5e2d14955b4e74963f310e6a81fbf43a0..ad7dbd326a3971d733d06b79841766683a5bdd3a 100644
--- a/base/threading/platform_thread_unittest.cc
+++ b/base/threading/platform_thread_unittest.cc
@@ -175,12 +175,12 @@ const ThreadPriority kThreadPriorityTestValues[] = {
// on POSIX as it at least provides coverage for running this code under
// "normal" priority.
#if !defined(OS_POSIX)
- kThreadPriority_RealtimeAudio,
- kThreadPriority_Display,
- kThreadPriority_Background,
+ ThreadPriority::REALTIMEAUDIO,
+ ThreadPriority::DISPLAY,
+ ThreadPriority::BACKGROUND,
#endif // !defined(OS_POSIX)
// Keep normal last to test unbackgrounding.
- kThreadPriority_Normal
+ ThreadPriority::NORMAL
};
} // namespace
@@ -192,7 +192,7 @@ TEST(PlatformThreadTest, ThreadPriorityOtherThread) {
PlatformThreadHandle current_handle(PlatformThread::CurrentHandle());
// Confirm that the current thread's priority is as expected.
- EXPECT_EQ(kThreadPriority_Normal,
+ EXPECT_EQ(ThreadPriority::NORMAL,
PlatformThread::GetThreadPriority(current_handle));
// Create a test thread.
@@ -204,7 +204,7 @@ TEST(PlatformThreadTest, ThreadPriorityOtherThread) {
EXPECT_NE(thread.thread_id(), PlatformThread::CurrentId());
// New threads should get normal priority by default.
- EXPECT_EQ(kThreadPriority_Normal, PlatformThread::GetThreadPriority(handle));
+ EXPECT_EQ(ThreadPriority::NORMAL, PlatformThread::GetThreadPriority(handle));
// Toggle each supported priority on the test thread and confirm it only
// affects it (and not the current thread).
@@ -217,7 +217,7 @@ TEST(PlatformThreadTest, ThreadPriorityOtherThread) {
PlatformThread::GetThreadPriority(handle));
// Make sure the current thread was otherwise unaffected.
- EXPECT_EQ(kThreadPriority_Normal,
+ EXPECT_EQ(ThreadPriority::NORMAL,
PlatformThread::GetThreadPriority(current_handle));
}
@@ -233,7 +233,7 @@ TEST(PlatformThreadTest, ThreadPriorityCurrentThread) {
PlatformThreadHandle current_handle(PlatformThread::CurrentHandle());
// Confirm that the current thread's priority is as expected.
- EXPECT_EQ(kThreadPriority_Normal,
+ EXPECT_EQ(ThreadPriority::NORMAL,
PlatformThread::GetThreadPriority(current_handle));
// Create a test thread for verification purposes only.
@@ -245,7 +245,7 @@ TEST(PlatformThreadTest, ThreadPriorityCurrentThread) {
EXPECT_NE(thread.thread_id(), PlatformThread::CurrentId());
// Confirm that the new thread's priority is as expected.
- EXPECT_EQ(kThreadPriority_Normal, PlatformThread::GetThreadPriority(handle));
+ EXPECT_EQ(ThreadPriority::NORMAL, PlatformThread::GetThreadPriority(handle));
// Toggle each supported priority on the current thread and confirm it only
// affects it (and not the test thread).
@@ -259,12 +259,12 @@ TEST(PlatformThreadTest, ThreadPriorityCurrentThread) {
PlatformThread::GetThreadPriority(current_handle));
// Make sure the test thread was otherwise unaffected.
- EXPECT_EQ(kThreadPriority_Normal,
+ EXPECT_EQ(ThreadPriority::NORMAL,
PlatformThread::GetThreadPriority(handle));
}
// Restore current thread priority for follow-up tests.
- PlatformThread::SetThreadPriority(current_handle, kThreadPriority_Normal);
+ PlatformThread::SetThreadPriority(current_handle, ThreadPriority::NORMAL);
thread.MarkForTermination();
PlatformThread::Join(handle);

Powered by Google App Engine
This is Rietveld 408576698