blob: 1a50a2bce3a0e0395272297478c09ac6478a31c9 [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',
justincohen732d3982016-04-26 13:10:4569 ],
baxleyb04c9f32016-05-13 23:35:5670 'actions': [{
71 'action_name': 'copy_test_data',
72 'variables': {
73 'test_data_files': [
74 '../../ios/web/shell/test/http_server_files',
75 ],
76 # Files are copied to .app/<test_data_prefix>/<test_data_files>.
77 # Since the test_data_files are two levels up, the test_data_prefix
78 # needs to be two levels deep so the files end up in the .app bundle
79 # and not in some parent directory. In other words, this will resolve
80 # to: .app/ios/web/../../ios/web/shell/test/http_server_files.
81 'test_data_prefix': 'ios/web',
82 },
83 'includes': [ '../../build/copy_test_data_ios.gypi' ],
84 }],
85
justincohen732d3982016-04-26 13:10:4586 'postbuilds': [
justincohenfe083b32016-03-26 00:03:0987 {
justincohen732d3982016-04-26 13:10:4588 'postbuild_name': 'Copy OCHamcrest to TEST_HOST',
89 'action': [
90 'ditto',
91 '${BUILT_PRODUCTS_DIR}/OCHamcrest.framework',
92 '${BUILT_PRODUCTS_DIR}/<(_target_name).app/Frameworks/OCHamcrest.framework',
justincohenfe083b32016-03-26 00:03:0993 ],
justincohen732d3982016-04-26 13:10:4594 },
95 {
96 'postbuild_name': 'Copy EarlGrey to TEST_HOST',
97 'action': [
98 'ditto',
99 '${BUILT_PRODUCTS_DIR}/EarlGrey.framework',
100 '${BUILT_PRODUCTS_DIR}/<(_target_name).app/Frameworks/EarlGrey.framework',
justincohenfe083b32016-03-26 00:03:09101 ],
justincohenfe083b32016-03-26 00:03:09102 },
103 ],
justincohen732d3982016-04-26 13:10:45104 },
baxley66c47ac2016-04-26 18:59:46105 {
106 # TODO(crbug.com/606815): Refactor out code that is common across Chrome
107 # and the web shell.
sdefresnecdf365d2016-07-22 14:53:48108 # GN version: //ios/web/shell/test:earl_grey_test_support
baxley695a50d2016-05-05 23:33:25109 'target_name': 'ios_web_shell_earl_grey_test_support',
baxley66c47ac2016-04-26 18:59:46110 'type': 'static_library',
111 'dependencies': [
112 '<(DEPTH)/ios/third_party/earl_grey/earl_grey.gyp:EarlGrey',
baxleyd7fe10f2016-05-18 14:39:52113 'ios_web.gyp:ios_web_earl_grey_test_support',
baxley95d6dcd52016-05-09 20:59:27114 '../testing/earl_grey/earl_grey_support.gyp:earl_grey_support',
baxley66c47ac2016-04-26 18:59:46115 ],
116 'sources': [
baxleyd7fe10f2016-05-18 14:39:52117 'shell/test/app/navigation_test_util.h',
118 'shell/test/app/navigation_test_util.mm',
baxley695a50d2016-05-05 23:33:25119 'shell/test/app/web_shell_test_util.h',
120 'shell/test/app/web_shell_test_util.mm',
baxleyd7fe10f2016-05-18 14:39:52121 'shell/test/app/web_view_interaction_test_util.h',
122 'shell/test/app/web_view_interaction_test_util.mm',
baxley62b50562016-07-21 23:10:02123 'shell/test/earl_grey/shell_base_test_case.h',
124 'shell/test/earl_grey/shell_base_test_case.mm',
baxley695a50d2016-05-05 23:33:25125 'shell/test/earl_grey/shell_matchers.h',
126 'shell/test/earl_grey/shell_matchers.mm',
baxley66c47ac2016-04-26 18:59:46127 ],
128 },
justincohenfe083b32016-03-26 00:03:09129 ],
130}