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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 "proguard_configs", | 162 "proguard_configs", |
162 "proguard_enabled", | 163 "proguard_enabled", |
163 "use_default_launcher", | 164 "use_default_launcher", |
164 "write_asset_list", | 165 "write_asset_list", |
| 166 "use_native_activity", |
165 ] | 167 ] |
166 shared_library(_library_target) { | 168 shared_library(_library_target) { |
167 # Configs will always be defined since we set_defaults in BUILDCONFIG.gn
. | 169 # Configs will always be defined since we set_defaults in BUILDCONFIG.gn
. |
168 configs = [] # Prevent list overwriting warning. | 170 configs = [] # Prevent list overwriting warning. |
169 configs = invoker.configs | 171 configs = invoker.configs |
170 testonly = true | 172 testonly = true |
171 | 173 |
172 deps = [] | 174 deps = [] |
173 forward_variables_from(invoker, | 175 forward_variables_from(invoker, |
174 "*", | 176 "*", |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 if (defined(invoker.output_name) && target_name != invoker.output_name) { | 345 if (defined(invoker.output_name) && target_name != invoker.output_name) { |
344 group("${invoker.output_name}_run") { | 346 group("${invoker.output_name}_run") { |
345 testonly = true | 347 testonly = true |
346 deps = [ | 348 deps = [ |
347 ":${invoker.target_name}", | 349 ":${invoker.target_name}", |
348 ] | 350 ] |
349 } | 351 } |
350 } | 352 } |
351 } | 353 } |
352 } | 354 } |
OLD | NEW |