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

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

Issue 334983007: [NaCl SDK] Remove use of TIOCNACLINPUT from nacl_io/ppapi_simple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <string.h> 7 #include <string.h>
8 #include <sys/ioctl.h> 8 #include <sys/ioctl.h>
9 #include <sys/select.h> 9 #include <sys/select.h>
10 #include <sys/stat.h> 10 #include <sys/stat.h>
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 148
149 // Send the message via ioctl 149 // Send the message via ioctl
150 int rtn = pipe_dev_->Ioctl(NACL_IOC_HANDLEMESSAGE, &message); 150 int rtn = pipe_dev_->Ioctl(NACL_IOC_HANDLEMESSAGE, &message);
151 151
152 // Release message 152 // Release message
153 ppapi_.GetVarInterface()->Release(message); 153 ppapi_.GetVarInterface()->Release(message);
154 return rtn; 154 return rtn;
155 } 155 }
156 156
157 // Verify the contents of the jspipe mesage, which should be 157 // Verify the contents of the jspipe mesage, which should be
158 // {'<pipe_name>' : ['<command_name>', payload] } 158 // {
159 // "pipe": '<pipe_name>',
160 // "operation": '<command_name>',
161 // "payload": payload
162 // }
159 void VerifyPipeMessage(PP_Var message, 163 void VerifyPipeMessage(PP_Var message,
160 const char* pipe_name, 164 const char* pipe_name,
161 const char* operation, 165 const char* operation,
162 const char* payload, 166 const char* payload,
163 int payload_length, 167 int payload_length,
164 int32_t int_payload=0) { 168 int32_t int_payload=0) {
165 VarArrayInterface* array_iface = ppapi_.GetVarArrayInterface(); 169 VarArrayInterface* array_iface = ppapi_.GetVarArrayInterface();
166 VarDictionaryInterface* dict_iface = ppapi_.GetVarDictionaryInterface(); 170 VarDictionaryInterface* dict_iface = ppapi_.GetVarDictionaryInterface();
167 VarInterface* var_iface = ppapi_.GetVarInterface(); 171 VarInterface* var_iface = ppapi_.GetVarInterface();
168 VarArrayBufferInterface* buffer_iface = ppapi_.GetVarArrayBufferInterface(); 172 VarArrayBufferInterface* buffer_iface = ppapi_.GetVarArrayBufferInterface();
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 ASSERT_EQ(0, ki_ioctl_wrapper(pipe_fd, NACL_IOC_HANDLEMESSAGE, &message)); 467 ASSERT_EQ(0, ki_ioctl_wrapper(pipe_fd, NACL_IOC_HANDLEMESSAGE, &message));
464 ppapi_.GetVarInterface()->Release(message); 468 ppapi_.GetVarInterface()->Release(message);
465 469
466 // Pipe should now be readable 470 // Pipe should now be readable
467 ASSERT_EQ(1, IsReadable(pipe_fd)); 471 ASSERT_EQ(1, IsReadable(pipe_fd));
468 472
469 ki_close(pipe_fd); 473 ki_close(pipe_fd);
470 } 474 }
471 475
472 } 476 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698