From f2d591e045aac9dbf7ae4b8367bad0b1927daed3 Mon Sep 17 00:00:00 2001 From: Francis Tsui Date: Thu, 1 Aug 2024 19:12:21 -0700 Subject: [PATCH] Split test targets that can run on windows. PiperOrigin-RevId: 658619600 --- internal/platform/BUILD | 89 ++++++++++++++----- .../platform/implementation/windows/BUILD | 1 + .../implementation/windows/platform.cc | 8 +- 3 files changed, 74 insertions(+), 24 deletions(-) diff --git a/internal/platform/BUILD b/internal/platform/BUILD index 3a37e6e9..3c4c3f2f 100644 --- a/internal/platform/BUILD +++ b/internal/platform/BUILD @@ -430,36 +430,17 @@ cc_library( ) cc_test( - name = "public_test", + name = "public_device_test", size = "small", timeout = "moderate", srcs = [ - "atomic_boolean_test.cc", - "atomic_reference_test.cc", "ble_connection_info_test.cc", "ble_test.cc", "ble_v2_test.cc", "bluetooth_adapter_test.cc", "bluetooth_classic_test.cc", "bluetooth_connection_info_test.cc", - "borrowable_test.cc", - "cancelable_alarm_test.cc", - "condition_variable_test.cc", - "connection_info_test.cc", - "count_down_latch_test.cc", - "credential_storage_impl_test.cc", - "crypto_test.cc", - "direct_executor_test.cc", - "future_test.cc", - "logging_test.cc", - "multi_thread_executor_test.cc", - "mutex_test.cc", "pipe_test.cc", - "scheduled_executor_test.cc", - "single_thread_executor_test.cc", - "task_runner_impl_test.cc", - "timer_impl_test.cc", - "uuid_test.cc", "wifi_direct_test.cc", "wifi_hotspot_test.cc", "wifi_lan_connection_info_test.cc", @@ -467,6 +448,64 @@ cc_test( "wifi_test.cc", "wifi_utils_test.cc", ], + deps = [ + ":base", + ":cancellation_flag", + ":comm", + ":connection_info", + ":test_util", + ":types", + "//internal/platform/implementation:comm", + "//internal/platform/implementation/g3", # build_cleaner: keep + "//proto:connections_enums_cc_proto", + "@com_github_protobuf_matchers//protobuf-matchers", + "@com_google_absl//absl/status", + "@com_google_absl//absl/strings", + "@com_google_absl//absl/time", + "@com_google_googletest//:gtest_main", + ], +) + +cc_test( + name = "credential_storage_impl_test", + srcs = ["credential_storage_impl_test.cc"], + deps = [ + ":comm", + "//internal/platform/implementation:comm", + "//internal/platform/implementation/g3", # build_cleaner: keep + "//internal/proto:credential_cc_proto", + "@com_github_protobuf_matchers//protobuf-matchers", + "@com_google_absl//absl/status", + "@com_google_absl//absl/status:statusor", + "@com_google_absl//absl/strings:string_view", + "@com_google_googletest//:gtest_main", + ], +) + +cc_test( + name = "public_test", + size = "small", + timeout = "moderate", + srcs = [ + "atomic_boolean_test.cc", + "atomic_reference_test.cc", + "borrowable_test.cc", + "cancelable_alarm_test.cc", + "condition_variable_test.cc", + "connection_info_test.cc", + "count_down_latch_test.cc", + "crypto_test.cc", + "direct_executor_test.cc", + "future_test.cc", + "logging_test.cc", + "multi_thread_executor_test.cc", + "mutex_test.cc", + "scheduled_executor_test.cc", + "single_thread_executor_test.cc", + "task_runner_impl_test.cc", + "timer_impl_test.cc", + "uuid_test.cc", + ], copts = ["-DCORE_ADAPTER_DLL"], shard_count = 16, deps = [ @@ -479,7 +518,6 @@ cc_test( ":uuid", "//internal/crypto_cros", "//internal/platform/implementation:comm", - "//internal/platform/implementation/g3", # build_cleaner: keep "//internal/proto:credential_cc_proto", "//proto:connections_enums_cc_proto", "@com_github_protobuf_matchers//protobuf-matchers", @@ -490,5 +528,12 @@ cc_test( "@com_google_absl//absl/time", "@com_google_absl//absl/types:variant", "@com_google_googletest//:gtest_main", - ], + ] + select({ + "@platforms//os:windows": [ + "//internal/platform/implementation/windows", + ], + "//conditions:default": [ + "//internal/platform/implementation/g3", + ], + }), ) diff --git a/internal/platform/implementation/windows/BUILD b/internal/platform/implementation/windows/BUILD index 35278a81..3a6e5a2a 100644 --- a/internal/platform/implementation/windows/BUILD +++ b/internal/platform/implementation/windows/BUILD @@ -212,6 +212,7 @@ cc_library( "//chrome/chromeos/assistant/data_migration/lib:__pkg__", "//connections:__subpackages__", "//fastpair:__subpackages__", + "//internal/platform:__subpackages__", "//location/nearby:__subpackages__", "//presence:__subpackages__", "//sharing:__subpackages__", diff --git a/internal/platform/implementation/windows/platform.cc b/internal/platform/implementation/windows/platform.cc index ddd8c6e6..7187605d 100644 --- a/internal/platform/implementation/windows/platform.cc +++ b/internal/platform/implementation/windows/platform.cc @@ -27,14 +27,13 @@ #include #include -#include #include -#include #include #include #include "absl/status/statusor.h" #include "absl/strings/string_view.h" +#include "internal/platform/implementation/credential_storage.h" #include "internal/platform/implementation/http_loader.h" #include "internal/platform/implementation/shared/count_down_latch.h" #include "internal/platform/implementation/windows/atomic_boolean.h" @@ -276,6 +275,11 @@ ImplementationPlatform::CreateBleV2Medium(api::BluetoothAdapter& adapter) { return std::make_unique(adapter); } +std::unique_ptr +ImplementationPlatform::CreateCredentialStorage() { + return nullptr; +} + // TODO(b/184975123): replace with real implementation. std::unique_ptr ImplementationPlatform::CreateServerSyncMedium() {