diff options
author | bradchen@google.com <bradchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-07 01:10:06 +0000 |
---|---|---|
committer | bradchen@google.com <bradchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-07 01:10:06 +0000 |
commit | 4223f8d3d82ed7794ffce1ac174a91e62e8795ad (patch) | |
tree | 693f6ba81abd84e63022399f5f381af5e1d6d984 | |
parent | e3be19f14017488bd5285aa9415e0ec27eecdb9f (diff) | |
download | chromium_src-4223f8d3d82ed7794ffce1ac174a91e62e8795ad.zip chromium_src-4223f8d3d82ed7794ffce1ac174a91e62e8795ad.tar.gz chromium_src-4223f8d3d82ed7794ffce1ac174a91e62e8795ad.tar.bz2 |
Enable PPAPINaCl GLIBC browser_tests.
NOTE: NaCl CL to update untrusted.gypi must go in first.
BUG=127699
TEST=this is a test
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=140786
Review URL: https://chromiumcodereview.appspot.com/10409032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140917 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/nacl_host/test/nacl_gdb_browsertest.cc | 4 | ||||
-rw-r--r-- | chrome/chrome_tests.gypi | 2 | ||||
-rw-r--r-- | chrome/test/ui/ppapi_uitest.cc | 35 | ||||
-rw-r--r-- | chrome/test/ui/ppapi_uitest.h | 17 | ||||
-rwxr-xr-x | native_client_sdk/src/tools/create_nmf.py | 8 | ||||
-rw-r--r-- | ppapi/native_client/native_client.gyp | 18 | ||||
-rw-r--r-- | ppapi/native_client/tests/ppapi_tests/ppapi_nacl_tests_newlib.nmf | 7 | ||||
-rw-r--r-- | ppapi/ppapi_untrusted.gyp | 42 | ||||
-rw-r--r-- | ppapi/tests/test_case.html | 9 |
9 files changed, 111 insertions, 31 deletions
diff --git a/chrome/browser/nacl_host/test/nacl_gdb_browsertest.cc b/chrome/browser/nacl_host/test/nacl_gdb_browsertest.cc index ec356708..ff4658a 100644 --- a/chrome/browser/nacl_host/test/nacl_gdb_browsertest.cc +++ b/chrome/browser/nacl_host/test/nacl_gdb_browsertest.cc @@ -17,13 +17,13 @@ static const FilePath::CharType kMockNaClGdb[] = FILE_PATH_LITERAL("mock_nacl_gdb"); #endif -class NaClGdbTest : public PPAPINaClTest { +class NaClGdbTest : public PPAPINaClNewlibTest { public: NaClGdbTest() { } void SetUpCommandLine(CommandLine* command_line) OVERRIDE { - PPAPINaClTest::SetUpCommandLine(command_line); + PPAPINaClNewlibTest::SetUpCommandLine(command_line); FilePath mock_nacl_gdb; EXPECT_TRUE(PathService::Get(base::DIR_EXE, &mock_nacl_gdb)); diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 185a5b3..25b5e2a 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -2556,7 +2556,7 @@ '../ppapi/tests/test_case.html', '../ppapi/tests/test_case.html.mock-http-headers', '../ppapi/tests/test_page.css', - '../ppapi/native_client/tests/ppapi_tests/test_case.nmf', + '../ppapi/native_client/tests/ppapi_tests/ppapi_nacl_tests_newlib.nmf', ], }, { diff --git a/chrome/test/ui/ppapi_uitest.cc b/chrome/test/ui/ppapi_uitest.cc index bec766d..b00e2a7 100644 --- a/chrome/test/ui/ppapi_uitest.cc +++ b/chrome/test/ui/ppapi_uitest.cc @@ -332,9 +332,6 @@ void OutOfProcessPPAPITest::SetUpCommandLine(CommandLine* command_line) { command_line->AppendSwitch(switches::kPpapiOutOfProcess); } -PPAPINaClTest::PPAPINaClTest() { -} - void PPAPINaClTest::SetUpCommandLine(CommandLine* command_line) { PPAPITestBase::SetUpCommandLine(command_line); @@ -348,13 +345,17 @@ void PPAPINaClTest::SetUpCommandLine(CommandLine* command_line) { } // Append the correct mode and testcase string -std::string PPAPINaClTest::BuildQuery(const std::string& base, +std::string PPAPINaClNewlibTest::BuildQuery(const std::string& base, const std::string& test_case) { - return StringPrintf("%smode=nacl&testcase=%s", base.c_str(), + return StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), test_case.c_str()); } -PPAPINaClTestDisallowedSockets::PPAPINaClTestDisallowedSockets() { +// Append the correct mode and testcase string +std::string PPAPINaClGLibcTest::BuildQuery(const std::string& base, + const std::string& test_case) { + return StringPrintf("%smode=nacl_glibc&testcase=%s", base.c_str(), + test_case.c_str()); } void PPAPINaClTestDisallowedSockets::SetUpCommandLine( @@ -373,7 +374,7 @@ void PPAPINaClTestDisallowedSockets::SetUpCommandLine( std::string PPAPINaClTestDisallowedSockets::BuildQuery( const std::string& base, const std::string& test_case) { - return StringPrintf("%smode=nacl&testcase=%s", base.c_str(), + return StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), test_case.c_str()); } @@ -441,7 +442,10 @@ std::string PPAPINaClTestDisallowedSockets::BuildQuery( // NaCl based PPAPI tests #define TEST_PPAPI_NACL_VIA_HTTP(test_name) \ - IN_PROC_BROWSER_TEST_F(PPAPINaClTest, test_name) { \ + IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, test_name) { \ + RunTestViaHTTP(STRIP_PREFIXES(test_name)); \ + } \ + IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, test_name) { \ RunTestViaHTTP(STRIP_PREFIXES(test_name)); \ } @@ -453,19 +457,28 @@ std::string PPAPINaClTestDisallowedSockets::BuildQuery( // NaCl based PPAPI tests with SSL server #define TEST_PPAPI_NACL_WITH_SSL_SERVER(test_name) \ - IN_PROC_BROWSER_TEST_F(PPAPINaClTest, test_name) { \ + IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, test_name) { \ + RunTestWithSSLServer(STRIP_PREFIXES(test_name)); \ + } \ + IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, test_name) { \ RunTestWithSSLServer(STRIP_PREFIXES(test_name)); \ } // NaCl based PPAPI tests with WebSocket server #define TEST_PPAPI_NACL_VIA_HTTP_WITH_WS(test_name) \ - IN_PROC_BROWSER_TEST_F(PPAPINaClTest, test_name) { \ + IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, test_name) { \ + RunTestWithWebSocketServer(STRIP_PREFIXES(test_name)); \ + } \ + IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, test_name) { \ RunTestWithWebSocketServer(STRIP_PREFIXES(test_name)); \ } // NaCl based PPAPI tests requiring an Audio device. #define TEST_PPAPI_NACL_VIA_HTTP_WITH_AUDIO_OUTPUT(test_name) \ - IN_PROC_BROWSER_TEST_F(PPAPINaClTest, test_name) { \ + IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, test_name) { \ + RunTestViaHTTPIfAudioOutputAvailable(STRIP_PREFIXES(test_name)); \ + } \ + IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, test_name) { \ RunTestViaHTTPIfAudioOutputAvailable(STRIP_PREFIXES(test_name)); \ } #endif diff --git a/chrome/test/ui/ppapi_uitest.h b/chrome/test/ui/ppapi_uitest.h index da9e3d5..ec58aba 100644 --- a/chrome/test/ui/ppapi_uitest.h +++ b/chrome/test/ui/ppapi_uitest.h @@ -68,21 +68,28 @@ class OutOfProcessPPAPITest : public PPAPITest { virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; }; -// NaCl plugin test runner. +// NaCl plugin test runner for Newlib runtime. class PPAPINaClTest : public PPAPITestBase { public: - PPAPINaClTest(); - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; +}; +// NaCl plugin test runner for Newlib runtime. +class PPAPINaClNewlibTest : public PPAPINaClTest { + public: virtual std::string BuildQuery(const std::string& base, const std::string& test_case) OVERRIDE; }; -class PPAPINaClTestDisallowedSockets : public PPAPITestBase { +// NaCl plugin test runner for GNU-libc runtime. +class PPAPINaClGLibcTest : public PPAPINaClTest { public: - PPAPINaClTestDisallowedSockets(); + virtual std::string BuildQuery(const std::string& base, + const std::string& test_case) OVERRIDE; +}; +class PPAPINaClTestDisallowedSockets : public PPAPITestBase { + public: virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; virtual std::string BuildQuery(const std::string& base, diff --git a/native_client_sdk/src/tools/create_nmf.py b/native_client_sdk/src/tools/create_nmf.py index 3c33b2a..84c6f53 100755 --- a/native_client_sdk/src/tools/create_nmf.py +++ b/native_client_sdk/src/tools/create_nmf.py @@ -239,12 +239,12 @@ class NmfUtils(object): def _GenerateManifest(self, runnable=True): '''Create a JSON formatted dict containing the files - + NaCl will map url requests based on architecture. The startup NEXE can always be found under the top key PROGRAM. Additional files are under the FILES key further mapped by file name. In the case of 'runnable' the PROGRAM key is populated with urls pointing the runnable-ld.so which acts - as the startup nexe. The application itself, is then placed under the + as the startup nexe. The application itself, is then placed under the FILES key mapped as 'main.exe' instead of it's original name so that the loader can find it.''' manifest = { FILES_KEY: {}, PROGRAM_KEY: {} } @@ -263,6 +263,10 @@ class NmfUtils(object): # For the main nexes: if need.endswith('.nexe') and need in self.main_files: + # Ensure that the nexe name is relative, not absolute. + # We assume that the nexe and the corresponding nmf file are + # installed in the same directory. + urlinfo[URL_KEY] = os.path.basename(urlinfo[URL_KEY]) # Place it under program if we aren't using the runnable-ld.so. if not runnable: manifest[PROGRAM_KEY][archinfo.arch] = urlinfo diff --git a/ppapi/native_client/native_client.gyp b/ppapi/native_client/native_client.gyp index df3007e3..c34d6b5 100644 --- a/ppapi/native_client/native_client.gyp +++ b/ppapi/native_client/native_client.gyp @@ -1,4 +1,4 @@ -# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# 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. @@ -16,6 +16,8 @@ '../../native_client/src/untrusted/pthread/pthread.gyp:pthread_lib', '../../native_client/src/untrusted/irt_stub/irt_stub.gyp:ppapi_stub_lib', ], + # Here we copy linker scripts out of the Native Client repository. + # These are source, not build artifacts. 'copies': [ { 'destination': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32', @@ -30,6 +32,20 @@ ], }, { + 'destination': '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32', + 'files': [ + '<(DEPTH)/native_client/src/untrusted/irt_stub/libppapi.a', + '<(DEPTH)/native_client/src/untrusted/irt_stub/libppapi.so', + ], + }, + { + 'destination': '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64', + 'files': [ + '<(DEPTH)/native_client/src/untrusted/irt_stub/libppapi.a', + '<(DEPTH)/native_client/src/untrusted/irt_stub/libppapi.so', + ], + }, + { 'destination': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/libarm', 'files': [ '<(DEPTH)/native_client/src/untrusted/irt_stub/libppapi.a', diff --git a/ppapi/native_client/tests/ppapi_tests/ppapi_nacl_tests_newlib.nmf b/ppapi/native_client/tests/ppapi_tests/ppapi_nacl_tests_newlib.nmf new file mode 100644 index 0000000..f0bb249 --- /dev/null +++ b/ppapi/native_client/tests/ppapi_tests/ppapi_nacl_tests_newlib.nmf @@ -0,0 +1,7 @@ +{ + "program": { + "x86-64": {"url": "ppapi_nacl_tests_newlib_x64.nexe"}, + "x86-32": {"url": "ppapi_nacl_tests_newlib_x32.nexe"}, + "arm": {"url": "ppapi_nacl_tests_newlib_arm.nexe"} + } +} diff --git a/ppapi/ppapi_untrusted.gyp b/ppapi/ppapi_untrusted.gyp index 57fe4a1..db686e4 100644 --- a/ppapi/ppapi_untrusted.gyp +++ b/ppapi/ppapi_untrusted.gyp @@ -1,4 +1,4 @@ -# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# 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. @@ -17,7 +17,7 @@ 'type': 'none', 'variables': { 'nlib_target': 'libppapi_cpp.a', - 'build_glibc': 0, + 'build_glibc': 1, 'build_newlib': 1, 'sources': [ '<@(cpp_source_files)', @@ -39,7 +39,6 @@ ], 'variables': { 'nexe_target': 'ppapi_nacl_tests', - 'build_glibc': 0, 'build_newlib': 1, 'include_dirs': [ 'lib/gl/include', @@ -55,10 +54,6 @@ '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libppapi_cpp.a', '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libppapi.a', ], - 'extra_deps32': [ - '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32/libppapi_cpp.a', - '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32/libppapi.a', - ], 'extra_deps_newlib64': [ '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libppapi_cpp.a', '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libppapi.a', @@ -84,6 +79,39 @@ '<@(test_nacl_source_files)', ], }, + 'conditions': [ + ['target_arch!="arm"', { + 'variables': { + 'build_glibc': 1, + # NOTE: Use /lib, not /lib64 here; it is a symbolic link which + # doesn't work on Windows. + 'libdir_glibc64': '>(nacl_glibc_tc_root)/x86_64-nacl/lib', + 'libdir_glibc32': '>(nacl_glibc_tc_root)/x86_64-nacl/lib32', + 'nacl_objdump': '>(nacl_glibc_tc_root)/bin/x86_64-nacl-objdump', + 'nmf_glibc%': '<(PRODUCT_DIR)/>(nexe_target)_glibc.nmf', + }, + 'actions': [ + { + 'action_name': 'Generate GLIBC NMF and copy libs', + 'inputs': ['>(out_glibc64)', '>(out_glibc32)'], + # NOTE: There is no explicit dependency for the lib32 + # and lib64 directories created in the PRODUCT_DIR. + # They are created as a side-effect of NMF creation. + 'outputs': ['>(nmf_glibc)'], + 'action': [ + 'python', + '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py', + '>@(_inputs)', + '--objdump=>(nacl_objdump)', + '--library-path=>(libdir_glibc64)', + '--library-path=>(libdir_glibc32)', + '--output=>(nmf_glibc)', + '--stage-dependencies=<(PRODUCT_DIR)', + ], + }, + ], + }], + ], }, ], } diff --git a/ppapi/tests/test_case.html b/ppapi/tests/test_case.html index d395f13..a9d0879 100644 --- a/ppapi/tests/test_case.html +++ b/ppapi/tests/test_case.html @@ -197,9 +197,14 @@ onload = function() { var mode = ExtractSearchParameter("mode"); document.title = 'Test ' + testcase; var obj; - if (mode == "nacl") { + if (mode == "nacl_newlib") { obj = document.createElement("EMBED"); - obj.setAttribute("src", "test_case.nmf"); + obj.setAttribute("src", "ppapi_nacl_tests_newlib.nmf"); + obj.setAttribute("type", "application/x-nacl"); + obj.setAttribute("mode", mode); + } else if (mode == "nacl_glibc") { + obj = document.createElement("EMBED"); + obj.setAttribute("src", "ppapi_nacl_tests_glibc.nmf"); obj.setAttribute("type", "application/x-nacl"); obj.setAttribute("mode", mode); } else { |