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

Unified Diff: platform_tools/android/apps/visualbench/src/main/java/com/skia/VisualBenchTestActivity.java

Issue 1314873005: VisualBenchTest: Read nanobench_flags.txt (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move --outResultsFile to recipe Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: platform_tools/android/apps/visualbench/src/main/java/com/skia/VisualBenchTestActivity.java
diff --git a/platform_tools/android/apps/visualbench/src/main/java/com/skia/VisualBenchTestActivity.java b/platform_tools/android/apps/visualbench/src/main/java/com/skia/VisualBenchTestActivity.java
index 2edd8163062be4fc02e9ff9e906707d118cb831f..48507bea68df80faa4f1ea6ad9c297bc962b83c8 100644
--- a/platform_tools/android/apps/visualbench/src/main/java/com/skia/VisualBenchTestActivity.java
+++ b/platform_tools/android/apps/visualbench/src/main/java/com/skia/VisualBenchTestActivity.java
@@ -11,6 +11,11 @@ import android.app.Instrumentation;
import android.content.Intent;
import android.test.ActivityUnitTestCase;
import android.util.Log;
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.IOException;
+import java.lang.StringBuilder;
public class VisualBenchTestActivity extends ActivityUnitTestCase<VisualBenchActivity> {
private VisualBenchActivity mActivity;
@@ -25,11 +30,26 @@ public class VisualBenchTestActivity extends ActivityUnitTestCase<VisualBenchAct
mInstrumentation = getInstrumentation();
}
- public void testVisualBench() throws InterruptedException {
+ private String getFlags() throws IOException {
+ InputStream s = getInstrumentation().getTargetContext().getResources().getAssets().open("nanobench_flags.txt");
+ BufferedReader r = new BufferedReader(new InputStreamReader(s));
+ StringBuilder flags = new StringBuilder();
+ String sep = System.getProperty("line.separator");
+ String line;
+ while ((line = r.readLine()) != null) {
+ flags.append(line);
+ flags.append(sep);
+ }
+ s.close();
+ return flags.toString();
+ }
+
+ public void testVisualBench() throws InterruptedException, IOException {
String pkg = getInstrumentation().getTargetContext().getPackageName();
Intent intent = new Intent(getInstrumentation().getTargetContext(),
VisualBenchActivity.class);
- intent.putExtra("cmdLineFlags", "--outResultsFile /sdcard/skia_results/visualbench.json");
+ String args = getFlags();
+ intent.putExtra("cmdLineFlags", args);
mActivity = launchActivityWithIntent(pkg, VisualBenchActivity.class, intent);
assertNotNull("mActivity is null", mActivity);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698