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

Unified Diff: blimp/test/run_all_unittests.cc

Issue 2266863003: blimp: Move BlimpCompositor to use delegated rendering. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make gn happy Created 4 years, 4 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 | « blimp/test/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/test/run_all_unittests.cc
diff --git a/blimp/test/run_all_unittests.cc b/blimp/test/run_all_unittests.cc
index 36b040c2d6f2f2da8dfec018cf299ab6ca1f7d80..7d52f169382afd701437b008d1d7a00a264e302c 100644
--- a/blimp/test/run_all_unittests.cc
+++ b/blimp/test/run_all_unittests.cc
@@ -8,9 +8,62 @@
#include "build/build_config.h"
#include "mojo/edk/embedder/embedder.h"
+#if defined(OS_ANDROID)
+#include "base/android/base_jni_registrar.h"
+#include "base/android/jni_android.h"
+#include "blimp/client/public/android/blimp_jni_registrar.h"
+#include "net/android/net_jni_registrar.h"
+#include "ui/gfx/android/gfx_jni_registrar.h"
+#endif
+
+namespace {
+
+class BlimpTestSuite : public base::TestSuite {
+ public:
+ BlimpTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {}
+
+ protected:
+ void Initialize() override {
+ base::TestSuite::Initialize();
+
+#if defined(OS_ANDROID)
+ if (!RegisterJni(base::android::AttachCurrentThread())) {
+ LOG(FATAL) << "Jni Registration failed";
+ }
+#endif
+ }
+
+ private:
+#if defined(OS_ANDROID)
+ bool RegisterJni(JNIEnv* env) {
+ if (!base::android::RegisterJni(env)) {
+ return false;
+ }
+
+ if (!net::android::RegisterJni(env)) {
+ return false;
+ }
+
+ if (!gfx::android::RegisterJni(env)) {
+ return false;
+ }
+
+ if (!blimp::client::RegisterBlimpJni(env)) {
+ return false;
+ }
+
+ return true;
+ }
+#endif
+
+ DISALLOW_COPY_AND_ASSIGN(BlimpTestSuite);
+};
+
+} // namespace
+
int main(int argc, char** argv) {
mojo::edk::Init();
- base::TestSuite test_suite(argc, argv);
+ BlimpTestSuite test_suite(argc, argv);
return base::LaunchUnitTests(
argc, argv,
base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite)));
« no previous file with comments | « blimp/test/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698