- add sources.
[platform/framework/web/crosswalk.git] / src / ppapi / native_client / tests / ppapi_browser / extension_mime_handler / nacl.scons
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 # Test loading a NaCl-enabled Chrome Extension.  This also covers parts
7 # of {ppb,ppp}_instance interfaces that are not testable any other way.
8
9 # The extension registers the nacl module as a content handler for foo/bar.
10
11 Import('env')
12
13 env.Prepend(CPPDEFINES=['XP_UNIX'])
14 env.Replace(TEST_DIR='${SOURCE_ROOT}/ppapi/native_client/tests/ppapi_browser/' +
15                      'extension_mime_handler')
16
17 nexe = env.ProgramNameForNmf('ppapi_extension_mime_handler')
18
19 env.ComponentProgram(
20     nexe,
21     ['ppapi_extension_mime_handler.cc'],
22     EXTRA_LIBS=['ppapi',
23                 'ppapi_test_lib',
24                 'pthread',
25                 'platform',
26                 'gio'])
27
28 # Copy the extension into place (as a subdir in the staging dir).
29 dest_copy = env.Replicate('$STAGING_DIR/ppapi_extension_mime_handler',
30                           ['manifest.json',
31                            env.File('$STAGING_DIR/' + nexe + '$PROGSUFFIX')])
32 dest_copy.append(env.CopyLibsForExtension(
33     '$STAGING_DIR/ppapi_extension_mime_handler',
34     '$STAGING_DIR/ppapi_extension_mime_handler.nmf'))
35
36 env.Depends(env.Alias(nexe), dest_copy)
37
38 # Publish the html and dat.
39 env.Publish(nexe, 'run',
40             ['ppapi_extension_mime_handler.html',
41              'mime_test_data.dat'])
42
43 node = env.PPAPIBrowserTester('ppapi_extension_mime_handler.out',
44     url='ppapi_extension_mime_handler.html',
45     nmfs=['${TEST_DIR}/ppapi_extension_mime_handler.nmf'],
46     extensions=[env.Dir('$STAGING_DIR/ppapi_extension_mime_handler')],
47     mime_types=[('dat', 'foo/bar')],
48     files=env.ExtractPublishedFiles(nexe))
49
50 env.Depends(node, dest_copy)
51
52 env.AddNodeToTestSuite(node,
53                        ['chrome_browser_tests'],
54                        'run_ppapi_extension_mime_handler_browser_test',
55                        is_broken=env.PPAPIBrowserTesterIsBroken())