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

Unified Diff: content/test/content_test_launcher.cc

Issue 12091033: Relanding "Add apk for running content_browsertests" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 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 | « content/shell/android/shell_library_loader.cc ('k') | content/test/run_all_unittests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/content_test_launcher.cc
diff --git a/content/test/content_test_launcher.cc b/content/test/content_test_launcher.cc
index 5eebd690f82601eb2d65f9518447b426831947e0..a34db6beed86f9e0efd95604dff592dcfa3f842f 100644
--- a/content/test/content_test_launcher.cc
+++ b/content/test/content_test_launcher.cc
@@ -17,6 +17,11 @@
#include "content/shell/shell_switches.h"
#include "testing/gtest/include/gtest/gtest.h"
+#if defined(OS_ANDROID)
+#include "base/message_loop.h"
+#include "base/message_pump_android.h"
+#endif
+
#if defined(OS_WIN)
#include "content/public/app/startup_helper_win.h"
#include "sandbox/win/src/sandbox_types.h"
@@ -52,6 +57,12 @@ class ContentShellTestSuiteInitializer
DISALLOW_COPY_AND_ASSIGN(ContentShellTestSuiteInitializer);
};
+#if defined(OS_ANDROID)
+base::MessagePump* CreateMessagePumpForUI() {
+ return new base::MessagePumpForUI();
+};
+#endif
+
class ContentBrowserTestSuite : public ContentTestSuiteBase {
public:
ContentBrowserTestSuite(int argc, char** argv)
@@ -62,6 +73,14 @@ class ContentBrowserTestSuite : public ContentTestSuiteBase {
protected:
virtual void Initialize() OVERRIDE {
+
+#if defined(OS_ANDROID)
+ // This needs to be done before base::TestSuite::Initialize() is called,
+ // as it also tries to set MessagePumpForUIFactory.
+ if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUI))
+ LOG(INFO) << "MessagePumpForUIFactory already set, unable to override.";
+#endif
+
ContentTestSuiteBase::Initialize();
testing::TestEventListeners& listeners =
« no previous file with comments | « content/shell/android/shell_library_loader.cc ('k') | content/test/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698