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

Side by Side Diff: content/shell/android/java/src/org/chromium/content_shell/ShellMojoTestUtils.java

Issue 2217013002: Remove the JNI-based InterfaceRegistry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@java-interface-registry-migration
Patch Set: rebase Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « content/shell/android/BUILD.gn ('k') | content/shell/android/shell_jni_registrar.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 package org.chromium.content_shell;
6
7 import org.chromium.base.annotations.CalledByNative;
8 import org.chromium.base.annotations.JNINamespace;
9 import org.chromium.content.browser.InterfaceProvider;
10 import org.chromium.content.browser.InterfaceRegistry;
11 import org.chromium.mojo.system.Pair;
12
13 /**
14 * Test hooks for shell InterfaceRegistry/Provider support in the browser.
15 * See http://crbug.com/415945.
16 */
17 @JNINamespace("content")
18 public class ShellMojoTestUtils {
19 public static long setupTestEnvironment() {
20 return nativeSetupTestEnvironment();
21 }
22
23 public static void tearDownTestEnvironment(long testEnvironment) {
24 nativeTearDownTestEnvironment(testEnvironment);
25 }
26
27 /**
28 * Returns an InterfaceRegistry and an InterfaceProvider bound to it.
29 */
30 public static Pair<InterfaceRegistry, InterfaceProvider> createInterfaceRegi stryAndProvider(
31 long testEnvironment) {
32 // Declaring parametrized return type for nativeCreateInterfaceRegistryA ndProvider() breaks
33 // the JNI generator. TODO(ppi): support parametrized return types in th e JNI generator.
34 @SuppressWarnings("unchecked")
35 Pair<InterfaceRegistry, InterfaceProvider> pair =
36 nativeCreateInterfaceRegistryAndProvider(testEnvironment);
37 return pair;
38 }
39
40 public static void runLoop(long timeoutMs) {
41 nativeRunLoop(timeoutMs);
42 }
43
44 @CalledByNative
45 public static Pair makePair(InterfaceRegistry registry, InterfaceProvider pr ovider) {
46 return new Pair<InterfaceRegistry, InterfaceProvider>(registry, provider );
47 }
48
49 private static native long nativeSetupTestEnvironment();
50 private static native void nativeTearDownTestEnvironment(long testEnvironmen t);
51 private static native Pair nativeCreateInterfaceRegistryAndProvider(long tes tEnvironment);
52 private static native void nativeRunLoop(long timeoutMs);
53 }
OLDNEW
« no previous file with comments | « content/shell/android/BUILD.gn ('k') | content/shell/android/shell_jni_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698