OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # ============================================================================== | 5 # ============================================================================== |
6 # TEST SETUP | 6 # TEST SETUP |
7 # ============================================================================== | 7 # ============================================================================== |
8 | 8 |
9 template("_gen_isolate") { | 9 template("_gen_isolate") { |
10 testonly = true | 10 testonly = true |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 deps = [ | 56 deps = [ |
57 ":${invoker.target_name}__write_deps", | 57 ":${invoker.target_name}__write_deps", |
58 ] | 58 ] |
59 } | 59 } |
60 } | 60 } |
61 | 61 |
62 # Define a test as an executable (or apk on Android) with the "testonly" flag | 62 # Define a test as an executable (or apk on Android) with the "testonly" flag |
63 # set. | 63 # set. |
64 # Variable: | 64 # Variable: |
65 # use_raw_android_executable: Use executable() rather than android_apk(). | 65 # use_raw_android_executable: Use executable() rather than android_apk(). |
| 66 # use_native_activity: Test implements ANativeActivity_onCreate(). |
66 template("test") { | 67 template("test") { |
67 if (is_android) { | 68 if (is_android) { |
68 import("//build/config/android/config.gni") | 69 import("//build/config/android/config.gni") |
69 import("//build/config/android/rules.gni") | 70 import("//build/config/android/rules.gni") |
70 | 71 |
71 _use_raw_android_executable = defined(invoker.use_raw_android_executable) && | 72 _use_raw_android_executable = defined(invoker.use_raw_android_executable) && |
72 invoker.use_raw_android_executable | 73 invoker.use_raw_android_executable |
73 | 74 |
74 # output_name is used to allow targets with the same name but in different | 75 # output_name is used to allow targets with the same name but in different |
75 # packages to still produce unique runner scripts. | 76 # packages to still produce unique runner scripts. |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 } | 154 } |
154 } | 155 } |
155 } else { | 156 } else { |
156 _library_target = "_${target_name}__library" | 157 _library_target = "_${target_name}__library" |
157 _apk_target = "${target_name}_apk" | 158 _apk_target = "${target_name}_apk" |
158 _apk_specific_vars = [ | 159 _apk_specific_vars = [ |
159 "android_manifest", | 160 "android_manifest", |
160 "enable_multidex", | 161 "enable_multidex", |
161 "use_default_launcher", | 162 "use_default_launcher", |
162 "write_asset_list", | 163 "write_asset_list", |
| 164 "use_native_activity", |
163 ] | 165 ] |
164 shared_library(_library_target) { | 166 shared_library(_library_target) { |
165 # Configs will always be defined since we set_defaults in BUILDCONFIG.gn
. | 167 # Configs will always be defined since we set_defaults in BUILDCONFIG.gn
. |
166 configs = [] # Prevent list overwriting warning. | 168 configs = [] # Prevent list overwriting warning. |
167 configs = invoker.configs | 169 configs = invoker.configs |
168 testonly = true | 170 testonly = true |
169 | 171 |
170 deps = [] | 172 deps = [] |
171 forward_variables_from(invoker, | 173 forward_variables_from(invoker, |
172 "*", | 174 "*", |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 if (defined(invoker.output_name) && target_name != invoker.output_name) { | 343 if (defined(invoker.output_name) && target_name != invoker.output_name) { |
342 group("${invoker.output_name}_run") { | 344 group("${invoker.output_name}_run") { |
343 testonly = true | 345 testonly = true |
344 deps = [ | 346 deps = [ |
345 ":${invoker.target_name}", | 347 ":${invoker.target_name}", |
346 ] | 348 ] |
347 } | 349 } |
348 } | 350 } |
349 } | 351 } |
350 } | 352 } |
OLD | NEW |