OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/shell/browser/shell_mojo_test_utils_android.h" | 5 #include "content/shell/browser/shell_mojo_test_utils_android.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 } | 49 } |
50 | 50 |
51 static ScopedJavaLocalRef<jobject> CreateInterfaceRegistryAndProvider( | 51 static ScopedJavaLocalRef<jobject> CreateInterfaceRegistryAndProvider( |
52 JNIEnv* env, | 52 JNIEnv* env, |
53 const JavaParamRef<jclass>& jcaller, | 53 const JavaParamRef<jclass>& jcaller, |
54 jlong native_test_environment) { | 54 jlong native_test_environment) { |
55 TestEnvironment* test_environment = | 55 TestEnvironment* test_environment = |
56 reinterpret_cast<TestEnvironment*>(native_test_environment); | 56 reinterpret_cast<TestEnvironment*>(native_test_environment); |
57 | 57 |
58 std::unique_ptr<shell::InterfaceRegistry> registry( | 58 std::unique_ptr<shell::InterfaceRegistry> registry( |
59 new shell::InterfaceRegistry(nullptr)); | 59 new shell::InterfaceRegistry); |
60 std::unique_ptr<shell::InterfaceProvider> provider( | 60 std::unique_ptr<shell::InterfaceProvider> provider( |
61 new shell::InterfaceProvider); | 61 new shell::InterfaceProvider); |
62 | 62 |
63 shell::mojom::InterfaceProviderPtr provider_proxy; | 63 shell::mojom::InterfaceProviderPtr provider_proxy; |
64 shell::mojom::InterfaceProviderRequest provider_request = | 64 shell::mojom::InterfaceProviderRequest provider_request = |
65 mojo::GetProxy(&provider_proxy); | 65 mojo::GetProxy(&provider_proxy); |
66 provider->Bind(std::move(provider_proxy)); | 66 provider->Bind(std::move(provider_proxy)); |
67 registry->Bind(std::move(provider_request)); | 67 registry->Bind(std::move(provider_request)); |
68 | 68 |
69 std::unique_ptr<content::InterfaceRegistryAndroid> registry_android( | 69 std::unique_ptr<content::InterfaceRegistryAndroid> registry_android( |
(...skipping 20 matching lines...) Expand all Loading... |
90 base::TimeDelta::FromMilliseconds(timeout_ms)); | 90 base::TimeDelta::FromMilliseconds(timeout_ms)); |
91 base::RunLoop run_loop; | 91 base::RunLoop run_loop; |
92 run_loop.Run(); | 92 run_loop.Run(); |
93 } | 93 } |
94 | 94 |
95 bool RegisterShellMojoTestUtils(JNIEnv* env) { | 95 bool RegisterShellMojoTestUtils(JNIEnv* env) { |
96 return RegisterNativesImpl(env); | 96 return RegisterNativesImpl(env); |
97 } | 97 } |
98 | 98 |
99 } // namespace content | 99 } // namespace content |
OLD | NEW |