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

Side by Side Diff: native_client_sdk/src/tests/nacl_io_test/kernel_wrap_test.cc

Issue 271513002: [NaCl SDK] nacl_io: Make IRT intercepts (and their test code) more robust. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // The linux host build of nacl_io can't do wrapping of syscalls so all 5 // The linux host build of nacl_io can't do wrapping of syscalls so all
6 // these tests must be disabled. 6 // these tests must be disabled.
7 #if !defined(__linux__) 7 #if !defined(__linux__)
8 8
9 #include <unistd.h> 9 #include <unistd.h>
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 const char* kDummyConstChar3 = "fr00gl3"; 102 const char* kDummyConstChar3 = "fr00gl3";
103 const void* kDummyVoidPtr = "blahblah"; 103 const void* kDummyVoidPtr = "blahblah";
104 const uid_t kDummyUid = 1001; 104 const uid_t kDummyUid = 1001;
105 const gid_t kDummyGid = 1002; 105 const gid_t kDummyGid = 1002;
106 106
107 class KernelWrapTest : public ::testing::Test { 107 class KernelWrapTest : public ::testing::Test {
108 public: 108 public:
109 KernelWrapTest() {} 109 KernelWrapTest() {}
110 110
111 virtual void SetUp() { 111 virtual void SetUp() {
112 // Initialize the global errno value to a consistent value rather than
113 // relying on its value from previous test runs.
114 errno = 0;
115
112 // Initializing the KernelProxy opens stdin/stdout/stderr. 116 // Initializing the KernelProxy opens stdin/stdout/stderr.
113 EXPECT_CALL(mock, open(_, _)) 117 EXPECT_CALL(mock, open(_, _))
114 .WillOnce(Return(0)) 118 .WillOnce(Return(0))
115 .WillOnce(Return(1)) 119 .WillOnce(Return(1))
116 .WillOnce(Return(2)); 120 .WillOnce(Return(2));
117 // And will call mount / and /dev. 121 // And will call mount / and /dev.
118 EXPECT_CALL(mock, mount(_, _, _, _, _)) 122 EXPECT_CALL(mock, mount(_, _, _, _, _))
119 .WillOnce(Return(0)) 123 .WillOnce(Return(0))
120 .WillOnce(Return(0)); 124 .WillOnce(Return(0));
121 125
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 int dummy_val; 743 int dummy_val;
740 EXPECT_CALL(mock, socketpair(kDummyInt, kDummyInt2, kDummyInt3, &dummy_val)) 744 EXPECT_CALL(mock, socketpair(kDummyInt, kDummyInt2, kDummyInt3, &dummy_val))
741 .WillOnce(Return(kDummyInt4)); 745 .WillOnce(Return(kDummyInt4));
742 EXPECT_EQ(kDummyInt4, 746 EXPECT_EQ(kDummyInt4,
743 socketpair(kDummyInt, kDummyInt2, kDummyInt3, &dummy_val)); 747 socketpair(kDummyInt, kDummyInt2, kDummyInt3, &dummy_val));
744 } 748 }
745 749
746 #endif // PROVIDES_SOCKET_API 750 #endif // PROVIDES_SOCKET_API
747 751
748 #endif // __linux__ 752 #endif // __linux__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698