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

Side by Side Diff: ppapi/proxy/nacl_message_scanner_unittest.cc

Issue 215803002: Remove CommandBuffer::GetTransferBuffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 8 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
« no previous file with comments | « ppapi/proxy/nacl_message_scanner.cc ('k') | ppapi/proxy/ppapi_command_buffer_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include "ipc/ipc_message.h" 5 #include "ipc/ipc_message.h"
6 #include "ppapi/proxy/nacl_message_scanner.h" 6 #include "ppapi/proxy/nacl_message_scanner.h"
7 #include "ppapi/proxy/ppapi_messages.h" 7 #include "ppapi/proxy/ppapi_messages.h"
8 #include "ppapi/proxy/ppapi_proxy_test.h" 8 #include "ppapi/proxy/ppapi_proxy_test.h"
9 #include "ppapi/proxy/serialized_handle.h" 9 #include "ppapi/proxy/serialized_handle.h"
10 #include "ppapi/shared_impl/host_resource.h" 10 #include "ppapi/shared_impl/host_resource.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 &unused_handles, 62 &unused_handles,
63 &new_msg_ptr); 63 &new_msg_ptr);
64 EXPECT_FALSE(new_msg_ptr); 64 EXPECT_FALSE(new_msg_ptr);
65 } 65 }
66 }; 66 };
67 67
68 TEST_F(NaClMessageScannerTest, SyncMessageAndReply) { 68 TEST_F(NaClMessageScannerTest, SyncMessageAndReply) {
69 NaClMessageScanner test; 69 NaClMessageScanner test;
70 ppapi::proxy::SerializedHandle handle( 70 ppapi::proxy::SerializedHandle handle(
71 ppapi::proxy::SerializedHandle::SHARED_MEMORY); 71 ppapi::proxy::SerializedHandle::SHARED_MEMORY);
72 int id = -1;
72 IPC::Message msg = 73 IPC::Message msg =
73 PpapiHostMsg_PPBGraphics3D_GetTransferBuffer( 74 PpapiHostMsg_PPBGraphics3D_CreateTransferBuffer(
74 ppapi::API_ID_PPB_GRAPHICS_3D, 75 ppapi::API_ID_PPB_GRAPHICS_3D,
75 HostResource(), 76 HostResource(),
76 0, // id 77 4096, // size
78 &id,
77 &handle); 79 &handle);
78 scoped_ptr<IPC::Message> new_msg_ptr; 80 scoped_ptr<IPC::Message> new_msg_ptr;
79 EXPECT_NE(msg.type(), FindPendingSyncMessage(test, msg)); 81 EXPECT_NE(msg.type(), FindPendingSyncMessage(test, msg));
80 test.ScanUntrustedMessage(msg, &new_msg_ptr); 82 test.ScanUntrustedMessage(msg, &new_msg_ptr);
81 EXPECT_FALSE(new_msg_ptr); 83 EXPECT_FALSE(new_msg_ptr);
82 EXPECT_EQ(msg.type(), FindPendingSyncMessage(test, msg)); 84 EXPECT_EQ(msg.type(), FindPendingSyncMessage(test, msg));
83 85
84 // TODO(bbudge) Figure out how to put together a sync reply message. 86 // TODO(bbudge) Figure out how to put together a sync reply message.
85 } 87 }
86 88
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 UnpackMessage<PpapiHostMsg_FileIO_SetLength>( 286 UnpackMessage<PpapiHostMsg_FileIO_SetLength>(
285 nested_msg, &length)); 287 nested_msg, &length));
286 new_msg_ptr.reset(); 288 new_msg_ptr.reset();
287 EXPECT_EQ(-1, length); 289 EXPECT_EQ(-1, length);
288 EXPECT_EQ(kQuotaReservationAmount - kNewFileSize, fs->reserved_quota()); 290 EXPECT_EQ(kQuotaReservationAmount - kNewFileSize, fs->reserved_quota());
289 EXPECT_EQ(kNewFileSize, fio->max_written_offset()); 291 EXPECT_EQ(kNewFileSize, fio->max_written_offset());
290 } 292 }
291 293
292 } // namespace proxy 294 } // namespace proxy
293 } // namespace ppapi 295 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/nacl_message_scanner.cc ('k') | ppapi/proxy/ppapi_command_buffer_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698