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

Unified Diff: content/public/test/test_browser_thread_bundle.cc

Issue 1851423003: Make Web Push use InstanceID tokens instead of GCM registrations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@iid4default
Patch Set: Fix GN/GYP Created 4 years, 8 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: content/public/test/test_browser_thread_bundle.cc
diff --git a/content/public/test/test_browser_thread_bundle.cc b/content/public/test/test_browser_thread_bundle.cc
index 9ddd800c3e54bb2f09e838a99823a2b7e92d3e2a..b2f65c08581a9f8079e789fa8892ba432ae078d8 100644
--- a/content/public/test/test_browser_thread_bundle.cc
+++ b/content/public/test/test_browser_thread_bundle.cc
@@ -9,6 +9,10 @@
#include "content/browser/browser_thread_impl.h"
#include "content/public/test/test_browser_thread.h"
+#if defined(OS_ANDROID)
+#include "content/public/test/nested_message_pump_android.h"
+#endif // OS_ANDROID
+
namespace content {
TestBrowserThreadBundle::TestBrowserThreadBundle()
@@ -57,10 +61,20 @@ void TestBrowserThreadBundle::Init() {
CHECK(!(options_ & IO_MAINLOOP) || !(options_ & REAL_IO_THREAD));
// There must be a thread to start to use DONT_START_THREADS
CHECK((options_ & ~IO_MAINLOOP) != DONT_START_THREADS);
+ // MessageLoopForIO doesn't currently support custom message pumps.
+ CHECK(!(options_ & IO_MAINLOOP) || !(options_ & NESTED_JAVA_ON_ANDROID));
if (options_ & IO_MAINLOOP) {
message_loop_.reset(new base::MessageLoopForIO());
- } else {
+ }
+#if defined(OS_ANDROID)
+ else if (options_ & NESTED_JAVA_ON_ANDROID) {
+ message_loop_.reset(new base::MessageLoopForUI(
+ scoped_ptr<base::MessagePump>(new NestedMessagePumpAndroid())));
+ static_cast<base::MessageLoopForUI*>(message_loop_.get())->Start();
+ }
+#endif // OS_ANDROID
+ else {
message_loop_.reset(new base::MessageLoopForUI());
}

Powered by Google App Engine
This is Rietveld 408576698