OLD | NEW |
1 # -*- python -*- | 1 # -*- python -*- |
2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2011 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 # Test loading a NaCl-enabled Chrome Extension. This also covers parts | 6 # Test loading a NaCl-enabled Chrome Extension. This also covers parts |
7 # of {ppb,ppp}_instance interfaces that are not testable any other way. | 7 # of {ppb,ppp}_instance interfaces that are not testable any other way. |
8 | 8 |
9 # The extension registers the nacl module as a content handler for | 9 # The extension registers the nacl module as a content handler for |
10 # application/pdf because it's easy to override that known type, but the | 10 # application/pdf because it's easy to override that known type, but the |
11 # actual file we use is a plain text file with a .pdf file extension. | 11 # actual file we use is a plain text file with a .pdf file extension. |
12 | 12 |
13 Import('env') | 13 Import('env') |
14 | 14 |
15 env.Prepend(CPPDEFINES=['XP_UNIX']) | 15 env.Prepend(CPPDEFINES=['XP_UNIX']) |
16 env.Replace(TEST_DIR='${SOURCE_ROOT}/ppapi/native_client/tests/ppapi_browser/' + | |
17 'extension_mime_handler') | |
18 | 16 |
19 nexe = 'ppapi_extension_mime_handler_%s' % env.get('TARGET_FULLARCH') | 17 nexe = 'ppapi_extension_mime_handler_%s' % env.get('TARGET_FULLARCH') |
20 | 18 |
21 env.ComponentProgram( | 19 env.ComponentProgram( |
22 nexe, | 20 nexe, |
23 ['ppapi_extension_mime_handler.cc'], | 21 ['ppapi_extension_mime_handler.cc'], |
24 EXTRA_LIBS=['${PPAPI_LIBS}', | 22 EXTRA_LIBS=['${PPAPI_LIBS}', |
25 'ppapi_test_lib', | 23 'ppapi_test_lib', |
26 'pthread', | 24 'pthread', |
27 'platform', | 25 'platform', |
28 'gio']) | 26 'gio']) |
29 | 27 |
30 # Copy the extension into place (as a subdir in the staging dir). | 28 # Copy the extension into place (as a subdir in the staging dir). |
31 dest_copy = env.Replicate('$STAGING_DIR/ppapi_extension_mime_handler', | 29 dest_copy = env.Replicate('$STAGING_DIR/ppapi_extension_mime_handler', |
32 ['manifest.json', | 30 ['ppapi_extension_mime_handler.nmf', |
| 31 'manifest.json', |
33 env.File('$STAGING_DIR/' + nexe + '$PROGSUFFIX')]) | 32 env.File('$STAGING_DIR/' + nexe + '$PROGSUFFIX')]) |
34 dest_copy.append(env.CopyLibsForExtension( | |
35 '$STAGING_DIR/ppapi_extension_mime_handler', | |
36 '$STAGING_DIR/ppapi_extension_mime_handler.nmf')) | |
37 | 33 |
38 env.Depends(env.Alias(nexe), dest_copy) | 34 env.Depends(env.Alias(nexe), dest_copy) |
39 | 35 |
40 # Publish the html,js, and pdf. | 36 # Publish the html,js, and pdf. |
41 env.Publish(nexe, 'run', | 37 env.Publish(nexe, 'run', |
42 ['ppapi_extension_mime_handler.html', | 38 ['ppapi_extension_mime_handler.html', |
43 'mime_test_data.pdf']) | 39 'mime_test_data.pdf']) |
44 | 40 |
45 node = env.PPAPIBrowserTester('ppapi_extension_mime_handler.out', | 41 node = env.PPAPIBrowserTester('ppapi_extension_mime_handler.out', |
46 url='ppapi_extension_mime_handler.html', | 42 url='ppapi_extension_mime_handler.html', |
47 nmf='${TEST_DIR}/ppapi_extension_mime_handler.nmf', | |
48 extensions=[env.Dir('$STAGING_DIR/ppapi_extension_mime_handler')], | 43 extensions=[env.Dir('$STAGING_DIR/ppapi_extension_mime_handler')], |
49 files=env.ExtractPublishedFiles(nexe)) | 44 files=env.ExtractPublishedFiles(nexe)) |
50 | 45 |
51 env.Depends(node, dest_copy) | 46 env.Depends(node, dest_copy) |
52 | 47 |
53 env.AddNodeToTestSuite(node, | 48 env.AddNodeToTestSuite(node, |
54 ['chrome_browser_tests'], | 49 ['chrome_browser_tests'], |
55 'run_ppapi_extension_mime_handler_browser_test', | 50 'run_ppapi_extension_mime_handler_browser_test', |
56 is_broken=env.PPAPIBrowserTesterIsBroken()) | 51 is_broken=env.PPAPIBrowserTesterIsBroken()) |
OLD | NEW |