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.
6 # Tests fatal errors that occur during loading.
7 # (See ppapi_browser/crash for fatal errors that occur after loading).
8 # TODO(polina): rename the directory and browser test to bad_load
10 # Manual testing with localhost:5103/scons-out/.../staging/ppapi_bad.html:
11 # scons --mode=nacl ppapi_bad
13 # scons run_ppapi_bad_browser_test
18 # TODO(robertm): those should not be necessary once we go -std=c99
19 env.FilterOut(CFLAGS=['-pedantic'])
20 env.FilterOut(CCFLAGS=['-pedantic'])
21 env.Replace(TEST_DIR='${SOURCE_ROOT}/ppapi/native_client/tests/ppapi_browser/' +
27 'ppapi_bad_crossorigin.nmf',
28 'ppapi_bad_doesnotexist.nmf',
29 'ppapi_bad_magic.nmf',
30 'ppapi_bad_manifest_uses_nexes.nmf',
31 'ppapi_bad_manifest_bad_files.nmf',
32 'ppapi_bad_manifest_nexe_arch.nmf',
33 env.File('${SCONSTRUCT_DIR}/tools/browser_tester/browserdata/nacltest.js')
35 ppapi_bad = env.Replicate('${STAGING_DIR}', ppapi_bad_files)
38 # Compile all nexes embedded into the above html
39 # TODO(bbudge) Re-enable tests as the IPC proxy gets equivalent error reporting
40 # or delete them after the proxy switch if they're specific to SRPC.
41 # http://crbug.com/160076
42 for kind in [ 'ppp_initialize', 'ppp_initialize_crash',
43 'no_ppp_instance', 'get_ppp_instance_crash',
44 #'get_ppp_messaging_crash', 'get_ppp_printing_crash',
45 'ppp_instance_didcreate', 'ppp_instance_didcreate_crash',
48 bad_nmf = 'ppapi_bad_%s' % kind
49 bad_nexe = env.ProgramNameForNmf('ppapi_bad_%s' % kind)
50 env.ComponentProgram(bad_nexe,
51 ['ppapi_bad_%s.cc' % kind],
56 nmf_names.append(bad_nmf)
57 ppapi_bad_files.extend(env.ExtractPublishedFiles(bad_nexe))
58 env.Depends(ppapi_bad, env.Alias(bad_nexe))
60 # "scons --mode=nacl ppapi_bad" will publish the html and all of its
61 # dependencies to scons-out.
62 env.Alias('ppapi_bad', ppapi_bad)
64 node = env.PPAPIBrowserTester(
65 'ppapi_bad_browser_test.out',
68 test_args=[('is_pnacl', int(env.Bit('pnacl_generate_pexe')))],
69 files=[env.File(f) for f in ppapi_bad_files],
72 # This test is failing on Windows:
74 # This test is failing on Valgrind because of multiple nexes.
75 env.AddNodeToTestSuite(node,
76 ['chrome_browser_tests'],
77 'run_ppapi_bad_browser_test',
78 is_broken=env.PPAPIBrowserTesterIsBroken() or
79 env.Bit('host_windows') or
80 env.Bit('running_on_valgrind'))
83 # Bad nexe tests that won't work in PNaCl (native)
84 # For example, partly_invalid.nexe has inline assembly in its source files.
85 # Just bail out here for PNaCl, since the NMF will require the .nexe
87 if env.Bit('bitcode'):
90 nacltest_js = env.File('${SCONSTRUCT_DIR}/tools/browser_tester/browserdata/' +
92 partly_invalid = env.File('${STAGING_DIR}/partly_invalid${PROGSUFFIX}')
93 nmf = '${TEST_DIR}/partly_invalid.nmf'
94 if not env.Bit('nacl_glibc'):
95 ppapi_bad_native_files = [
96 env.File('ppapi_bad_native.html'),
97 env.File('${SCONSTRUCT_DIR}/tests/ppapi_browser/' +
98 'progress_event_listener.js'),
100 replicated_files = env.Replicate('${STAGING_DIR}', ppapi_bad_native_files)
101 env.Alias('all_programs', replicated_files)
102 ppapi_bad_native_files.append(partly_invalid)
104 node = env.PPAPIBrowserTester(
105 'ppapi_bad_native_test.out',
106 url='ppapi_bad_native.html',
108 files=ppapi_bad_native_files,
111 ppapi_bad_native_files = [
112 env.File('${TEST_DIR}/ppapi_bad_native_glibc.html'),
114 replicated_files = env.Replicate('${STAGING_DIR}', ppapi_bad_native_files)
115 env.Alias('all_programs', replicated_files)
116 ppapi_bad_native_files.append(partly_invalid)
118 node = env.PPAPIBrowserTester(
119 'ppapi_bad_native_test.out',
120 url='ppapi_bad_native_glibc.html',
122 files=ppapi_bad_native_files,
124 'file': '${TARGET_ROOT}/test_results/ppapi_bad_native_test.log',
125 'golden': '${TEST_DIR}/ppapi_bad_native_glibc.stderr'}
128 env.AddNodeToTestSuite(node,
129 ['chrome_browser_tests'],
130 'run_ppapi_bad_native_test',
131 is_broken=env.PPAPIBrowserTesterIsBroken())