Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Unified Diff: native_client_sdk/src/tests/nacl_io_test/kernel_wrap_test.cc

Issue 412083002: [NaCl SDK] Allow ppapi_simple executables to run in both sel_ldr and in chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/tests/nacl_io_test/kernel_wrap_test.cc
diff --git a/native_client_sdk/src/tests/nacl_io_test/kernel_wrap_test.cc b/native_client_sdk/src/tests/nacl_io_test/kernel_wrap_test.cc
index 2bb619872cdb3404f9db4fba857aaa5928b21291..df2d99436a11c0138fd8808a98d0d16d18f5f72c 100644
--- a/native_client_sdk/src/tests/nacl_io_test/kernel_wrap_test.cc
+++ b/native_client_sdk/src/tests/nacl_io_test/kernel_wrap_test.cc
@@ -19,6 +19,7 @@
#include "nacl_io/osmman.h"
#include "nacl_io/ossocket.h"
#include "nacl_io/ostermios.h"
+#include "ppapi_simple/ps.h"
#if defined(__native_client__) && !defined(__GLIBC__)
extern "C" {
@@ -633,13 +634,14 @@ TEST_F(KernelWrapTest, write) {
EXPECT_EQ(kDummyInt3, write(kDummyInt, kDummyVoidPtr, kDummyInt2));
}
-#if defined SEL_LDR
class KernelWrapTestUninit : public ::testing::Test {
void SetUp() {
ASSERT_EQ(0, ki_push_state_for_testing());
+ kernel_wrap_uninit();
}
void TearDown() {
+ kernel_wrap_init();
ki_pop_state_for_testing();
}
};
@@ -647,6 +649,8 @@ class KernelWrapTestUninit : public ::testing::Test {
TEST_F(KernelWrapTestUninit, Mkdir_Uninitialised) {
// If we are running within chrome we can't use these calls without
// nacl_io initialized.
+ if (PSGetInstanceId() != 0)
+ return;
EXPECT_EQ(0, mkdir("./foo", S_IREAD | S_IWRITE));
EXPECT_EQ(0, rmdir("./foo"));
}
@@ -654,6 +658,8 @@ TEST_F(KernelWrapTestUninit, Mkdir_Uninitialised) {
TEST_F(KernelWrapTestUninit, Getcwd_Uninitialised) {
// If we are running within chrome we can't use these calls without
// nacl_io initialized.
+ if (PSGetInstanceId() != 0)
+ return;
char dir[PATH_MAX];
ASSERT_NE((char*)NULL, getcwd(dir, PATH_MAX));
// Verify that the CWD ends with 'nacl_io_test'
@@ -661,7 +667,6 @@ TEST_F(KernelWrapTestUninit, Getcwd_Uninitialised) {
ASSERT_GT(strlen(dir), strlen(suffix));
ASSERT_EQ(0, strcmp(dir+strlen(dir)-strlen(suffix), suffix));
}
-#endif
#if defined(PROVIDES_SOCKET_API) and !defined(__BIONIC__)
TEST_F(KernelWrapTest, poll) {
« no previous file with comments | « native_client_sdk/src/tests/nacl_io_socket_test/main.cc ('k') | native_client_sdk/src/tests/nacl_io_test/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698