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

Side by Side Diff: testing/android/native_test/java/src/org/chromium/native_test/NativeTest.java

Issue 2043803003: 👔 Reland #2: Move side-loaded test data /sdcard -> /sdcard/gtestdata (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase atop https://codereview.chromium.org/2041723006 Created 4 years, 6 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 package org.chromium.native_test; 5 package org.chromium.native_test;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.Intent; 9 import android.content.Intent;
10 import android.os.Bundle; 10 import android.os.Bundle;
11 import android.os.Environment; 11 import android.os.Environment;
12 import android.os.Handler; 12 import android.os.Handler;
13 import android.os.Process; 13 import android.os.Process;
14 14
15 import org.chromium.base.CommandLine; 15 import org.chromium.base.CommandLine;
16 import org.chromium.base.Log; 16 import org.chromium.base.Log;
17 import org.chromium.base.annotations.JNINamespace; 17 import org.chromium.base.annotations.JNINamespace;
18 import org.chromium.base.multidex.ChromiumMultiDexInstaller; 18 import org.chromium.base.multidex.ChromiumMultiDexInstaller;
19 import org.chromium.base.test.util.UrlUtils;
19 import org.chromium.test.reporter.TestStatusReporter; 20 import org.chromium.test.reporter.TestStatusReporter;
20 21
21 import java.io.File; 22 import java.io.File;
22 import java.util.ArrayList; 23 import java.util.ArrayList;
23 import java.util.Iterator; 24 import java.util.Iterator;
24 25
25 /** 26 /**
26 * Helper to run tests inside Activity or NativeActivity. 27 * Helper to run tests inside Activity or NativeActivity.
27 */ 28 */
28 @JNINamespace("testing::android") 29 @JNINamespace("testing::android")
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 @Override 148 @Override
148 public void run() { 149 public void run() {
149 runTests(activity); 150 runTests(activity);
150 } 151 }
151 }); 152 });
152 } 153 }
153 } 154 }
154 155
155 private void runTests(Activity activity) { 156 private void runTests(Activity activity) {
156 nativeRunTests(mCommandLineFlags.toString(), mCommandLineFilePath, mStdo utFilePath, 157 nativeRunTests(mCommandLineFlags.toString(), mCommandLineFilePath, mStdo utFilePath,
157 mStdoutFifo, activity.getApplicationContext()); 158 mStdoutFifo, activity.getApplicationContext(), UrlUtils.getIsola tedTestRoot());
158 activity.finish(); 159 activity.finish();
159 mReporter.testRunFinished(Process.myPid()); 160 mReporter.testRunFinished(Process.myPid());
160 } 161 }
161 162
162 // Signal a failure of the native test loader to python scripts 163 // Signal a failure of the native test loader to python scripts
163 // which run tests. For example, we look for 164 // which run tests. For example, we look for
164 // RUNNER_FAILED build/android/test_package.py. 165 // RUNNER_FAILED build/android/test_package.py.
165 private void nativeTestFailed() { 166 private void nativeTestFailed() {
166 Log.e(TAG, "[ RUNNER_FAILED ] could not load native library"); 167 Log.e(TAG, "[ RUNNER_FAILED ] could not load native library");
167 } 168 }
168 169
169 private native void nativeRunTests(String commandLineFlags, String commandLi neFilePath, 170 private native void nativeRunTests(String commandLineFlags, String commandLi neFilePath,
170 String stdoutFilePath, boolean stdoutFifo, Context appContext); 171 String stdoutFilePath, boolean stdoutFifo, Context appContext, Strin g testDataDir);
171 } 172 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698