# -*- python -*- # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Test loading a NaCl-enabled Chrome Extension. This also covers parts # of {ppb,ppp}_instance interfaces that are not testable any other way. # The extension registers the nacl module as a content handler for foo/bar. Import('env') env.Prepend(CPPDEFINES=['XP_UNIX']) env.Replace(TEST_DIR='${SOURCE_ROOT}/ppapi/native_client/tests/ppapi_browser/' + 'extension_mime_handler') nexe = env.ProgramNameForNmf('ppapi_extension_mime_handler') env.ComponentProgram( nexe, ['ppapi_extension_mime_handler.cc'], EXTRA_LIBS=['ppapi', 'ppapi_test_lib', 'pthread', 'platform', 'gio']) # Copy the extension into place (as a subdir in the staging dir). dest_copy = env.Replicate('$STAGING_DIR/ppapi_extension_mime_handler', ['manifest.json', env.File('$STAGING_DIR/' + nexe + '$PROGSUFFIX')]) dest_copy.append(env.CopyLibsForExtension( '$STAGING_DIR/ppapi_extension_mime_handler', '$STAGING_DIR/ppapi_extension_mime_handler.nmf')) env.Depends(env.Alias(nexe), dest_copy) # Publish the html and dat. env.Publish(nexe, 'run', ['ppapi_extension_mime_handler.html', 'mime_test_data.dat']) node = env.PPAPIBrowserTester('ppapi_extension_mime_handler.out', url='ppapi_extension_mime_handler.html', nmfs=['${TEST_DIR}/ppapi_extension_mime_handler.nmf'], extensions=[env.Dir('$STAGING_DIR/ppapi_extension_mime_handler')], mime_types=[('dat', 'foo/bar')], files=env.ExtractPublishedFiles(nexe)) env.Depends(node, dest_copy) env.AddNodeToTestSuite(node, ['chrome_browser_tests'], 'run_ppapi_extension_mime_handler_browser_test', is_broken=env.PPAPIBrowserTesterIsBroken())