| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/android/path_utils.h" | 5 #include "base/android/path_utils.h" |
| 6 #include "base/file_path.h" |
| 6 | 7 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 9 |
| 9 namespace base { | 10 namespace base { |
| 10 namespace android { | 11 namespace android { |
| 11 | 12 |
| 12 typedef testing::Test PathUtilsTest; | 13 typedef testing::Test PathUtilsTest; |
| 13 | 14 |
| 14 TEST_F(PathUtilsTest, TestGetDataDirectory) { | 15 TEST_F(PathUtilsTest, TestGetDataDirectory) { |
| 15 // The string comes from the Java side and depends on the APK | 16 // The string comes from the Java side and depends on the APK |
| 16 // we are running in. Assumes that we are packaged in | 17 // we are running in. Assumes that we are packaged in |
| 17 // org.chromium.native_test | 18 // org.chromium.native_test |
| 19 FilePath path; |
| 20 GetDataDirectory(&path); |
| 18 EXPECT_STREQ("/data/data/org.chromium.native_test/app_chrome", | 21 EXPECT_STREQ("/data/data/org.chromium.native_test/app_chrome", |
| 19 GetDataDirectory().c_str()); | 22 path.value().c_str()); |
| 20 } | 23 } |
| 21 | 24 |
| 22 TEST_F(PathUtilsTest, TestGetCacheDirectory) { | 25 TEST_F(PathUtilsTest, TestGetCacheDirectory) { |
| 23 // The string comes from the Java side and depends on the APK | 26 // The string comes from the Java side and depends on the APK |
| 24 // we are running in. Assumes that we are packaged in | 27 // we are running in. Assumes that we are packaged in |
| 25 // org.chromium.native_test | 28 // org.chromium.native_test |
| 29 FilePath path; |
| 30 GetCacheDirectory(&path); |
| 26 EXPECT_STREQ("/data/data/org.chromium.native_test/cache", | 31 EXPECT_STREQ("/data/data/org.chromium.native_test/cache", |
| 27 GetCacheDirectory().c_str()); | 32 path.value().c_str()); |
| 28 } | 33 } |
| 29 | 34 |
| 30 TEST_F(PathUtilsTest, TestGetNativeLibraryDirectory) { | 35 TEST_F(PathUtilsTest, TestGetNativeLibraryDirectory) { |
| 31 // The string comes from the Java side and depends on the APK | 36 // The string comes from the Java side and depends on the APK |
| 32 // we are running in. Assumes that we are packaged in | 37 // we are running in. Assumes that we are packaged in |
| 33 // org.chromium.native_test | 38 // org.chromium.native_test |
| 39 FilePath path; |
| 40 GetNativeLibraryDirectory(&path); |
| 34 EXPECT_STREQ("/data/data/org.chromium.native_test/lib", | 41 EXPECT_STREQ("/data/data/org.chromium.native_test/lib", |
| 35 GetNativeLibraryDirectory().c_str()); | 42 path.value().c_str()); |
| 36 } | 43 } |
| 37 | 44 |
| 38 } // namespace android | 45 } // namespace android |
| 39 } // namespace base | 46 } // namespace base |
| OLD | NEW |