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

Unified Diff: android_webview/tools/WebViewShell/src/org/chromium/webview_shell/WebViewLayoutTest.java

Issue 1215733002: [Android WebViewShell] Make WebViewLayoutTest runnable with test_runner.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/android_webview_shell_test_apk.isolate ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/tools/WebViewShell/src/org/chromium/webview_shell/WebViewLayoutTest.java
diff --git a/android_webview/tools/WebViewShell/src/org/chromium/webview_shell/WebViewLayoutTest.java b/android_webview/tools/WebViewShell/src/org/chromium/webview_shell/WebViewLayoutTest.java
index 281a647aa868e3bba5cf348b7d6960b1ea6658b6..1698f82837501f90802819e7ddf695f59fbb44b7 100644
--- a/android_webview/tools/WebViewShell/src/org/chromium/webview_shell/WebViewLayoutTest.java
+++ b/android_webview/tools/WebViewShell/src/org/chromium/webview_shell/WebViewLayoutTest.java
@@ -4,6 +4,7 @@
package org.chromium.webview_shell;
+import android.os.Environment;
import android.test.ActivityInstrumentationTestCase2;
import org.chromium.base.Log;
@@ -25,8 +26,14 @@ public class WebViewLayoutTest
extends ActivityInstrumentationTestCase2<WebViewLayoutTestActivity> {
private static final String TAG = "WebViewLayoutTest";
- private static final String PATH_PREFIX = "/data/local/tmp/webview_test/";
+
+ private static final String EXTERNAL_PREFIX =
+ Environment.getExternalStorageDirectory().getAbsolutePath() + "/";
+ private static final String BASE_WEBVIEW_TEST_PATH = "android_webview/tools/WebViewShell/test/";
+ private static final String PATH_WEBVIEW_PREFIX = EXTERNAL_PREFIX + BASE_WEBVIEW_TEST_PATH;
+
private static final long TIMEOUT_SECONDS = 20;
+
private WebViewLayoutTestActivity mTestActivity;
public WebViewLayoutTest() {
@@ -51,7 +58,8 @@ public class WebViewLayoutTest
}
public void testSimple() throws Exception {
- runTest("experimental/basic-logging.html", "experimental/basic-logging-expected.txt");
+ runTest("experimental/basic-logging.html",
+ "experimental/basic-logging-expected.txt");
}
public void testGlobalInterface() throws Exception {
@@ -62,7 +70,7 @@ public class WebViewLayoutTest
// test helper methods
private void runTest(final String fileName, final String fileNameExpected)
throws FileNotFoundException, IOException, InterruptedException, TimeoutException {
- loadUrlWebViewAsync("file://" + PATH_PREFIX + fileName, mTestActivity);
+ loadUrlWebViewAsync("file://" + PATH_WEBVIEW_PREFIX + fileName, mTestActivity);
if (getInstrumentation().isRebaseline()) {
// this is the rebase line process;
@@ -71,7 +79,7 @@ public class WebViewLayoutTest
writeFile(fileNameExpected, result, mTestActivity.getFilesDir());
Log.i(TAG, "file: " + fileNameExpected + " --> rebaselined, length=" + result.length());
} else {
- String expected = readFile(PATH_PREFIX + fileNameExpected);
+ String expected = readFile(PATH_WEBVIEW_PREFIX + fileNameExpected);
mTestActivity.waitForFinish(TIMEOUT_SECONDS, TimeUnit.SECONDS);
String result = mTestActivity.getTestResult();
assertEquals(expected, result);
« no previous file with comments | « android_webview/android_webview_shell_test_apk.isolate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698