# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. Import('env', 'env_res') env = env.Clone() env_res = env_res.Clone() if env['PLATFORM'] == 'win32': env_res.Append( CPPPATH = [ '.', '$CHROME_SRC_DIR', '$NET_DIR', ], RCFLAGS = [ ['/l', '0x409'], ], ) env.Append( CPPPATH = [ '$BREAKPAD_DIR/src', '$WEBKIT_DIR/glue', '$GTEST_DIR/include', ], LIBS = [ 'test_shell', 'glue', 'port', 'base', 'base_gfx', 'breakpad_handler', 'googleurl', 'net', 'sdch', 'skia', 'gtest', 'bzip2', 'V8Bindings', 'WebCore', 'WTF', env['ICU_LIBS'], # TODO(sgk): '$ICU_LIBS' when scons is fixed 'libjpeg', 'libpng', 'libxml', 'libxslt', 'modp_b64', 'zlib', 'sqlite', 'v8', 'JavaScriptCore_pcre', 'default_plugin', ], ) if env['PLATFORM'] == 'win32': # TODO(port): put portable libs in above declaration. env.Append( LIBS = [ 'activex_shim', 'breakpad_sender', ] ) if env['PLATFORM'] == 'win32': env.Append( LIBS = [ 'comctl32.lib', 'rpcrt4.lib', 'shlwapi.lib', 'winmm.lib', ], LINKFLAGS = [ '/DELAYLOAD:"ws2_32.dll"', '/DELAYLOAD:"dwmapi.dll"', '/DELAYLOAD:"uxtheme.dll"', '/FIXED:No', '/SUBSYSTEM:CONSOLE', '/MACHINE:X86', '/safeseh', '/dynamicbase', '/ignore:4199', '/nxcompat', ], ) elif env['PLATFORM'] in ('posix', 'darwin'): env.Append( LIBS = [ 'event', ] ) input_files = [ 'event_sending_controller.cc', 'layout_test_controller.cc', 'simple_resource_loader_bridge.cc', 'test_navigation_controller.cc', 'test_shell_request_context.cc', 'test_shell_switches.cc', 'test_shell.cc', 'text_input_controller.cc', ] if env['PLATFORM'] == 'win32': # TODO(port): put portable files in above test_files declaration. input_files.extend([ 'drag_delegate.cc', 'drop_delegate.cc', 'test_shell_win.cc', 'test_webview_delegate.cc', 'webview_host.cc', 'webwidget_host.cc', ]) elif env['PLATFORM'] == 'posix': input_files.extend([ 'gtk/webwidget_host.cc', 'gtk/webview_host.cc', 'gtk/test_webview_delegate.cc', 'test_shell_gtk.cc', ]) lib = env.ChromeStaticLibrary('test_shell', input_files) resources = [] exe_input_files = [] if env['PLATFORM'] == 'win32': # TODO(port): figure out what to do with resources. resources = [ env_res.RES('resources/test_shell.rc'), '$NET_DIR/net_resources.res', '$WEBKIT_DIR/build/localized_strings/webkit_strings_en-US.res', ] exe_input_files = [ 'test_shell_main.cc', '$V8_DIR/snapshot-empty$OBJSUFFIX' ] elif env['PLATFORM'] == 'posix': exe_input_files = [ 'test_shell_main_gtk.cc', ] test_shell = env.ChromeProgram('test_shell', resources + exe_input_files) i = env.Install('$TARGET_ROOT', test_shell) env.Alias('webkit', i) if env['PLATFORM'] == 'win32': env.Depends(test_shell, '$V8_DIR/vc80.pdb') test_files = [ 'image_decoder_unittest.cc', 'keyboard_unittest.cc', 'layout_test_controller_unittest.cc', 'run_all_tests.cc', 'test_shell_test.cc', '$WEBKIT_DIR/glue/autocomplete_input_listener_unittest.cc', '$WEBKIT_DIR/glue/cpp_bound_class_unittest.cc', '$WEBKIT_DIR/glue/cpp_variant_unittest.cc', '$WEBKIT_DIR/glue/glue_serialize_unittest.cc', '$WEBKIT_DIR/glue/multipart_response_delegate_unittest.cc', '$WEBKIT_DIR/glue/password_autocomplete_listener_unittest.cc', '$WEBKIT_DIR/glue/regular_expression_unittest.cc', '$WEBKIT_DIR/glue/webframe_unittest.cc', '$WEBKIT_DIR/port/platform/GKURL_unittest.cpp', '$V8_DIR/snapshot-empty$OBJSUFFIX', ] if env['PLATFORM'] == 'win32': # TODO(port): put portable files in above test_files declaration. test_files.extend([ 'node_leak_test.cc', 'plugin_tests.cc', 'text_input_controller_unittest.cc', '$WEBKIT_DIR/glue/bookmarklet_unittest.cc', '$WEBKIT_DIR/glue/context_menu_unittest.cc', '$WEBKIT_DIR/glue/dom_operations_unittest.cc', '$WEBKIT_DIR/glue/dom_serializer_unittest.cc', '$WEBKIT_DIR/glue/iframe_redirect_unittest.cc', '$WEBKIT_DIR/glue/mimetype_unittest.cc', '$WEBKIT_DIR/glue/resource_fetcher_unittest.cc', # Commented out until a regression is fixed and this file is restored. #'$WEBKIT_DIR/glue/stringimpl_unittest.cc', '$WEBKIT_DIR/glue/webplugin_impl_unittest.cc', '$WEBKIT_DIR/port/platform/image-decoders/bmp/BMPImageDecoder_unittest.cpp', '$WEBKIT_DIR/port/platform/image-decoders/ico/ICOImageDecoder_unittest.cpp', '$WEBKIT_DIR/port/platform/image-decoders/xbm/XBMImageDecoder_unittest.cpp', ]) test_shell_tests = env.ChromeTestProgram('test_shell_tests', resources + test_files) i = env.Install('$TARGET_ROOT', test_shell_tests) env.Alias('webkit', i)