summaryrefslogtreecommitdiffstats
path: root/base/android
diff options
context:
space:
mode:
authormnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-12 15:38:14 +0000
committermnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-12 15:38:14 +0000
commitfc62ee00130d361b063964423fc362c2fe4d5145 (patch)
tree2e28a1441f25a337ea3b30f649eb0a847adc7d99 /base/android
parent091e96266b2a071f2f2b8341cde694a41e5577e9 (diff)
downloadchromium_src-fc62ee00130d361b063964423fc362c2fe4d5145.zip
chromium_src-fc62ee00130d361b063964423fc362c2fe4d5145.tar.gz
chromium_src-fc62ee00130d361b063964423fc362c2fe4d5145.tar.bz2
[Android] Upstream org.chromium.base.test.UrlUtils (partially) and device files
Required by android_webview AwSettingsTest BUG=146009 Review URL: https://chromiumcodereview.appspot.com/10911097 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156304 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/android')
-rw-r--r--base/android/javatests/src/org/chromium/base/test/UrlUtils.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/base/android/javatests/src/org/chromium/base/test/UrlUtils.java b/base/android/javatests/src/org/chromium/base/test/UrlUtils.java
new file mode 100644
index 0000000..924cbbc
--- /dev/null
+++ b/base/android/javatests/src/org/chromium/base/test/UrlUtils.java
@@ -0,0 +1,23 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.base.test;
+
+import org.chromium.base.PathUtils;
+
+/**
+ * Collection of URL utilities.
+ */
+public class UrlUtils {
+ private final static String DATA_DIR = "/chrome/test/data/";
+
+ /**
+ * Construct a suitable URL for loading a test data file.
+ *
+ * @param path Pathname relative to external/chrome/testing/data
+ */
+ public static String getTestFileUrl(String path) {
+ return "file://" + PathUtils.getExternalStorageDirectory() + DATA_DIR + path;
+ }
+}