1 # -*- python -*- 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 4 # found in the LICENSE file. 5 # 6 # Tests fatal errors that occur after loading. 7 # (See ppapi_browser/bad for fatal errors that occur during loading). 8 # 9 # The tests use ppapi_test_lib. 10 11 Import('env') 12 13 env.Prepend(CPPDEFINES=['XP_UNIX']) 14 env.Replace( 15 TEST_DIR='${SOURCE_ROOT}/ppapi/native_client/tests/ppapi_browser/crash') 16 17 crash_types = ['via_check_failure', 18 'via_exit_call', 19 'in_callback', 20 'off_main_thread', 21 'ppapi_off_main_thread'] 22 published_files = [] 23 24 nmf_names = [] 25 for crash_type in crash_types: 26 nexe = env.ProgramNameForNmf('ppapi_crash_%s' % crash_type) 27 env.Alias('ppapi_crash_%s${PROGSUFFIX}' % crash_type, 28 ['$STAGING_DIR/%s${PROGSUFFIX}' % nexe]) 29 30 env.ComponentProgram( 31 nexe, 32 ['ppapi_crash_%s.cc' % crash_type], 33 EXTRA_LIBS=['ppapi', 34 'ppapi_test_lib', 35 'platform', 36 'pthread', 37 'gio']) 38 39 # TODO(polina): follow ppapi_browser/bad nacl.scons to publish html only once 40 # and to associate all nexes and nmf files with one target that can be 41 # referenced in tests/nacl.scons. 42 nmf_names.append('ppapi_crash_%s' % crash_type) 43 env.Publish(nexe, 'run', 44 ['ppapi_crash.html']) 45 46 published_files.extend(env.ExtractPublishedFiles(nexe)) 47 48 node = env.PPAPIBrowserTester('ppapi_crash_browser_test.out', 49 url='ppapi_crash.html', 50 nmf_names=nmf_names, 51 files=published_files) 52 # This test is failing on Windows: 53 # crbug.com/98721 54 env.AddNodeToTestSuite(node, 55 ['chrome_browser_tests'], 56 'run_ppapi_crash_browser_test', 57 is_broken=env.PPAPIBrowserTesterIsBroken() or 58 env.Bit('host_windows')) 59