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

Unified Diff: base/task_scheduler/scheduler_worker_unittest.cc

Issue 2978253002: Disable COM Initialization on SchedulerWorkers When COM_INIT_CHECK_HOOK_ENABLED() (Closed)
Patch Set: Fixed Unused Private Field Created 3 years, 5 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.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/scheduler_worker_unittest.cc
diff --git a/base/task_scheduler/scheduler_worker_unittest.cc b/base/task_scheduler/scheduler_worker_unittest.cc
index ab5982fb204fd2fe857996c551b0eee659975ce6..4d22f590a07d87fa86d1393885a26b84a8b881fe 100644
--- a/base/task_scheduler/scheduler_worker_unittest.cc
+++ b/base/task_scheduler/scheduler_worker_unittest.cc
@@ -30,6 +30,8 @@
#if defined(OS_WIN)
#include <objbase.h>
+
+#include "base/win/com_init_check_hook.h"
#endif
using testing::_;
@@ -931,7 +933,13 @@ TEST(TaskSchedulerWorkerTest, BackwardCompatibilityEnabled) {
// The call to CoInitializeEx() should have returned S_FALSE to indicate that
// the COM library was already initialized on the thread.
+ // See SchedulerWorker::Thread::ThreadMain for why we expect two different
+ // results here.
+#if defined(COM_INIT_CHECK_HOOK_ENABLED)
+ EXPECT_EQ(S_OK, delegate_raw->coinitialize_hresult());
+#else
EXPECT_EQ(S_FALSE, delegate_raw->coinitialize_hresult());
+#endif
worker->JoinForTesting();
}
« no previous file with comments | « base/task_scheduler/scheduler_worker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698