Commit 3edfaa5d authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

[ios] Fixes issues in the macOS and iOS WebKit builds.

- Copies the clang asan library into iOS app bundles. This library is
  pulled from WebKitTestRunnerApp.app/Frameworks.

- Updates the iOS test runner to set DYLD_LIBRARY_PATH to pick up the
  clang asan library from its copied location.

- Fixes the macOS build to stop rewriting WK_API_AVAILABLE() calls, as
  this was causing compiler errors.

BUG=None

Change-Id: Ie30b40b01d3724b0d922f0edc1c39544bc251f2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2228116
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: default avatarAli Juma <ajuma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774729}
parent 6e34e211
......@@ -147,14 +147,15 @@ class GTestsApp(object):
module = self.module_name + '_module'
# If --run-with-custom-webkit is passed as a test arg, set up
# DYLD_FRAMEWORK_PATH to load the custom webkit modules.
dyld_framework_path = self.project_path + ':'
# DYLD_FRAMEWORK_PATH and DYLD_LIBRARY_PATH to load the custom webkit
# modules.
dyld_path = self.project_path
if '--run-with-custom-webkit' in self.test_args:
if self.host_app_path:
webkit_path = os.path.join(self.host_app_path, 'WebKitFrameworks')
else:
webkit_path = os.path.join(self.test_app_path, 'WebKitFrameworks')
dyld_framework_path = dyld_framework_path + webkit_path + ':'
dyld_path = dyld_path + ':' + webkit_path
module_data = {
'TestBundlePath': self.test_app_path,
......@@ -163,10 +164,10 @@ class GTestsApp(object):
'TestingEnvironmentVariables': {
'DYLD_LIBRARY_PATH':
'%s:__PLATFORMS__/iPhoneSimulator.platform/Developer/Library' %
self.project_path,
dyld_path,
'DYLD_FRAMEWORK_PATH':
'%s:__PLATFORMS__/iPhoneSimulator.platform/'
'Developer/Library/Frameworks' % dyld_framework_path,
'Developer/Library/Frameworks' % dyld_path,
}
}
......
......@@ -99,6 +99,7 @@ if (_build_ios_webkit) {
"$_webkit_ios_out_product_dir/WebKit.framework/WebKit",
"$_webkit_ios_out_product_dir/WebKitLegacy.framework",
"$_webkit_ios_out_product_dir/WebKitLegacy.framework/WebKitLegacy",
"$_webkit_ios_out_product_dir/WebKitTestRunnerApp.app/Frameworks/libclang_rt.asan_iossim_dynamic.dylib",
"$_webkit_ios_out_product_dir/com.apple.WebKit.Networking.xpc",
"$_webkit_ios_out_product_dir/com.apple.WebKit.Networking.xpc/com.apple.WebKit.Networking.Development",
"$_webkit_ios_out_product_dir/com.apple.WebKit.Plugin.64.xpc",
......@@ -124,6 +125,7 @@ if (_build_ios_webkit) {
"$_webkit_ios_out_product_dir/WebCore.framework",
"$_webkit_ios_out_product_dir/WebKit.framework",
"$_webkit_ios_out_product_dir/WebKitLegacy.framework",
"$_webkit_ios_out_product_dir/WebKitTestRunnerApp.app/Frameworks/libclang_rt.asan_iossim_dynamic.dylib",
"$_webkit_ios_out_product_dir/com.apple.WebKit.Networking.xpc",
"$_webkit_ios_out_product_dir/com.apple.WebKit.Plugin.64.xpc",
"$_webkit_ios_out_product_dir/com.apple.WebKit.WebContent.Development.xpc",
......
......@@ -67,7 +67,8 @@ def main():
return proc.returncode
# Enable rewriting WK_API_AVAILABLE() -> API_AVAILABLE().
command.append('WK_FRAMEWORK_HEADER_POSTPROCESSING_DISABLED=NO')
if opts.ios_simulator:
command.append('WK_FRAMEWORK_HEADER_POSTPROCESSING_DISABLED=NO')
proc = subprocess.Popen(command, cwd=cwd, env=env)
proc.communicate()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment