diff options
author | jsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-28 16:12:41 +0000 |
---|---|---|
committer | jsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-28 16:12:41 +0000 |
commit | 79af434c62ade26cc5ae5fcb8b8f56398635ea73 (patch) | |
tree | 56accf8eb54a2d04fe861ad5ffea6927a48bfa01 /third_party | |
parent | b3e916f51bcd163ae3f40800cf1003c850277be8 (diff) | |
download | chromium_src-79af434c62ade26cc5ae5fcb8b8f56398635ea73.zip chromium_src-79af434c62ade26cc5ae5fcb8b8f56398635ea73.tar.gz chromium_src-79af434c62ade26cc5ae5fcb8b8f56398635ea73.tar.bz2 |
Building env_chromium_unittests for Android.
The LevelDB Chromium environment unit tests (AKA env_chromium_unittests) were
neither compiling for Android, nor was an APK produced that could be run.
BUG=356882
R=jsbell@chromium.org
Review URL: https://codereview.chromium.org/213843002
Patch from Christopher Mumford <cmumford@chromium.org>.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260148 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/leveldatabase/README.chromium | 1 | ||||
-rw-r--r-- | third_party/leveldatabase/env_chromium_unittest.cc | 8 | ||||
-rw-r--r-- | third_party/leveldatabase/leveldatabase.gyp | 25 |
3 files changed, 30 insertions, 4 deletions
diff --git a/third_party/leveldatabase/README.chromium b/third_party/leveldatabase/README.chromium index a96f4be..3d7b021 100644 --- a/third_party/leveldatabase/README.chromium +++ b/third_party/leveldatabase/README.chromium @@ -24,3 +24,4 @@ Local Additions: HANDLE_EINTR macro that retries the call. * TRACE macros/thread name for chrome://tracing diagnostics * Handle in-process exclusive file locks, based on src/util/env_posix.cc +* Unit tests for the Chromium environment. diff --git a/third_party/leveldatabase/env_chromium_unittest.cc b/third_party/leveldatabase/env_chromium_unittest.cc index 66e498b..092ddfb 100644 --- a/third_party/leveldatabase/env_chromium_unittest.cc +++ b/third_party/leveldatabase/env_chromium_unittest.cc @@ -113,7 +113,7 @@ TYPED_TEST(ChromiumEnvMultiPlatformTests, DirectorySyncing) { MyEnv<TypeParam> env; base::ScopedTempDir dir; - dir.CreateUniqueTempDir(); + ASSERT_TRUE(dir.CreateUniqueTempDir()); base::FilePath dir_path = dir.path(); std::string some_data = "some data"; Slice data = some_data; @@ -176,7 +176,7 @@ TEST(ChromiumEnv, BackupTables) { options.env = IDBEnv(); base::ScopedTempDir scoped_temp_dir; - scoped_temp_dir.CreateUniqueTempDir(); + ASSERT_TRUE(scoped_temp_dir.CreateUniqueTempDir()); base::FilePath dir = scoped_temp_dir.path(); DB* db; @@ -221,7 +221,7 @@ TEST(ChromiumEnv, BackupTables) { TEST(ChromiumEnv, GetChildrenEmptyDir) { base::ScopedTempDir scoped_temp_dir; - scoped_temp_dir.CreateUniqueTempDir(); + ASSERT_TRUE(scoped_temp_dir.CreateUniqueTempDir()); base::FilePath dir = scoped_temp_dir.path(); Env* env = IDBEnv(); @@ -233,7 +233,7 @@ TEST(ChromiumEnv, GetChildrenEmptyDir) { TEST(ChromiumEnv, GetChildrenPriorResults) { base::ScopedTempDir scoped_temp_dir; - scoped_temp_dir.CreateUniqueTempDir(); + ASSERT_TRUE(scoped_temp_dir.CreateUniqueTempDir()); base::FilePath dir = scoped_temp_dir.path(); base::FilePath new_file_dir = dir.Append(FPL("tmp_file")); diff --git a/third_party/leveldatabase/leveldatabase.gyp b/third_party/leveldatabase/leveldatabase.gyp index 3cb8869..f6956ed 100644 --- a/third_party/leveldatabase/leveldatabase.gyp +++ b/third_party/leveldatabase/leveldatabase.gyp @@ -14,6 +14,22 @@ 'use_snappy': 0, }, }], + ['OS=="android" and gtest_target_type == "shared_library"', { + # Wrap env_chromium_unittests into an android apk for execution. + 'targets': [{ + 'target_name': 'env_chromium_unittests_apk', + 'type': 'none', + 'dependencies': [ + '<(DEPTH)/base/base.gyp:base_java', + 'env_chromium_unittests', + ], + 'variables': { + 'test_suite_name': 'env_chromium_unittests', + 'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)env_chromium_unittests<(SHARED_LIB_SUFFIX)', + }, + 'includes': [ '../../build/apk_test.gypi' ], + }], + }], ], 'target_defaults': { 'defines': [ @@ -180,6 +196,15 @@ 'sources': [ 'env_chromium_unittest.cc', ], + 'conditions': [ + ['OS=="android" and gtest_target_type == "shared_library"', { + 'type': 'shared_library', + 'dependencies': [ + '../../testing/android/native_test.gyp:native_test_native_code', + '../../tools/android/forwarder2/forwarder.gyp:forwarder2', + ], + }], + ], }, { 'target_name': 'leveldb_testutil', |