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

Unified Diff: sync/internal_api/attachments/attachment_service_proxy_for_test.cc

Issue 814273006: Don't DCHECK in AttachmentServiceProxyForTest when MessageLoop is absent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « sync/api/attachments/attachment_store.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/attachments/attachment_service_proxy_for_test.cc
diff --git a/sync/internal_api/attachments/attachment_service_proxy_for_test.cc b/sync/internal_api/attachments/attachment_service_proxy_for_test.cc
index 53f7d6095cc6b5c6eb8f6de95813d36dd79d612f..8682a9112030ef7c254b1c9b7f7737d1538a7777 100644
--- a/sync/internal_api/attachments/attachment_service_proxy_for_test.cc
+++ b/sync/internal_api/attachments/attachment_service_proxy_for_test.cc
@@ -38,14 +38,15 @@ AttachmentServiceProxy AttachmentServiceProxyForTest::Create() {
scoped_refptr<Core> core_for_test(
new OwningCore(wrapped.Pass(), weak_ptr_factory.Pass()));
- scoped_refptr<base::SequencedTaskRunner> runner(
- base::ThreadTaskRunnerHandle::Get());
- if (!runner.get()) {
- // Dummy runner for tests that don't care about AttachmentServiceProxy.
+ scoped_refptr<base::SequencedTaskRunner> runner;
+ if (base::ThreadTaskRunnerHandle::IsSet()) {
+ runner = base::ThreadTaskRunnerHandle::Get();
+ } else {
+ // Dummy runner for tests that don't have MessageLoop.
DVLOG(1) << "Creating dummy MessageLoop for AttachmentServiceProxy.";
base::MessageLoop loop;
// This works because |runner| takes a ref to the proxy.
- runner = loop.message_loop_proxy();
+ runner = base::ThreadTaskRunnerHandle::Get();
}
return AttachmentServiceProxyForTest(runner, core_for_test);
}
« no previous file with comments | « sync/api/attachments/attachment_store.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698