blob: e67b0d83c282f261d466dceb9c622366183b99cb [file] [log] [blame]
justincohenfe083b32016-03-26 00:03:091# Copyright 2016 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5{
6 'variables': {
7 'chromium_code': 1,
8 },
justincohen732d3982016-04-26 13:10:459 'targets': [
10 {
sdefresnecdf365d2016-07-22 14:53:4811 # GN version: //ios/web/shell/test:ios_web_shell_test
justincohen732d3982016-04-26 13:10:4512 'target_name': 'ios_web_shell_test',
13 'type': 'loadable_module',
14 'mac_xctest_bundle': 1,
15 'variables': {
16 'test_host': '<(_target_name)_host',
17 },
18 'dependencies': [
19 '<(test_host)',
20 ],
21 'xcode_settings': {
22 'WRAPPER_EXTENSION': 'xctest',
23 'TEST_HOST': '${BUILT_PRODUCTS_DIR}/<(test_host).app/<(test_host)',
24 'BUNDLE_LOADER': '$(TEST_HOST)',
25 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
26 'INFOPLIST_FILE': 'shell/test/Module-Info.plist',
27 'OTHER_LDFLAGS': [
28 '-bundle_loader <(test_host).app/<(test_host)',
29 ],
30 },
31 'sources': [
32 'shell/test/shell_test.mm',
33 ],
34 'link_settings': {
35 'libraries': [
36 'Foundation.framework',
37 'XCTest.framework',
38 ],
39 },
40 },
41 {
42 # Create a test host for earl grey tests, so Xcode 7.3 and above
43 # doesn't contaminate the app structure.
sdefresnecdf365d2016-07-22 14:53:4844 # GN version: //ios/web/shell/test:ios_web_shell_test_host
justincohen732d3982016-04-26 13:10:4545 'target_name': 'ios_web_shell_test_host',
46 'includes': [
47 'ios_web_shell_exe.gypi',
48 ],
49 'link_settings': {
50 'libraries': [
51 'XCTest.framework',
52 ],
53 },
54 'xcode_settings': {
55 'INFOPLIST_FILE': 'shell/test/Host-Info.plist',
justincohen9b3a5c8e2016-04-28 13:30:2456 'OTHER_LDFLAGS': [
57 '-Xlinker', '-rpath', '-Xlinker', '@executable_path/Frameworks',
58 '-Xlinker', '-rpath', '-Xlinker', '@loader_path/Frameworks'
59 ]
justincohen732d3982016-04-26 13:10:4560 },
61 'dependencies': [
baxley695a50d2016-05-05 23:33:2562 'ios_web_shell_earl_grey_test_support',
baxleyd7fe10f2016-05-18 14:39:5263 '<(DEPTH)/ios/third_party/earl_grey/earl_grey.gyp:EarlGrey',
justincohen732d3982016-04-26 13:10:4564 ],
65 'sources': [
eugenebut2b43f1202016-07-23 01:13:1666 'shell/test/meta_tags_egtest.mm',
eugenebut8f3e3352016-07-22 20:28:3867 'shell/test/navigation_egtest.mm',
68 'shell/test/page_state_egtest.mm',
eugenebut429d8cd2016-07-27 22:50:1369 'shell/test/pdf_egtest.mm',
eugenebut12fd3602016-07-27 01:42:4270 'shell/test/plugin_placeholder_egtest.mm',
eugenebuta2c63c62016-07-29 00:38:3771 'shell/test/redirect_egtest.mm',
justincohen732d3982016-04-26 13:10:4572 ],
baxleyb04c9f32016-05-13 23:35:5673 'actions': [{
74 'action_name': 'copy_test_data',
75 'variables': {
76 'test_data_files': [
77 '../../ios/web/shell/test/http_server_files',
78 ],
79 # Files are copied to .app/<test_data_prefix>/<test_data_files>.
80 # Since the test_data_files are two levels up, the test_data_prefix
81 # needs to be two levels deep so the files end up in the .app bundle
82 # and not in some parent directory. In other words, this will resolve
83 # to: .app/ios/web/../../ios/web/shell/test/http_server_files.
84 'test_data_prefix': 'ios/web',
85 },
86 'includes': [ '../../build/copy_test_data_ios.gypi' ],
87 }],
88
justincohen732d3982016-04-26 13:10:4589 'postbuilds': [
justincohenfe083b32016-03-26 00:03:0990 {
justincohen732d3982016-04-26 13:10:4591 'postbuild_name': 'Copy OCHamcrest to TEST_HOST',
92 'action': [
93 'ditto',
94 '${BUILT_PRODUCTS_DIR}/OCHamcrest.framework',
95 '${BUILT_PRODUCTS_DIR}/<(_target_name).app/Frameworks/OCHamcrest.framework',
justincohenfe083b32016-03-26 00:03:0996 ],
justincohen732d3982016-04-26 13:10:4597 },
98 {
99 'postbuild_name': 'Copy EarlGrey to TEST_HOST',
100 'action': [
101 'ditto',
102 '${BUILT_PRODUCTS_DIR}/EarlGrey.framework',
103 '${BUILT_PRODUCTS_DIR}/<(_target_name).app/Frameworks/EarlGrey.framework',
justincohenfe083b32016-03-26 00:03:09104 ],
justincohenfe083b32016-03-26 00:03:09105 },
106 ],
justincohen732d3982016-04-26 13:10:45107 },
baxley66c47ac2016-04-26 18:59:46108 {
109 # TODO(crbug.com/606815): Refactor out code that is common across Chrome
110 # and the web shell.
sdefresnecdf365d2016-07-22 14:53:48111 # GN version: //ios/web/shell/test:earl_grey_test_support
baxley695a50d2016-05-05 23:33:25112 'target_name': 'ios_web_shell_earl_grey_test_support',
baxley66c47ac2016-04-26 18:59:46113 'type': 'static_library',
114 'dependencies': [
115 '<(DEPTH)/ios/third_party/earl_grey/earl_grey.gyp:EarlGrey',
baxleyd7fe10f2016-05-18 14:39:52116 'ios_web.gyp:ios_web_earl_grey_test_support',
baxley95d6dcd52016-05-09 20:59:27117 '../testing/earl_grey/earl_grey_support.gyp:earl_grey_support',
baxley66c47ac2016-04-26 18:59:46118 ],
119 'sources': [
baxleyd7fe10f2016-05-18 14:39:52120 'shell/test/app/navigation_test_util.h',
121 'shell/test/app/navigation_test_util.mm',
baxley695a50d2016-05-05 23:33:25122 'shell/test/app/web_shell_test_util.h',
123 'shell/test/app/web_shell_test_util.mm',
baxleyd7fe10f2016-05-18 14:39:52124 'shell/test/app/web_view_interaction_test_util.h',
125 'shell/test/app/web_view_interaction_test_util.mm',
baxley62b50562016-07-21 23:10:02126 'shell/test/earl_grey/shell_base_test_case.h',
127 'shell/test/earl_grey/shell_base_test_case.mm',
baxley695a50d2016-05-05 23:33:25128 'shell/test/earl_grey/shell_matchers.h',
129 'shell/test/earl_grey/shell_matchers.mm',
baxley66c47ac2016-04-26 18:59:46130 ],
131 },
justincohenfe083b32016-03-26 00:03:09132 ],
133}