summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authoragrieve <agrieve@chromium.org>2015-07-17 07:18:03 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-17 14:18:53 +0000
commit6e5b7a69a33b5364bffa55c76a08ab6fe3ee59bb (patch)
tree8b4d03e3758998366db2dda64d6e7edb39e110f0 /base
parentbe0ee6409f53459462fe53e283bed73054306532 (diff)
downloadchromium_src-6e5b7a69a33b5364bffa55c76a08ab6fe3ee59bb.zip
chromium_src-6e5b7a69a33b5364bffa55c76a08ab6fe3ee59bb.tar.gz
chromium_src-6e5b7a69a33b5364bffa55c76a08ab6fe3ee59bb.tar.bz2
Fix base/android/path_utils_unittest.cc when running on an M device
BUG= Review URL: https://codereview.chromium.org/1238123002 Cr-Commit-Position: refs/heads/master@{#339247}
Diffstat (limited to 'base')
-rw-r--r--base/android/path_utils_unittest.cc23
1 files changed, 19 insertions, 4 deletions
diff --git a/base/android/path_utils_unittest.cc b/base/android/path_utils_unittest.cc
index c678ce2..d991810 100644
--- a/base/android/path_utils_unittest.cc
+++ b/base/android/path_utils_unittest.cc
@@ -5,6 +5,7 @@
#include "base/android/path_utils.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
+#include "base/strings/string_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -13,14 +14,27 @@ namespace android {
typedef testing::Test PathUtilsTest;
+namespace {
+void ExpectEither(const std::string& expected1,
+ const std::string& expected2,
+ const std::string& actual) {
+ EXPECT_TRUE(expected1 == actual || expected2 == actual)
+ << "Value of: " << actual << std::endl
+ << "Expected either: " << expected1 << std::endl
+ << "or: " << expected2;
+}
+} // namespace
+
TEST_F(PathUtilsTest, TestGetDataDirectory) {
// The string comes from the Java side and depends on the APK
// we are running in. Assumes that we are packaged in
// org.chromium.native_test
FilePath path;
GetDataDirectory(&path);
- EXPECT_STREQ("/data/data/org.chromium.native_test/app_chrome",
- path.value().c_str());
+
+ ExpectEither("/data/data/org.chromium.native_test/app_chrome",
+ "/data/user/0/org.chromium.native_test/app_chrome",
+ path.value());
}
TEST_F(PathUtilsTest, TestGetCacheDirectory) {
@@ -29,8 +43,9 @@ TEST_F(PathUtilsTest, TestGetCacheDirectory) {
// org.chromium.native_test
FilePath path;
GetCacheDirectory(&path);
- EXPECT_STREQ("/data/data/org.chromium.native_test/cache",
- path.value().c_str());
+ ExpectEither("/data/data/org.chromium.native_test/cache",
+ "/data/user/0/org.chromium.native_test/cache",
+ path.value());
}
TEST_F(PathUtilsTest, TestGetNativeLibraryDirectory) {