Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: components/cronet/tools/cr_cronet.py

Issue 1858483002: Cronet for iOS with C API for GRPC support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@small
Patch Set: Make it syncable Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)

Powered by Google App Engine
This is Rietveld 408576698