summaryrefslogtreecommitdiffstats
path: root/content/test/content_test_launcher.cc
diff options
context:
space:
mode:
authornileshagrawal@chromium.org <nileshagrawal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-29 21:55:55 +0000
committernileshagrawal@chromium.org <nileshagrawal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-29 21:55:55 +0000
commit4d4eb5babc558ccddc09168f66970905ed0204d4 (patch)
treefe23183a39cec251e5fd1d9da4047f2fec020510 /content/test/content_test_launcher.cc
parent3ac99b95a6ee9dfaea1d746f795975cc97c7ca45 (diff)
downloadchromium_src-4d4eb5babc558ccddc09168f66970905ed0204d4.zip
chromium_src-4d4eb5babc558ccddc09168f66970905ed0204d4.tar.gz
chromium_src-4d4eb5babc558ccddc09168f66970905ed0204d4.tar.bz2
Relanding "Add apk for running content_browsertests"
Revert "Revert 179189" This reverts commit 5844ab0c6a41cc9d306f8c355cc7ceb5e290cbb1. Original CL:https://codereview.chromium.org/12047068/ was reverted as we failed to update the bot scripts with the new package name for content_shell_apk TBR=mark@chromium.org,jam@chromium.org BUG=138275 Review URL: https://chromiumcodereview.appspot.com/12091033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179428 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/test/content_test_launcher.cc')
-rw-r--r--content/test/content_test_launcher.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/content/test/content_test_launcher.cc b/content/test/content_test_launcher.cc
index 5eebd690..a34db6b 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 =