OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <memory> | 5 #include <memory> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 #if !defined(OS_IOS) | 22 #if !defined(OS_IOS) |
23 #include "content/public/test/test_content_client_initializer.h" | 23 #include "content/public/test/test_content_client_initializer.h" |
24 #include "mojo/edk/embedder/embedder.h" | 24 #include "mojo/edk/embedder/embedder.h" |
25 #include "ui/gl/test/gl_surface_test_support.h" | 25 #include "ui/gl/test/gl_surface_test_support.h" |
26 #endif | 26 #endif |
27 | 27 |
28 #if defined(OS_ANDROID) | 28 #if defined(OS_ANDROID) |
29 #include "base/android/jni_android.h" | 29 #include "base/android/jni_android.h" |
30 #include "components/gcm_driver/instance_id/android/component_jni_registrar.h" | 30 #include "components/gcm_driver/instance_id/android/component_jni_registrar.h" |
31 #include "components/gcm_driver/instance_id/scoped_use_fake_instance_id_android.
h" | |
32 #include "components/invalidation/impl/android/component_jni_registrar.h" | 31 #include "components/invalidation/impl/android/component_jni_registrar.h" |
33 #include "components/policy/core/browser/android/component_jni_registrar.h" | 32 #include "components/policy/core/browser/android/component_jni_registrar.h" |
34 #include "components/safe_json/android/component_jni_registrar.h" | 33 #include "components/safe_json/android/component_jni_registrar.h" |
35 #include "components/signin/core/browser/android/component_jni_registrar.h" | 34 #include "components/signin/core/browser/android/component_jni_registrar.h" |
36 #include "components/web_restrictions/browser/mock_web_restrictions_client.h" | |
37 #include "content/public/test/test_utils.h" | 35 #include "content/public/test/test_utils.h" |
38 #include "net/android/net_jni_registrar.h" | 36 #include "net/android/net_jni_registrar.h" |
39 #include "ui/base/android/ui_base_jni_registrar.h" | 37 #include "ui/base/android/ui_base_jni_registrar.h" |
40 #include "ui/gfx/android/gfx_jni_registrar.h" | 38 #include "ui/gfx/android/gfx_jni_registrar.h" |
41 #endif | 39 #endif |
42 | 40 |
43 namespace { | 41 namespace { |
44 | 42 |
45 class ComponentsTestSuite : public base::TestSuite { | 43 class ComponentsTestSuite : public base::TestSuite { |
46 public: | 44 public: |
(...skipping 10 matching lines...) Expand all Loading... |
57 | 55 |
58 #if !defined(OS_IOS) | 56 #if !defined(OS_IOS) |
59 gl::GLSurfaceTestSupport::InitializeOneOff(); | 57 gl::GLSurfaceTestSupport::InitializeOneOff(); |
60 #endif | 58 #endif |
61 #if defined(OS_ANDROID) | 59 #if defined(OS_ANDROID) |
62 // Register JNI bindings for android. | 60 // Register JNI bindings for android. |
63 JNIEnv* env = base::android::AttachCurrentThread(); | 61 JNIEnv* env = base::android::AttachCurrentThread(); |
64 ASSERT_TRUE(content::RegisterJniForTesting(env)); | 62 ASSERT_TRUE(content::RegisterJniForTesting(env)); |
65 ASSERT_TRUE(gfx::android::RegisterJni(env)); | 63 ASSERT_TRUE(gfx::android::RegisterJni(env)); |
66 ASSERT_TRUE(instance_id::android::RegisterInstanceIDJni(env)); | 64 ASSERT_TRUE(instance_id::android::RegisterInstanceIDJni(env)); |
67 ASSERT_TRUE(instance_id::ScopedUseFakeInstanceIDAndroid::RegisterJni(env)); | |
68 ASSERT_TRUE(invalidation::android::RegisterInvalidationJni(env)); | 65 ASSERT_TRUE(invalidation::android::RegisterInvalidationJni(env)); |
69 ASSERT_TRUE(policy::android::RegisterPolicy(env)); | 66 ASSERT_TRUE(policy::android::RegisterPolicy(env)); |
70 ASSERT_TRUE(safe_json::android::RegisterSafeJsonJni(env)); | 67 ASSERT_TRUE(safe_json::android::RegisterSafeJsonJni(env)); |
71 ASSERT_TRUE(signin::android::RegisterSigninJni(env)); | 68 ASSERT_TRUE(signin::android::RegisterSigninJni(env)); |
72 ASSERT_TRUE(net::android::RegisterJni(env)); | 69 ASSERT_TRUE(net::android::RegisterJni(env)); |
73 ASSERT_TRUE(ui::android::RegisterJni(env)); | 70 ASSERT_TRUE(ui::android::RegisterJni(env)); |
74 ASSERT_TRUE(web_restrictions::MockWebRestrictionsClient::Register(env)); | |
75 #endif | 71 #endif |
76 | 72 |
77 ui::RegisterPathProvider(); | 73 ui::RegisterPathProvider(); |
78 | 74 |
79 base::FilePath pak_path; | 75 base::FilePath pak_path; |
80 #if defined(OS_ANDROID) | 76 #if defined(OS_ANDROID) |
81 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_path); | 77 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_path); |
82 #else | 78 #else |
83 PathService::Get(base::DIR_MODULE, &pak_path); | 79 PathService::Get(base::DIR_MODULE, &pak_path); |
84 #endif | 80 #endif |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 listeners.Append(new ComponentsUnitTestEventListener()); | 145 listeners.Append(new ComponentsUnitTestEventListener()); |
150 | 146 |
151 #if !defined(OS_IOS) | 147 #if !defined(OS_IOS) |
152 mojo::edk::Init(); | 148 mojo::edk::Init(); |
153 #endif | 149 #endif |
154 | 150 |
155 return base::LaunchUnitTests( | 151 return base::LaunchUnitTests( |
156 argc, argv, base::Bind(&base::TestSuite::Run, | 152 argc, argv, base::Bind(&base::TestSuite::Run, |
157 base::Unretained(&test_suite))); | 153 base::Unretained(&test_suite))); |
158 } | 154 } |
OLD | NEW |