Chromium Code Reviews| 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 #include "base/file_path.h" |
| 7 #include "base/file_util.h" | |
| 7 | 8 |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 10 |
| 10 namespace base { | 11 namespace base { |
| 11 namespace android { | 12 namespace android { |
| 12 | 13 |
| 13 typedef testing::Test PathUtilsTest; | 14 typedef testing::Test PathUtilsTest; |
| 14 | 15 |
| 15 TEST_F(PathUtilsTest, TestGetDataDirectory) { | 16 TEST_F(PathUtilsTest, TestGetDataDirectory) { |
| 16 // The string comes from the Java side and depends on the APK | 17 // The string comes from the Java side and depends on the APK |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 31 EXPECT_STREQ("/data/data/org.chromium.native_test/cache", | 32 EXPECT_STREQ("/data/data/org.chromium.native_test/cache", |
| 32 path.value().c_str()); | 33 path.value().c_str()); |
| 33 } | 34 } |
| 34 | 35 |
| 35 TEST_F(PathUtilsTest, TestGetNativeLibraryDirectory) { | 36 TEST_F(PathUtilsTest, TestGetNativeLibraryDirectory) { |
| 36 // The string comes from the Java side and depends on the APK | 37 // The string comes from the Java side and depends on the APK |
| 37 // we are running in. Assumes that we are packaged in | 38 // we are running in. Assumes that we are packaged in |
| 38 // org.chromium.native_test | 39 // org.chromium.native_test |
| 39 FilePath path; | 40 FilePath path; |
| 40 GetNativeLibraryDirectory(&path); | 41 GetNativeLibraryDirectory(&path); |
| 41 EXPECT_STREQ("/data/data/org.chromium.native_test/lib", | 42 // The exact location of the native library will depend on Android |
| 42 path.value().c_str()); | 43 // implementation. We just check that there is at least one .so |
| 44 // in the returned directory. | |
| 45 file_util::FileEnumerator enumerator( | |
| 46 path, | |
| 47 false, | |
| 48 file_util::FileEnumerator::FILES, | |
| 49 "*.so"); | |
|
bulach
2012/11/21 12:04:48
maybe best to check that it contains at least libb
| |
| 50 EXPECT_FALSE(enumerator.Next().empty()); | |
| 43 } | 51 } |
| 44 | 52 |
| 45 } // namespace android | 53 } // namespace android |
| 46 } // namespace base | 54 } // namespace base |
| OLD | NEW |