1 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 5 import("//mojo/public/tools/bindings/mojom.gni") 6 import("//testing/test.gni") 7 8 group("common") { 9 public_deps = [ 10 ":common_base", 11 ":common_custom_types", 12 ] 13 } 14 15 mojom("common_custom_types") { 16 sources = [ 17 "file.mojom", 18 "file_path.mojom", 19 "string16.mojom", 20 "text_direction.mojom", 21 "time.mojom", 22 "unguessable_token.mojom", 23 "values.mojom", 24 "version.mojom", 25 ] 26 } 27 28 component("common_base") { 29 output_name = "mojo_common_lib" 30 31 sources = [ 32 "data_pipe_drainer.cc", 33 "data_pipe_drainer.h", 34 "data_pipe_utils.cc", 35 "data_pipe_utils.h", 36 ] 37 38 defines = [ "MOJO_COMMON_IMPLEMENTATION" ] 39 40 public_deps = [ 41 "//base", 42 "//mojo/public/cpp/bindings", 43 "//mojo/public/cpp/system", 44 ] 45 } 46 47 mojom("test_common_custom_types") { 48 sources = [ 49 "test_common_custom_types.mojom", 50 "traits_test_service.mojom", 51 ] 52 public_deps = [ 53 ":common_custom_types", 54 ] 55 } 56 57 test("mojo_common_unittests") { 58 deps = [ 59 ":common", 60 ":common_custom_types", 61 ":struct_traits", 62 ":test_common_custom_types", 63 "//base", 64 "//base:message_loop_tests", 65 "//base/test:test_support", 66 "//mojo/edk/test:run_all_unittests", 67 "//mojo/edk/test:test_support", 68 "//mojo/public/cpp/bindings", 69 "//mojo/public/cpp/test_support:test_utils", 70 "//testing/gtest", 71 "//url", 72 ] 73 74 sources = [ 75 "common_custom_types_unittest.cc", 76 "struct_traits_unittest.cc", 77 ] 78 } 79 80 source_set("struct_traits") { 81 sources = [ 82 "common_custom_types_struct_traits.cc", 83 "common_custom_types_struct_traits.h", 84 ] 85 deps = [ 86 ":common_custom_types_shared_cpp_sources", 87 "//base:base", 88 "//mojo/public/cpp/system", 89 ] 90 public_deps = [ 91 "//base:i18n", 92 ] 93 } 94