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 5import("//build/config/android/rules.gni") 6 7group("android") { 8 testonly = true 9 deps = [ 10 ":mojo_javatests", 11 ":mojo_test_apk", 12 ":system_java", 13 ] 14} 15 16generate_jni("jni_headers") { 17 sources = [ 18 "javatests/src/org/chromium/mojo/MojoTestCase.java", 19 "javatests/src/org/chromium/mojo/bindings/ValidationTestUtil.java", 20 ] 21 public_deps = [ 22 ":system_java_jni_headers", 23 ] 24 25 jni_package = "mojo" 26} 27 28generate_jni("system_java_jni_headers") { 29 sources = [ 30 "system/src/org/chromium/mojo/system/impl/BaseRunLoop.java", 31 "system/src/org/chromium/mojo/system/impl/CoreImpl.java", 32 "system/src/org/chromium/mojo/system/impl/WatcherImpl.java", 33 ] 34 35 jni_package = "mojo" 36} 37 38source_set("libsystem_java") { 39 sources = [ 40 "system/base_run_loop.cc", 41 "system/base_run_loop.h", 42 "system/core_impl.cc", 43 "system/core_impl.h", 44 "system/watcher_impl.cc", 45 "system/watcher_impl.h", 46 ] 47 48 deps = [ 49 ":system_java_jni_headers", 50 "//base", 51 "//mojo/public/c/system", 52 "//mojo/public/cpp/system", 53 ] 54} 55 56android_library("system_java") { 57 java_files = [ 58 "system/src/org/chromium/mojo/system/impl/BaseRunLoop.java", 59 "system/src/org/chromium/mojo/system/impl/CoreImpl.java", 60 "system/src/org/chromium/mojo/system/impl/DataPipeConsumerHandleImpl.java", 61 "system/src/org/chromium/mojo/system/impl/DataPipeProducerHandleImpl.java", 62 "system/src/org/chromium/mojo/system/impl/HandleBase.java", 63 "system/src/org/chromium/mojo/system/impl/MessagePipeHandleImpl.java", 64 "system/src/org/chromium/mojo/system/impl/SharedBufferHandleImpl.java", 65 "system/src/org/chromium/mojo/system/impl/UntypedHandleImpl.java", 66 "system/src/org/chromium/mojo/system/impl/WatcherImpl.java", 67 ] 68 69 deps = [ 70 "//base:base_java", 71 "//mojo/public/java:system_java", 72 ] 73} 74 75android_library("mojo_javatests") { 76 testonly = true 77 java_files = [ 78 "javatests/src/org/chromium/mojo/HandleMock.java", 79 "javatests/src/org/chromium/mojo/MojoTestCase.java", 80 "javatests/src/org/chromium/mojo/TestUtils.java", 81 "javatests/src/org/chromium/mojo/bindings/BindingsHelperTest.java", 82 "javatests/src/org/chromium/mojo/bindings/BindingsTest.java", 83 "javatests/src/org/chromium/mojo/bindings/BindingsTestUtils.java", 84 "javatests/src/org/chromium/mojo/bindings/BindingsVersioningTest.java", 85 "javatests/src/org/chromium/mojo/bindings/CallbacksTest.java", 86 "javatests/src/org/chromium/mojo/bindings/ConnectorTest.java", 87 "javatests/src/org/chromium/mojo/bindings/ExecutorFactoryTest.java", 88 "javatests/src/org/chromium/mojo/bindings/InterfacesTest.java", 89 "javatests/src/org/chromium/mojo/bindings/MessageHeaderTest.java", 90 "javatests/src/org/chromium/mojo/bindings/ReadAndDispatchMessageTest.java", 91 "javatests/src/org/chromium/mojo/bindings/RouterTest.java", 92 "javatests/src/org/chromium/mojo/bindings/SerializationTest.java", 93 "javatests/src/org/chromium/mojo/bindings/test/mojom/mojo/IntegrationTestInterfaceTestHelper.java", 94 "javatests/src/org/chromium/mojo/bindings/ValidationTest.java", 95 "javatests/src/org/chromium/mojo/bindings/ValidationTestUtil.java", 96 "javatests/src/org/chromium/mojo/bindings/ValidationTestUtilTest.java", 97 "javatests/src/org/chromium/mojo/system/impl/CoreImplTest.java", 98 "javatests/src/org/chromium/mojo/system/impl/WatcherImplTest.java", 99 ] 100 101 deps = [ 102 ":system_java", 103 "//base:base_java", 104 "//base:base_java_test_support", 105 "//mojo/public/interfaces/bindings/tests:test_interfaces_java", 106 "//mojo/public/interfaces/bindings/tests:test_mojom_import2_java", 107 "//mojo/public/interfaces/bindings/tests:test_mojom_import_java", 108 "//mojo/public/java:bindings_java", 109 "//mojo/public/java:system_java", 110 "//third_party/android_support_test_runner:runner_java", 111 ] 112 113 data = [ 114 "//mojo/public/interfaces/bindings/tests/data/validation/", 115 ] 116} 117 118shared_library("mojo_java_unittests") { 119 testonly = true 120 121 sources = [ 122 "javatests/init_library.cc", 123 "javatests/mojo_test_case.cc", 124 "javatests/mojo_test_case.h", 125 "javatests/validation_test_util.cc", 126 "javatests/validation_test_util.h", 127 ] 128 129 deps = [ 130 ":jni_headers", 131 ":libsystem_java", 132 ":system_java_jni_headers", 133 "//base", 134 "//base/test:test_support", 135 "//build/config/sanitizers:deps", 136 "//mojo/edk/system", 137 "//mojo/public/cpp/bindings/tests:mojo_public_bindings_test_utils", 138 "//mojo/public/cpp/test_support:test_utils", 139 ] 140 defines = [ "UNIT_TEST" ] 141} 142 143instrumentation_test_apk("mojo_test_apk") { 144 deps = [ 145 ":mojo_javatests", 146 ":system_java", 147 "//base:base_java", 148 "//mojo/public/interfaces/bindings/tests:test_interfaces", 149 "//mojo/public/java:bindings_java", 150 "//third_party/android_support_test_runner:runner_java", 151 ] 152 shared_libraries = [ ":mojo_java_unittests" ] 153 apk_name = "MojoTest" 154 android_manifest = "javatests/AndroidManifest.xml" 155} 156