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

Unified Diff: base/test/android/javatests/src/org/chromium/base/test/util/UrlUtils.java

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/system_monitor/system_monitor.cc ('k') | base/test/multiprocess_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/android/javatests/src/org/chromium/base/test/util/UrlUtils.java
diff --git a/base/test/android/javatests/src/org/chromium/base/test/util/UrlUtils.java b/base/test/android/javatests/src/org/chromium/base/test/util/UrlUtils.java
index 09e1fd60fa01c903751c20dffdb152dd7c77ee45..797585f4593ab1ace985dd2e840f502fafd39f55 100644
--- a/base/test/android/javatests/src/org/chromium/base/test/util/UrlUtils.java
+++ b/base/test/android/javatests/src/org/chromium/base/test/util/UrlUtils.java
@@ -16,20 +16,41 @@ public class UrlUtils {
/**
* Construct the full path of a test data file.
- * @param path Pathname relative to external/chrome/testing/data
+ * @param path Pathname relative to external/chrome/test/data
*/
public static String getTestFilePath(String path) {
+ // TODO(jbudorick): Remove DATA_DIR once everything has been isolated. crbug/400499
return PathUtils.getExternalStorageDirectory() + DATA_DIR + path;
}
+ // TODO(jbudorick): Remove this function once everything has been isolated and switched back
+ // to getTestFilePath. crbug/400499
+ /**
+ * Construct the full path of a test data file.
+ * @param path Pathname relative to external/
+ */
+ public static String getIsolatedTestFilePath(String path) {
+ return PathUtils.getExternalStorageDirectory() + "/" + path;
+ }
+
/**
* Construct a suitable URL for loading a test data file.
- * @param path Pathname relative to external/chrome/testing/data
+ * @param path Pathname relative to external/chrome/test/data
*/
public static String getTestFileUrl(String path) {
return "file://" + getTestFilePath(path);
}
+ // TODO(jbudorick): Remove this function once everything has been isolated and switched back
+ // to getTestFileUrl. crbug/400499
+ /**
+ * Construct a suitable URL for loading a test data file.
+ * @param path Pathname relative to external/
+ */
+ public static String getIsolatedTestFileUrl(String path) {
+ return "file://" + getIsolatedTestFilePath(path);
+ }
+
/**
* Construct a data:text/html URI for loading from an inline HTML.
* @param html An unencoded HTML
@@ -41,8 +62,7 @@ public class UrlUtils {
// ' '->'+' needs to be undone and replaced with ' '->'%20'
// to match the Data URI requirements.
String encoded =
- "data:text/html;utf-8," +
- java.net.URLEncoder.encode(html, "UTF-8");
+ "data:text/html;utf-8," + java.net.URLEncoder.encode(html, "UTF-8");
encoded = encoded.replace("+", "%20");
return encoded;
} catch (java.io.UnsupportedEncodingException e) {
« no previous file with comments | « base/system_monitor/system_monitor.cc ('k') | base/test/multiprocess_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698