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

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

Issue 1335783005: [NaCl SDK] nacl_io: Add support for basic socketpairs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include <errno.h> 5 #include <errno.h>
6 #include <fcntl.h> 6 #include <fcntl.h>
7 #include <pthread.h> 7 #include <pthread.h>
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <sys/stat.h> 9 #include <sys/stat.h>
10 #include <sys/types.h> 10 #include <sys/types.h>
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 TEST_F(KernelProxyErrorTest, ReadError) { 1109 TEST_F(KernelProxyErrorTest, ReadError) {
1110 ScopedRef<MockFs> mock_fs(fs()); 1110 ScopedRef<MockFs> mock_fs(fs());
1111 ScopedRef<MockNode> mock_node(new MockNode(&*mock_fs)); 1111 ScopedRef<MockNode> mock_node(new MockNode(&*mock_fs));
1112 EXPECT_CALL(*mock_fs, OpenWithMode(_, _, _, _)) 1112 EXPECT_CALL(*mock_fs, OpenWithMode(_, _, _, _))
1113 .WillOnce(DoAll(SetArgPointee<3>(mock_node), Return(0))); 1113 .WillOnce(DoAll(SetArgPointee<3>(mock_node), Return(0)));
1114 1114
1115 EXPECT_CALL(*mock_node, Read(_, _, _, _)) 1115 EXPECT_CALL(*mock_node, Read(_, _, _, _))
1116 .WillOnce(DoAll(SetArgPointee<3>(0), // Read 0 bytes. 1116 .WillOnce(DoAll(SetArgPointee<3>(0), // Read 0 bytes.
1117 Return(1234))); // Returned error 1234. 1117 Return(1234))); // Returned error 1234.
1118 1118
1119 EXPECT_CALL(*mock_node, GetType()).WillRepeatedly(Return(S_IFDIR));
1119 EXPECT_CALL(*mock_node, Destroy()).Times(1); 1120 EXPECT_CALL(*mock_node, Destroy()).Times(1);
1120 1121
1121 int fd = ki_open("/dummy", O_RDONLY, 0); 1122 int fd = ki_open("/dummy", O_RDONLY, 0);
1122 EXPECT_NE(0, fd); 1123 EXPECT_NE(0, fd);
1123 1124
1124 char buf[20]; 1125 char buf[20];
1125 EXPECT_EQ(-1, ki_read(fd, &buf[0], 20)); 1126 EXPECT_EQ(-1, ki_read(fd, &buf[0], 20));
1126 // The Filesystem should be able to return whatever error it wants and have it 1127 // The Filesystem should be able to return whatever error it wants and have it
1127 // propagate through. 1128 // propagate through.
1128 EXPECT_EQ(1234, errno); 1129 EXPECT_EQ(1234, errno);
1129 } 1130 }
OLDNEW
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/socket/unix_node.cc ('k') | native_client_sdk/src/tests/nacl_io_test/mock_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698