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

Side by Side Diff: mojo/android/javatests/src/org/chromium/mojo/MojoTestCase.java

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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 | « gpu/config/gpu_test_expectations_parser.cc ('k') | mojo/dart/embedder/dart_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 package org.chromium.mojo; 5 package org.chromium.mojo;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.test.InstrumentationTestCase; 8 import android.test.InstrumentationTestCase;
9 9
10 import org.chromium.base.JNINamespace; 10 import org.chromium.base.JNINamespace;
11 import org.chromium.base.library_loader.LibraryLoader; 11 import org.chromium.base.library_loader.LibraryLoader;
12 import org.chromium.base.library_loader.LibraryProcessType; 12 import org.chromium.base.library_loader.LibraryProcessType;
13 13
14 /** 14 /**
15 * Base class to test mojo. Setup the environment. 15 * Base class to test mojo. Setup the environment.
16 */ 16 */
17 @JNINamespace("mojo::android") 17 @JNINamespace("mojo::android")
18 public class MojoTestCase extends InstrumentationTestCase { 18 public class MojoTestCase extends InstrumentationTestCase {
19 19
20 private long mTestEnvironmentPointer; 20 private long mTestEnvironmentPointer;
21 21
22 /** 22 /**
23 * @see junit.framework.TestCase#setUp() 23 * @see junit.framework.TestCase#setUp()
24 */ 24 */
25 @Override 25 @Override
26 protected void setUp() throws Exception { 26 protected void setUp() throws Exception {
27 super.setUp(); 27 super.setUp();
28 LibraryLoader.get(LibraryProcessType.PROCESS_BROWSER).ensureInitialized( ); 28 Context context = getInstrumentation().getTargetContext();
29 nativeInitApplicationContext(getInstrumentation().getTargetContext()); 29 LibraryLoader.get(LibraryProcessType.PROCESS_BROWSER).ensureInitialized( context);
30 nativeInitApplicationContext(context);
30 mTestEnvironmentPointer = nativeSetupTestEnvironment(); 31 mTestEnvironmentPointer = nativeSetupTestEnvironment();
31 } 32 }
32 33
33 /** 34 /**
34 * @see android.test.InstrumentationTestCase#tearDown() 35 * @see android.test.InstrumentationTestCase#tearDown()
35 */ 36 */
36 @Override 37 @Override
37 protected void tearDown() throws Exception { 38 protected void tearDown() throws Exception {
38 nativeTearDownTestEnvironment(mTestEnvironmentPointer); 39 nativeTearDownTestEnvironment(mTestEnvironmentPointer);
39 super.tearDown(); 40 super.tearDown();
(...skipping 15 matching lines...) Expand all
55 56
56 private native void nativeInitApplicationContext(Context context); 57 private native void nativeInitApplicationContext(Context context);
57 58
58 private native long nativeSetupTestEnvironment(); 59 private native long nativeSetupTestEnvironment();
59 60
60 private native void nativeTearDownTestEnvironment(long testEnvironment); 61 private native void nativeTearDownTestEnvironment(long testEnvironment);
61 62
62 private native void nativeRunLoop(long timeoutMS); 63 private native void nativeRunLoop(long timeoutMS);
63 64
64 } 65 }
OLDNEW
« no previous file with comments | « gpu/config/gpu_test_expectations_parser.cc ('k') | mojo/dart/embedder/dart_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698