diff options
author | erg <erg@chromium.org> | 2016-03-21 17:51:20 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-22 00:52:36 +0000 |
commit | f1f689fb5b3ede5756b138e617ed7c879f181cec (patch) | |
tree | 0aef325c88f6911d5fc00fd1b4de7199d6d8c1b3 | |
parent | e9d92a8bc3c4c10dc6b68daa5c834a26c5db9ab1 (diff) | |
download | chromium_src-f1f689fb5b3ede5756b138e617ed7c879f181cec.zip chromium_src-f1f689fb5b3ede5756b138e617ed7c879f181cec.tar.gz chromium_src-f1f689fb5b3ede5756b138e617ed7c879f181cec.tar.bz2 |
Convert leveldb_apptests to unit tests.
BUG=594731
R=sky@chromium.org
TBR=dpranke@chromium.org
Review URL: https://codereview.chromium.org/1812263004
Cr-Commit-Position: refs/heads/master@{#382464}
-rw-r--r-- | BUILD.gn | 2 | ||||
-rw-r--r-- | components/leveldb/BUILD.gn | 24 | ||||
-rw-r--r-- | components/leveldb/apptest_manifest.json | 5 | ||||
-rw-r--r-- | components/leveldb/leveldb_service_unittest.cc (renamed from components/leveldb/leveldb_apptest.cc) | 8 | ||||
-rw-r--r-- | components/leveldb/test_manifest.json | 5 | ||||
-rw-r--r-- | mojo/tools/data/apptests | 4 | ||||
-rw-r--r-- | testing/buildbot/chromium.linux.json | 12 | ||||
-rw-r--r-- | testing/buildbot/gn_isolate_map.pyl | 4 |
8 files changed, 38 insertions, 26 deletions
@@ -588,7 +588,6 @@ group("mojo_apptests") { if (is_win || is_linux) { deps += [ - "//components/leveldb:apptests", "//components/resource_provider:apptests", "//components/resource_provider:resource_provider_unittests", "//mash/wm:tests", @@ -638,6 +637,7 @@ group("gn_only") { "//chrome/tools/convert_dict", "//components/constrained_window:unit_tests", "//components/filesystem:unittests", + "//components/leveldb:leveldb_service_unittests", "//components/metrics:serialization", "//components/password_manager/content/renderer:browser_tests", "//components/rappor:unit_tests", diff --git a/components/leveldb/BUILD.gn b/components/leveldb/BUILD.gn index a68f5ec..009bf83 100644 --- a/components/leveldb/BUILD.gn +++ b/components/leveldb/BUILD.gn @@ -4,6 +4,7 @@ import("//mojo/public/mojo_application.gni") import("//mojo/public/mojo_application_manifest.gni") +import("//testing/test.gni") source_set("lib") { sources = [ @@ -58,13 +59,9 @@ mojo_application_manifest("manifest") { source = "manifest.json" } -mojo_native_application("apptests") { - output_name = "leveldb_apptests" - - testonly = true - +test("leveldb_service_unittests") { sources = [ - "leveldb_apptest.cc", + "leveldb_service_unittest.cc", ] deps = [ @@ -72,19 +69,22 @@ mojo_native_application("apptests") { "//components/filesystem/public/interfaces", "//components/leveldb/public/interfaces", "//mojo/common", - "//mojo/platform_handle:for_shared_library", + "//mojo/platform_handle", "//mojo/public/cpp/bindings", - "//mojo/shell/public/cpp:test_support", + "//mojo/shell/public/cpp:shell_test_support", + "//mojo/shell/public/cpp:sources", + "//mojo/shell/public/cpp/test:run_all_shelltests", ] data_deps = [ - ":apptest_manifest", + ":test_manifest", ":leveldb", "//components/filesystem:filesystem", ] } -mojo_application_manifest("apptest_manifest") { - application_name = "leveldb_apptests" - source = "apptest_manifest.json" +mojo_application_manifest("test_manifest") { + type = "exe" + application_name = "leveldb_service_unittests" + source = "test_manifest.json" } diff --git a/components/leveldb/apptest_manifest.json b/components/leveldb/apptest_manifest.json deleted file mode 100644 index f7f256f..0000000 --- a/components/leveldb/apptest_manifest.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "mojo:leveldb_apptests", - "display_name": "LevelDB Service Apptests", - "capabilities": { "*": ["*"] } -} diff --git a/components/leveldb/leveldb_apptest.cc b/components/leveldb/leveldb_service_unittest.cc index 104c829..7711deb 100644 --- a/components/leveldb/leveldb_apptest.cc +++ b/components/leveldb/leveldb_service_unittest.cc @@ -9,8 +9,8 @@ #include "components/leveldb/public/interfaces/leveldb.mojom.h" #include "mojo/common/common_type_converters.h" #include "mojo/public/cpp/bindings/binding_set.h" -#include "mojo/shell/public/cpp/application_test_base.h" #include "mojo/shell/public/cpp/shell_connection.h" +#include "mojo/shell/public/cpp/shell_test.h" #include "mojo/util/capture_util.h" using filesystem::FileError; @@ -19,15 +19,15 @@ using mojo::Capture; namespace leveldb { namespace { -class LevelDBApptest : public mojo::test::ApplicationTestBase { +class LevelDBApptest : public mojo::test::ShellTest { public: - LevelDBApptest() {} + LevelDBApptest() : ShellTest("exe:leveldb_service_unittests") {} ~LevelDBApptest() override {} protected: // Overridden from mojo::test::ApplicationTestBase: void SetUp() override { - ApplicationTestBase::SetUp(); + ShellTest::SetUp(); connector()->ConnectToInterface("mojo:filesystem", &files_); connector()->ConnectToInterface("mojo:leveldb", &leveldb_); } diff --git a/components/leveldb/test_manifest.json b/components/leveldb/test_manifest.json new file mode 100644 index 0000000..b013a4a --- /dev/null +++ b/components/leveldb/test_manifest.json @@ -0,0 +1,5 @@ +{ + "name": "exe:leveldb_service_unittests", + "display_name": "LevelDB Service Unittests", + "capabilities": { "*": [ "*" ] } +} diff --git a/mojo/tools/data/apptests b/mojo/tools/data/apptests index 8e07e4e..d28fb98 100644 --- a/mojo/tools/data/apptests +++ b/mojo/tools/data/apptests @@ -54,8 +54,4 @@ if config.target_os != config.OS_ANDROID: # 'test': 'mojo:media_pipeline_integration_apptests', # 'type': 'gtest_isolated', # }, - { - 'test': 'mojo:leveldb_apptests', - 'type': 'gtest_isolated', - } ] diff --git a/testing/buildbot/chromium.linux.json b/testing/buildbot/chromium.linux.json index 8f9d3e8..820345b 100644 --- a/testing/buildbot/chromium.linux.json +++ b/testing/buildbot/chromium.linux.json @@ -770,6 +770,12 @@ "test": "jingle_unittests" }, { + "swarming": { + "can_use_on_swarming_builders": true + }, + "test": "leveldb_service_unittests" + }, + { "test": "mash_unittests" }, { @@ -1205,6 +1211,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "leveldb_service_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "media_blink_unittests" }, { diff --git a/testing/buildbot/gn_isolate_map.pyl b/testing/buildbot/gn_isolate_map.pyl index efe5c9d..97e68a3 100644 --- a/testing/buildbot/gn_isolate_map.pyl +++ b/testing/buildbot/gn_isolate_map.pyl @@ -319,6 +319,10 @@ "label": "//ui/keyboard:keyboard_unittests", "type": "unknown", }, + "leveldb_service_unittests": { + "label": "//components/leveldb:leveldb_service_unittests", + "type": "console_test_launcher", + }, # See http://crbug.com/585151 #"libaddressinput_unittests": { #"label": "//third_party/libaddressinput:libaddressinput_unittests", |