# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import("//testing/test.gni") config("cacheinvalidation_config") { include_dirs = [ "overrides", "src", ] } static_library("cacheinvalidation") { sources = [ "overrides/google/cacheinvalidation/deps/callback.h", "overrides/google/cacheinvalidation/deps/gmock.h", "overrides/google/cacheinvalidation/deps/googletest.h", "overrides/google/cacheinvalidation/deps/logging.h", "overrides/google/cacheinvalidation/deps/mutex.h", "overrides/google/cacheinvalidation/deps/random.cc", "overrides/google/cacheinvalidation/deps/random.h", "overrides/google/cacheinvalidation/deps/scoped_ptr.h", "overrides/google/cacheinvalidation/deps/sha1-digest-function.h", "overrides/google/cacheinvalidation/deps/stl-namespace.h", "overrides/google/cacheinvalidation/deps/string_util.h", "overrides/google/cacheinvalidation/deps/time.h", "src/google/cacheinvalidation/deps/digest-function.h", "src/google/cacheinvalidation/impl/basic-system-resources.cc", "src/google/cacheinvalidation/impl/basic-system-resources.h", "src/google/cacheinvalidation/impl/checking-invalidation-listener.cc", "src/google/cacheinvalidation/impl/checking-invalidation-listener.h", "src/google/cacheinvalidation/impl/client-protocol-namespace-fix.h", "src/google/cacheinvalidation/impl/constants.cc", "src/google/cacheinvalidation/impl/constants.h", "src/google/cacheinvalidation/impl/digest-store.h", "src/google/cacheinvalidation/impl/exponential-backoff-delay-generator.cc", "src/google/cacheinvalidation/impl/exponential-backoff-delay-generator.h", "src/google/cacheinvalidation/impl/invalidation-client-core.cc", "src/google/cacheinvalidation/impl/invalidation-client-core.h", "src/google/cacheinvalidation/impl/invalidation-client-factory.cc", "src/google/cacheinvalidation/impl/invalidation-client-impl.cc", "src/google/cacheinvalidation/impl/invalidation-client-impl.h", "src/google/cacheinvalidation/impl/invalidation-client-util.h", "src/google/cacheinvalidation/impl/log-macro.h", "src/google/cacheinvalidation/impl/object-id-digest-utils.cc", "src/google/cacheinvalidation/impl/object-id-digest-utils.h", "src/google/cacheinvalidation/impl/persistence-utils.cc", "src/google/cacheinvalidation/impl/persistence-utils.h", "src/google/cacheinvalidation/impl/proto-converter.cc", "src/google/cacheinvalidation/impl/proto-converter.h", "src/google/cacheinvalidation/impl/proto-helpers.cc", "src/google/cacheinvalidation/impl/proto-helpers.h", "src/google/cacheinvalidation/impl/protocol-handler.cc", "src/google/cacheinvalidation/impl/protocol-handler.h", "src/google/cacheinvalidation/impl/recurring-task.cc", "src/google/cacheinvalidation/impl/recurring-task.h", "src/google/cacheinvalidation/impl/registration-manager.cc", "src/google/cacheinvalidation/impl/registration-manager.h", "src/google/cacheinvalidation/impl/repeated-field-namespace-fix.h", "src/google/cacheinvalidation/impl/run-state.h", "src/google/cacheinvalidation/impl/safe-storage.cc", "src/google/cacheinvalidation/impl/safe-storage.h", "src/google/cacheinvalidation/impl/simple-registration-store.cc", "src/google/cacheinvalidation/impl/simple-registration-store.h", "src/google/cacheinvalidation/impl/smearer.h", "src/google/cacheinvalidation/impl/statistics.cc", "src/google/cacheinvalidation/impl/statistics.h", "src/google/cacheinvalidation/impl/throttle.cc", "src/google/cacheinvalidation/impl/throttle.h", "src/google/cacheinvalidation/impl/ticl-message-validator.cc", "src/google/cacheinvalidation/impl/ticl-message-validator.h", "src/google/cacheinvalidation/include/invalidation-client-factory.h", "src/google/cacheinvalidation/include/invalidation-client.h", "src/google/cacheinvalidation/include/invalidation-listener.h", "src/google/cacheinvalidation/include/system-resources.h", "src/google/cacheinvalidation/include/types.h", ] # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] public_configs = [ ":cacheinvalidation_config" ] public_deps = [ "src/google/cacheinvalidation:cacheinvalidation_proto_cpp", ] deps = [ "//base", ] } # TODO(GYP): Delete this after we've converted everything to GN. # The _run targets exist only for compatibility w/ GYP. group("cacheinvalidation_unittests_run") { testonly = true deps = [ ":cacheinvalidation_unittests", ] } test("cacheinvalidation_unittests") { sources = [ "src/google/cacheinvalidation/impl/invalidation-client-impl_test.cc", "src/google/cacheinvalidation/impl/protocol-handler_test.cc", "src/google/cacheinvalidation/impl/recurring-task_test.cc", "src/google/cacheinvalidation/impl/throttle_test.cc", "src/google/cacheinvalidation/test/deterministic-scheduler.cc", "src/google/cacheinvalidation/test/deterministic-scheduler.h", "src/google/cacheinvalidation/test/test-logger.cc", "src/google/cacheinvalidation/test/test-logger.h", "src/google/cacheinvalidation/test/test-utils.cc", "src/google/cacheinvalidation/test/test-utils.h", ] deps = [ ":cacheinvalidation", "src/google/cacheinvalidation:cacheinvalidation_proto_cpp", "//base", "//base/test:run_all_unittests", "//testing/gmock", "//testing/gtest", ] } # TODO(GYP) Test isolation stuff. if (is_android) { import("//build/config/android/rules.gni") # GYP: //third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_java proto_java_library("cacheinvalidation_proto_java") { proto_path = "src/proto" sources = [ "$proto_path/android_channel.proto", "$proto_path/android_listener.proto", "$proto_path/android_service.proto", "$proto_path/channel_common.proto", "$proto_path/client.proto", "$proto_path/client_protocol.proto", "$proto_path/java_client.proto", "$proto_path/types.proto", ] } # GYP: //third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_javalib android_library("cacheinvalidation_javalib") { deps = [ ":cacheinvalidation_proto_java", "//third_party/android_protobuf:protobuf_nano_javalib", "//third_party/android_tools:android_gcm_java", google_play_services_library, ] DEPRECATED_java_in_dir = "src/java" } }