justincohen | fe083b3 | 2016-03-26 00:03:09 | [diff] [blame] | 1 | # 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 | }, |
justincohen | 732d398 | 2016-04-26 13:10:45 | [diff] [blame] | 9 | 'targets': [ |
| 10 | { |
sdefresne | cdf365d | 2016-07-22 14:53:48 | [diff] [blame] | 11 | # GN version: //ios/web/shell/test:ios_web_shell_test |
justincohen | 732d398 | 2016-04-26 13:10:45 | [diff] [blame] | 12 | '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. |
sdefresne | cdf365d | 2016-07-22 14:53:48 | [diff] [blame] | 44 | # GN version: //ios/web/shell/test:ios_web_shell_test_host |
justincohen | 732d398 | 2016-04-26 13:10:45 | [diff] [blame] | 45 | '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', |
justincohen | 9b3a5c8e | 2016-04-28 13:30:24 | [diff] [blame] | 56 | 'OTHER_LDFLAGS': [ |
| 57 | '-Xlinker', '-rpath', '-Xlinker', '@executable_path/Frameworks', |
| 58 | '-Xlinker', '-rpath', '-Xlinker', '@loader_path/Frameworks' |
| 59 | ] |
justincohen | 732d398 | 2016-04-26 13:10:45 | [diff] [blame] | 60 | }, |
| 61 | 'dependencies': [ |
baxley | 695a50d | 2016-05-05 23:33:25 | [diff] [blame] | 62 | 'ios_web_shell_earl_grey_test_support', |
baxley | d7fe10f | 2016-05-18 14:39:52 | [diff] [blame] | 63 | '<(DEPTH)/ios/third_party/earl_grey/earl_grey.gyp:EarlGrey', |
justincohen | 732d398 | 2016-04-26 13:10:45 | [diff] [blame] | 64 | ], |
| 65 | 'sources': [ |
eugenebut | 2b43f120 | 2016-07-23 01:13:16 | [diff] [blame] | 66 | 'shell/test/meta_tags_egtest.mm', |
eugenebut | 8f3e335 | 2016-07-22 20:28:38 | [diff] [blame] | 67 | 'shell/test/navigation_egtest.mm', |
| 68 | 'shell/test/page_state_egtest.mm', |
eugenebut | 429d8cd | 2016-07-27 22:50:13 | [diff] [blame] | 69 | 'shell/test/pdf_egtest.mm', |
eugenebut | 12fd360 | 2016-07-27 01:42:42 | [diff] [blame] | 70 | 'shell/test/plugin_placeholder_egtest.mm', |
eugenebut | a2c63c6 | 2016-07-29 00:38:37 | [diff] [blame] | 71 | 'shell/test/redirect_egtest.mm', |
justincohen | 732d398 | 2016-04-26 13:10:45 | [diff] [blame] | 72 | ], |
baxley | b04c9f3 | 2016-05-13 23:35:56 | [diff] [blame] | 73 | '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 | |
justincohen | 732d398 | 2016-04-26 13:10:45 | [diff] [blame] | 89 | 'postbuilds': [ |
justincohen | fe083b3 | 2016-03-26 00:03:09 | [diff] [blame] | 90 | { |
justincohen | 732d398 | 2016-04-26 13:10:45 | [diff] [blame] | 91 | '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', |
justincohen | fe083b3 | 2016-03-26 00:03:09 | [diff] [blame] | 96 | ], |
justincohen | 732d398 | 2016-04-26 13:10:45 | [diff] [blame] | 97 | }, |
| 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', |
justincohen | fe083b3 | 2016-03-26 00:03:09 | [diff] [blame] | 104 | ], |
justincohen | fe083b3 | 2016-03-26 00:03:09 | [diff] [blame] | 105 | }, |
| 106 | ], |
justincohen | 732d398 | 2016-04-26 13:10:45 | [diff] [blame] | 107 | }, |
baxley | 66c47ac | 2016-04-26 18:59:46 | [diff] [blame] | 108 | { |
| 109 | # TODO(crbug.com/606815): Refactor out code that is common across Chrome |
| 110 | # and the web shell. |
sdefresne | cdf365d | 2016-07-22 14:53:48 | [diff] [blame] | 111 | # GN version: //ios/web/shell/test:earl_grey_test_support |
baxley | 695a50d | 2016-05-05 23:33:25 | [diff] [blame] | 112 | 'target_name': 'ios_web_shell_earl_grey_test_support', |
baxley | 66c47ac | 2016-04-26 18:59:46 | [diff] [blame] | 113 | 'type': 'static_library', |
| 114 | 'dependencies': [ |
| 115 | '<(DEPTH)/ios/third_party/earl_grey/earl_grey.gyp:EarlGrey', |
baxley | d7fe10f | 2016-05-18 14:39:52 | [diff] [blame] | 116 | 'ios_web.gyp:ios_web_earl_grey_test_support', |
baxley | 95d6dcd5 | 2016-05-09 20:59:27 | [diff] [blame] | 117 | '../testing/earl_grey/earl_grey_support.gyp:earl_grey_support', |
baxley | 66c47ac | 2016-04-26 18:59:46 | [diff] [blame] | 118 | ], |
| 119 | 'sources': [ |
baxley | d7fe10f | 2016-05-18 14:39:52 | [diff] [blame] | 120 | 'shell/test/app/navigation_test_util.h', |
| 121 | 'shell/test/app/navigation_test_util.mm', |
baxley | 695a50d | 2016-05-05 23:33:25 | [diff] [blame] | 122 | 'shell/test/app/web_shell_test_util.h', |
| 123 | 'shell/test/app/web_shell_test_util.mm', |
baxley | d7fe10f | 2016-05-18 14:39:52 | [diff] [blame] | 124 | 'shell/test/app/web_view_interaction_test_util.h', |
| 125 | 'shell/test/app/web_view_interaction_test_util.mm', |
baxley | 62b5056 | 2016-07-21 23:10:02 | [diff] [blame] | 126 | 'shell/test/earl_grey/shell_base_test_case.h', |
| 127 | 'shell/test/earl_grey/shell_base_test_case.mm', |
baxley | 695a50d | 2016-05-05 23:33:25 | [diff] [blame] | 128 | 'shell/test/earl_grey/shell_matchers.h', |
| 129 | 'shell/test/earl_grey/shell_matchers.mm', |
baxley | 66c47ac | 2016-04-26 18:59:46 | [diff] [blame] | 130 | ], |
| 131 | }, |
justincohen | fe083b3 | 2016-03-26 00:03:09 | [diff] [blame] | 132 | ], |
| 133 | } |