| Index: components/cronet/tools/cr_cronet.py
|
| diff --git a/components/cronet/tools/cr_cronet.py b/components/cronet/tools/cr_cronet.py
|
| index 56cc74ee4d0cbd96572cd050292e1d976835f0e0..4c84a3ec4703f5ac33cab58ffb6ee36fea8dafdf 100755
|
| --- a/components/cronet/tools/cr_cronet.py
|
| +++ b/components/cronet/tools/cr_cronet.py
|
| @@ -11,6 +11,14 @@ import argparse
|
| import os
|
| import sys
|
|
|
| +target_os = 'android'
|
| +test_target = 'cronet_test_instrumentation_apk'
|
| +out_dir_suffix = ''
|
| +
|
| +if (sys.platform == 'darwin'):
|
| + target_os = 'ios'
|
| + test_target = 'cronet_test'
|
| + out_dir_suffix = '-iphonesimulator'
|
|
|
| def run(command, extra_options=''):
|
| command = command + ' ' + extra_options
|
| @@ -19,7 +27,7 @@ def run(command, extra_options=''):
|
|
|
|
|
| def build(out_dir, extra_options=''):
|
| - return run('ninja -C ' + out_dir + ' cronet_test_instrumentation_apk',
|
| + return run('ninja -C ' + out_dir + ' ' + test_target,
|
| extra_options)
|
|
|
|
|
| @@ -34,6 +42,8 @@ def test(release_arg, extra_options):
|
| ' --fast-local-dev',
|
| extra_options)
|
|
|
| +def test_ios(out_dir, extra_options):
|
| + return run(out_dir + '/iossim ' + out_dir + '/cronet_test.app', extra_options)
|
|
|
| def debug(extra_options):
|
| return run('build/android/adb_gdb --start ' + \
|
| @@ -76,7 +86,7 @@ def main():
|
| 'disable_file_support=true disable_ftp_support=true '+ \
|
| 'use_errorprone_java_compiler=true use_platform_icu_alternatives=true '+ \
|
| 'disable_brotli_filter=true'
|
| - out_dir = 'out/Debug'
|
| + out_dir = 'out/Debug' + out_dir_suffix
|
| release_arg = ''
|
| extra_options = ' '.join(extra_options_list)
|
| if options.release:
|
| @@ -96,8 +106,10 @@ def main():
|
| return install(release_arg)
|
| if (options.command=='proguard'):
|
| return run ('ninja -C ' + out_dir + ' cronet_sample_proguard_apk')
|
| - if (options.command=='test'):
|
| + if (options.command=='test' and target_os == 'android'):
|
| return install(release_arg) or test(release_arg, extra_options)
|
| + if (options.command=='test' and target_os == 'ios'):
|
| + return test_ios(out_dir, extra_options)
|
| if (options.command=='build-test'):
|
| return build(out_dir) or install(release_arg) or \
|
| test(release_arg, extra_options)
|
|
|