Chromium Code Reviews| 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..a3183761aeaf93411951a54f40a778780b96da0b 100644 |
| --- a/blimp/test/run_all_unittests.cc |
| +++ b/blimp/test/run_all_unittests.cc |
| @@ -8,9 +8,59 @@ |
| #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)) |
|
nyquist
2016/08/16 23:14:57
Nit: I've been told we "always" use curlies in bli
Khushal
2016/08/18 03:16:32
Done.
|
| + 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))); |