1 # 2 # Copyright (C) 2011 Google Inc. All rights reserved. 3 # 4 # Redistribution and use in source and binary forms, with or without 5 # modification, are permitted provided that the following conditions are 6 # met: 7 # 8 # * Redistributions of source code must retain the above copyright 9 # notice, this list of conditions and the following disclaimer. 10 # * Redistributions in binary form must reproduce the above 11 # copyright notice, this list of conditions and the following disclaimer 12 # in the documentation and/or other materials provided with the 13 # distribution. 14 # * Neither the name of Google Inc. nor the names of its 15 # contributors may be used to endorse or promote products derived from 16 # this software without specific prior written permission. 17 # 18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 # 30 31 { 32 'includes': [ 33 '../bindings/bindings.gypi', 34 '../build/features.gypi', 35 '../build/scripts/scripts.gypi', 36 '../core/core.gypi', 37 '../modules/modules.gypi', 38 '../platform/blink_platform.gypi', 39 '../web/web.gypi', 40 '../wtf/wtf.gypi', 41 ], 42 'targets': [ 43 { 44 # GN version: //third_party/WebKit/Source/web:webkit_unit_tests 45 'target_name': 'webkit_unit_tests', 46 'type': 'executable', 47 'variables': { 'enable_wexit_time_destructors': 1, }, 48 'dependencies': [ 49 '../../public/blink.gyp:blink', 50 '../config.gyp:unittest_config', 51 '../wtf/wtf_tests.gyp:wtf_unittest_helpers', 52 'web.gyp:blink_web_test_support', 53 '<(DEPTH)/base/base.gyp:base', 54 '<(DEPTH)/base/base.gyp:base_i18n', 55 '<(DEPTH)/base/base.gyp:test_support_base', 56 '<(DEPTH)/testing/gmock.gyp:gmock', 57 '<(DEPTH)/testing/gtest.gyp:gtest', 58 '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp', 59 '<(DEPTH)/third_party/zlib/zlib.gyp:zlib', 60 '<(DEPTH)/url/url.gyp:url_lib', 61 '<(DEPTH)/v8/tools/gyp/v8.gyp:v8', 62 '<(DEPTH)/content/content_shell_and_tests.gyp:test_support_content', 63 ], 64 'sources': [ 65 '../web/tests/RunAllTests.cpp', 66 ], 67 'include_dirs': [ 68 '../../public/web', 69 '../web', 70 'src', 71 ], 72 'conditions': [ 73 ['component!="shared_library"', { 74 'dependencies': [ 75 '../core/core.gyp:webcore', 76 ], 77 'defines': [ 78 'BLINK_IMPLEMENTATION=1', 79 'INSIDE_BLINK', 80 ], 81 'sources': [ 82 '<@(bindings_unittest_files)', 83 '<@(core_unittest_files)', 84 '<@(modules_unittest_files)', 85 '<@(platform_web_unittest_files)', 86 '<@(web_unittest_files)', 87 ], 88 }], 89 ['OS=="win" and component!="shared_library"', { 90 'configurations': { 91 'Debug_Base': { 92 'msvs_settings': { 93 'VCLinkerTool': { 94 'LinkIncremental': '<(msvs_large_module_debug_link_mode)', 95 }, 96 }, 97 }, 98 }, 99 'conditions': [ 100 ['win_use_allocator_shim==1', { 101 'dependencies': [ 102 '<(DEPTH)/base/allocator/allocator.gyp:allocator', 103 ], 104 }], 105 ], 106 }], 107 ['OS=="android"', { 108 'type': 'shared_library', 109 'dependencies': [ 110 '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code', 111 '<(DEPTH)/tools/android/forwarder2/forwarder.gyp:forwarder2', 112 ], 113 }], 114 ['OS=="mac"', { 115 'include_dirs': [ 116 '../../public/web/mac', 117 ], 118 }], 119 [ 'os_posix==1 and OS!="mac" and OS!="android" and OS!="ios" and use_allocator!="none"', { 120 'dependencies': [ 121 '<(DEPTH)/base/allocator/allocator.gyp:allocator', 122 ], 123 }], 124 ], 125 } 126 ], # targets 127 'conditions': [ 128 ['gcc_version>=46', { 129 'target_defaults': { 130 # Disable warnings about c++0x compatibility, as some names (such 131 # as nullptr) conflict with upcoming c++0x types. 132 'cflags_cc': ['-Wno-c++0x-compat'], 133 }, 134 }], 135 ['OS=="android" and android_webview_build==0 and gtest_target_type == "shared_library"', { 136 # Wrap libwebkit_unit_tests.so into an android apk for execution. 137 'targets': [{ 138 'target_name': 'webkit_unit_tests_apk', 139 'type': 'none', 140 'dependencies': [ 141 '<(DEPTH)/base/base.gyp:base_java', 142 '<(DEPTH)/net/net.gyp:net_java', 143 'webkit_unit_tests', 144 ], 145 'variables': { 146 'test_suite_name': 'webkit_unit_tests', 147 'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)webkit_unit_tests<(SHARED_LIB_SUFFIX)', 148 'additional_input_paths': ['<(PRODUCT_DIR)/content_shell/assets/content_shell.pak'], 149 'asset_location': '<(PRODUCT_DIR)/content_shell/assets', 150 }, 151 'includes': [ '../../../../build/apk_test.gypi' ], 152 }], 153 }], 154 ], 155 } 156