| OLD | NEW |
| 1 #! -*- python -*- | 1 #! -*- python -*- |
| 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import json | 6 import json |
| 7 import os | 7 import os |
| 8 import shutil | 8 import shutil |
| 9 import sys | 9 import sys |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 'tests/nacl_browser/manifest_file/nacl.scons', | 45 'tests/nacl_browser/manifest_file/nacl.scons', |
| 46 'tests/nacl_browser/nameservice/nacl.scons', | 46 'tests/nacl_browser/nameservice/nacl.scons', |
| 47 'tests/nacl_browser/postmessage_redir/nacl.scons', | 47 'tests/nacl_browser/postmessage_redir/nacl.scons', |
| 48 ]) | 48 ]) |
| 49 | 49 |
| 50 ppapi_scons_files['irt_variant_test_scons_files'] = ExtendFileList( | 50 ppapi_scons_files['irt_variant_test_scons_files'] = ExtendFileList( |
| 51 ppapi_scons_files.get('irt_variant_test_scons_files', []), [ | 51 ppapi_scons_files.get('irt_variant_test_scons_files', []), [ |
| 52 # Disabled by Brad Chen 4 Sep to try to green Chromium | 52 # Disabled by Brad Chen 4 Sep to try to green Chromium |
| 53 # nacl_integration tests | 53 # nacl_integration tests |
| 54 #'tests/nacl_browser/fault_injection/nacl.scons', | 54 #'tests/nacl_browser/fault_injection/nacl.scons', |
| 55 'tests/nacl.scons', | |
| 56 'tests/nacl_browser/pnacl_client_translator/nacl.scons', | 55 'tests/nacl_browser/pnacl_client_translator/nacl.scons', |
| 57 ]) | 56 ]) |
| 58 | 57 |
| 59 ppapi_scons_files['untrusted_scons_files'] = ExtendFileList( | 58 ppapi_scons_files['untrusted_scons_files'] = ExtendFileList( |
| 60 ppapi_scons_files.get('untrusted_scons_files', []), [ | 59 ppapi_scons_files.get('untrusted_scons_files', []), [ |
| 61 'src/untrusted/irt_stub/nacl.scons', | 60 'src/untrusted/irt_stub/nacl.scons', |
| 62 'src/untrusted/nacl_ppapi_util/nacl.scons', | 61 'src/untrusted/nacl_ppapi_util/nacl.scons', |
| 63 'src/untrusted/pnacl_irt_shim/nacl.scons', | 62 'src/untrusted/pnacl_irt_shim/nacl.scons', |
| 64 'src/untrusted/pnacl_support_extension/nacl.scons', | 63 'src/untrusted/pnacl_support_extension/nacl.scons', |
| 65 ]) | 64 ]) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 77 def GetHeadlessPrefix(env): | 76 def GetHeadlessPrefix(env): |
| 78 if env.Bit('browser_headless') and env.Bit('host_linux'): | 77 if env.Bit('browser_headless') and env.Bit('host_linux'): |
| 79 return ['xvfb-run', '--auto-servernum'] | 78 return ['xvfb-run', '--auto-servernum'] |
| 80 else: | 79 else: |
| 81 # Mac and Windows do not seem to have an equivalent. | 80 # Mac and Windows do not seem to have an equivalent. |
| 82 return [] | 81 return [] |
| 83 | 82 |
| 84 pre_base_env.AddMethod(GetHeadlessPrefix) | 83 pre_base_env.AddMethod(GetHeadlessPrefix) |
| 85 | 84 |
| 86 | 85 |
| 87 pre_base_env['CHROME_DOWNLOAD_DIR'] = \ | 86 # A fake file to depend on if a path to Chrome is not specified. |
| 88 pre_base_env.Dir(ARGUMENTS.get('chrome_binaries_dir', '#chromebinaries')) | 87 no_browser = pre_base_env.File('chrome_browser_path_not_specified') |
| 89 | |
| 90 def ChromeBinaryArch(env): | |
| 91 arch = env['BUILD_FULLARCH'] | |
| 92 # Currently there are no 64-bit Chrome binaries for Windows or Mac OS X. | |
| 93 if (env.Bit('host_windows') or env.Bit('host_mac')) and arch == 'x86-64': | |
| 94 arch = 'x86-32' | |
| 95 return arch | |
| 96 | |
| 97 pre_base_env.AddMethod(ChromeBinaryArch) | |
| 98 | 88 |
| 99 | 89 |
| 100 def DownloadedChromeBinary(env): | 90 # SCons attempts to run a test that depends on "no_browser", detect this at |
| 101 if env.Bit('host_linux'): | 91 # runtime and cause a build error. |
| 102 os_name = 'linux' | 92 def NoBrowserError(target, source, env): |
| 103 binary = 'chrome' | 93 print target, source, env |
| 104 elif env.Bit('host_windows'): | 94 print ("***\nYou need to specificy chrome_browser_path=... on the " + |
| 105 os_name = 'windows' | 95 "command line to run these tests.\n***\n") |
| 106 binary = 'chrome.exe' | 96 return 1 |
| 107 elif env.Bit('host_mac'): | |
| 108 os_name = 'mac' | |
| 109 binary = 'Chromium.app/Contents/MacOS/Chromium' | |
| 110 else: | |
| 111 raise Exception('Unsupported OS') | |
| 112 | 97 |
| 113 arch = env.ChromeBinaryArch() | 98 pre_base_env.Append(BUILDERS = { |
| 114 return env.File(os.path.join('${CHROME_DOWNLOAD_DIR}', | 99 'NoBrowserError': Builder(action=NoBrowserError) |
| 115 '%s_%s' % (os_name, arch), binary)) | 100 }) |
| 116 | 101 |
| 117 pre_base_env.AddMethod(DownloadedChromeBinary) | 102 pre_base_env.NoBrowserError([no_browser], []) |
| 118 | 103 |
| 119 | 104 |
| 120 def ChromeBinary(env): | 105 def ChromeBinary(env): |
| 121 if 'chrome_browser_path' in ARGUMENTS: | 106 if 'chrome_browser_path' in ARGUMENTS: |
| 122 return env.File(env.SConstructAbsPath(ARGUMENTS['chrome_browser_path'])) | 107 return env.File(env.SConstructAbsPath(ARGUMENTS['chrome_browser_path'])) |
| 123 else: | 108 else: |
| 124 return env.DownloadedChromeBinary() | 109 return no_browser |
| 125 | 110 |
| 126 pre_base_env.AddMethod(ChromeBinary) | 111 pre_base_env.AddMethod(ChromeBinary) |
| 127 | 112 |
| 128 | 113 |
| 129 def GetPPAPIPluginPath(env, allow_64bit_redirect=True): | 114 def GetPPAPIPluginPath(env, allow_64bit_redirect=True): |
| 130 if 'force_ppapi_plugin' in ARGUMENTS: | 115 if 'force_ppapi_plugin' in ARGUMENTS: |
| 131 return env.SConstructAbsPath(ARGUMENTS['force_ppapi_plugin']) | 116 return env.SConstructAbsPath(ARGUMENTS['force_ppapi_plugin']) |
| 132 if env.Bit('mac'): | 117 if env.Bit('mac'): |
| 133 fn = env.File('${STAGING_DIR}/ppNaClPlugin') | 118 fn = env.File('${STAGING_DIR}/ppNaClPlugin') |
| 134 else: | 119 else: |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 | 507 |
| 523 if python_tester_script is None: | 508 if python_tester_script is None: |
| 524 python_tester_script = env.File('${SCONSTRUCT_DIR}/tools/browser_tester' | 509 python_tester_script = env.File('${SCONSTRUCT_DIR}/tools/browser_tester' |
| 525 '/browser_tester.py') | 510 '/browser_tester.py') |
| 526 command = env.GetHeadlessPrefix() + [ | 511 command = env.GetHeadlessPrefix() + [ |
| 527 '${PYTHON}', python_tester_script, | 512 '${PYTHON}', python_tester_script, |
| 528 '--browser_path', env.ChromeBinary(), | 513 '--browser_path', env.ChromeBinary(), |
| 529 '--url', url, | 514 '--url', url, |
| 530 # Fail if there is no response for X seconds. | 515 # Fail if there is no response for X seconds. |
| 531 '--timeout', str(timeout)] | 516 '--timeout', str(timeout)] |
| 532 if not env.Bit('disable_dynamic_plugin_loading'): | |
| 533 command.extend(['--ppapi_plugin', env['TRUSTED_ENV'].GetPPAPIPluginPath()]) | |
| 534 command.extend(['--sel_ldr', env.GetSelLdr()]) | |
| 535 bootstrap, _ = env.GetBootstrap() | |
| 536 if bootstrap is not None: | |
| 537 command.extend(['--sel_ldr_bootstrap', bootstrap]) | |
| 538 if (not env.Bit('disable_dynamic_plugin_loading') or | |
| 539 env.Bit('override_chrome_irt')): | |
| 540 command.extend(['--irt_library', env.GetIrtNexe(chrome_irt=True)]) | |
| 541 for dep_file in files: | 517 for dep_file in files: |
| 542 command.extend(['--file', dep_file]) | 518 command.extend(['--file', dep_file]) |
| 543 for extension in extensions: | 519 for extension in extensions: |
| 544 command.extend(['--extension', extension]) | 520 command.extend(['--extension', extension]) |
| 545 if env.Bit('bitcode'): | 521 if env.Bit('bitcode'): |
| 546 # TODO(jvoung): remove this --extension once we have --pnacl-dir working. | 522 # TODO(jvoung): remove this --extension once we have --pnacl-dir working. |
| 547 command.extend(['--extension', env.GetPnaclExtensionNode().abspath]) | 523 command.extend(['--extension', env.GetPnaclExtensionNode().abspath]) |
| 548 # Enable the installed version of pnacl, and point to a custom install | 524 # Enable the installed version of pnacl, and point to a custom install |
| 549 # directory for testing purposes. | 525 # directory for testing purposes. |
| 550 browser_flags.append('--enable-pnacl') | 526 browser_flags.append('--enable-pnacl') |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 | 630 |
| 655 pre_base_env.AddMethod(PPAPIGraphics3DIsBroken) | 631 pre_base_env.AddMethod(PPAPIGraphics3DIsBroken) |
| 656 | 632 |
| 657 | 633 |
| 658 def AddChromeFilesFromGroup(env, file_group): | 634 def AddChromeFilesFromGroup(env, file_group): |
| 659 env['BUILD_SCONSCRIPTS'] = ExtendFileList( | 635 env['BUILD_SCONSCRIPTS'] = ExtendFileList( |
| 660 env.get('BUILD_SCONSCRIPTS', []), | 636 env.get('BUILD_SCONSCRIPTS', []), |
| 661 ppapi_scons_files[file_group]) | 637 ppapi_scons_files[file_group]) |
| 662 | 638 |
| 663 pre_base_env.AddMethod(AddChromeFilesFromGroup) | 639 pre_base_env.AddMethod(AddChromeFilesFromGroup) |
| OLD | NEW |