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

Unified Diff: base/task_scheduler/task_scheduler_impl_unittest.cc

Issue 1951453002: Name TaskScheduler's worker threads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b7_fdoray_fixtracing
Patch Set: explicit cast to int Created 4 years, 7 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/task_scheduler_impl.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 a9e83f88236b91b0d33a5e87e982b0823aba789a..c491a4a13450b6edb31c8b233ed99ab16f1e5c0f 100644
--- a/base/task_scheduler/task_scheduler_impl_unittest.cc
+++ b/base/task_scheduler/task_scheduler_impl_unittest.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <string>
#include <utility>
#include <vector>
@@ -77,6 +78,16 @@ void VerifyTaskEnvironement(const TaskTraits& traits) {
// !ENABLE_THREAD_RESTRICTIONS, even when |traits| don't allow file I/O.
EXPECT_EQ(traits.with_file_io(), GetIOAllowed());
#endif
+
+ // Verify that the thread the task is running on is named as expected.
+ const std::string current_thread_name(PlatformThread::GetName());
+ EXPECT_NE(std::string::npos, current_thread_name.find("TaskScheduler"));
+ EXPECT_NE(std::string::npos,
+ current_thread_name.find(
+ traits.priority() == TaskPriority::BACKGROUND ? "Background"
+ : "Foreground"));
+ EXPECT_EQ(traits.with_file_io(),
+ current_thread_name.find("FileIO") != std::string::npos);
}
void VerifyTaskEnvironementAndSignalEvent(const TaskTraits& traits,
« no previous file with comments | « base/task_scheduler/task_scheduler_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698