Commit f04cbe50 authored by ncbray@chromium.org's avatar ncbray@chromium.org

Port nameservice test from nacl_integration to browser_tests.

This change requires rolling the NaCl DEPS to get untrusted libraries to build correctly.

BUG=154400

Review URL: https://codereview.chromium.org/126803003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243635 0039d316-1c4b-4281-b951-d872f2087c98
parent 10d04d45
......@@ -27,7 +27,7 @@ vars = {
"chromiumos_git": "https://chromium.googlesource.com/chromiumos",
"skia_git": "https://skia.googlesource.com",
"swig_revision": "230490",
"nacl_revision": "12558",
"nacl_revision": "12586",
# After changing nacl_revision, run 'glient sync' and check native_client/DEPS
# to update other nacl_*_revision's.
"nacl_tools_revision": "12526", # native_client/DEPS: tools_rev
......
......@@ -107,6 +107,27 @@
'<(DEPTH)/native_client/tools.gyp:prep_toolchain',
],
},
{
'target_name': 'nacl_ppapi_util',
'type': 'none',
'variables': {
'nlib_target': 'libnacl_ppapi_util.a',
'nso_target': 'libnacl_ppapi_util.so',
'build_newlib': 1,
'build_glibc': 1,
'build_pnacl_newlib': 1,
'nexe_destination_dir': 'nacl_test_data',
'sources': [
# TODO(ncbray) move these files once SCons no longer depends on them.
'../../../../ppapi/native_client/src/untrusted/nacl_ppapi_util/string_buffer.cc',
'../../../../ppapi/native_client/src/untrusted/nacl_ppapi_util/nacl_ppapi_util.cc',
'../../../../ppapi/native_client/src/untrusted/nacl_ppapi_util/ppapi_srpc_main.c',
]
},
'dependencies': [
'<(DEPTH)/native_client/tools.gyp:prep_toolchain',
],
},
{
'target_name': 'ppapi_progress_events',
'type': 'none',
......@@ -457,6 +478,46 @@
'<(DEPTH)/ppapi/ppapi_untrusted.gyp:ppapi_cpp_lib',
],
},
{
'target_name': 'pm_nameservice_test',
'type': 'none',
'variables': {
'nexe_target': 'pm_nameservice_test',
'build_newlib': 1,
'build_glibc': 1,
'build_pnacl_newlib': 1,
'nexe_destination_dir': 'nacl_test_data',
'link_flags': [
'-lnacl_ppapi_util',
'-lppapi_cpp',
'-lppapi',
'-lsrpc',
'-lplatform',
'-lgio',
'-limc',
'-limc_syscalls',
'-lweak_ref',
],
'sources': [
'nameservice/pm_nameservice_test.cc',
],
'test_files': [
'nameservice/pm_nameservice_test.html',
],
},
'dependencies': [
'<(DEPTH)/native_client/tools.gyp:prep_toolchain',
'<(DEPTH)/ppapi/ppapi_untrusted.gyp:ppapi_cpp_lib',
'<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
'<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:srpc_lib',
'<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
'<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
'<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc_lib',
'<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:imc_syscalls_lib',
'<(DEPTH)/native_client/src/trusted/weak_ref/weak_ref.gyp:weak_ref_lib',
'nacl_ppapi_util',
],
},
{
'target_name': 'pnacl_error_handling_test',
'type': 'none',
......
/*
* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Copyright 2014 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
......
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can
be found in the LICENSE file.
-->
......@@ -15,19 +15,27 @@
<body>
<h1>Native Client Post Message Name Service Test</h1>
<div>
<embed id="naclModule"
name="naclModule"
width=400 height=400
src="pm_nameservice_test.nmf"
basic_tests="2"
stress_tests="0"
style="background-color:gray"
type="application/x-nacl" />
</div>
<script type="text/javascript">
//<![CDATA[
function createModule(id, src, type) {
return createNaClEmbed({
id: id,
src: src,
width: 400,
height: 400,
type: type
});
}
var mime = 'application/x-nacl';
if (getTestArguments()['pnacl'] !== undefined) {
mime = 'application/x-pnacl';
}
var embed = createModule('naclModule', 'pm_nameservice_test.nmf', mime);
embed.basic_tests ='2';
embed.stress_tests = '0';
document.body.appendChild(embed);
function setupTests(tester, plugin) {
tester.addAsyncTest('TestInit', function(status) {
plugin.addEventListener('message', function(message_event) {
......
......@@ -80,6 +80,10 @@ NACL_BROWSER_TEST_F(NaClBrowserTest, MAYBE_Crash, {
RunNaClIntegrationTest(FILE_PATH_LITERAL("ppapi_crash.html"));
})
NACL_BROWSER_TEST_F(NaClBrowserTest, Nameservice, {
RunNaClIntegrationTest(FILE_PATH_LITERAL("pm_nameservice_test.html"));
})
// Some versions of Visual Studio does not like preprocessor
// conditionals inside the argument of a macro, so we put the
// conditionals on a helper function. We are already in an anonymous
......
......@@ -38,7 +38,6 @@ ppapi_scons_files['nonvariant_test_scons_files'] = [
'tests/breakpad_crash_test/nacl.scons',
'tests/nacl_browser/browser_dynamic_library/nacl.scons',
'tests/nacl_browser/manifest_file/nacl.scons',
'tests/nacl_browser/nameservice/nacl.scons',
'tests/ppapi_browser/extension_mime_handler/nacl.scons',
'tests/ppapi_browser/manifest/nacl.scons',
'tests/ppapi_test_lib/nacl.scons',
......
# -*- python -*-
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
Import('env')
# postmessage version of srpc_nameservice_test
pm_ns_obj = env.ComponentObject('pm_nameservice_test.o',
'pm_nameservice_test.cc')
pm_ns_nexe_name = env.ProgramNameForNmf('pm_nameservice_test')
pm_ns_nexe = env.ComponentProgram(pm_ns_nexe_name,
pm_ns_obj,
EXTRA_LIBS=['nacl_ppapi_util',
'ppapi_cpp',
'pthread',
'srpc',
'platform',
'gio',
'imc',
'imc_syscalls',
])
env.Publish(pm_ns_nexe_name, 'run',
['pm_nameservice_test.html'])
# chrome_browser_tests
node = env.PPAPIBrowserTester(
'pm_nameservice_browser_test.out',
url='pm_nameservice_test.html',
nmf_names=['pm_nameservice_test'],
files=env.ExtractPublishedFiles(pm_ns_nexe_name),
osenv=['NACLVERBOSITY=0:pp_weak_ref=0:weak_ref=0']
)
env.AddNodeToTestSuite(node,
['chrome_browser_tests'],
'run_pm_nameservice_chrome_browser_test',
is_broken=env.PPAPIBrowserTesterIsBroken())
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment