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

Unified Diff: ppapi/proxy/nacl_message_scanner_unittest.cc

Issue 472073003: Pepper: Make pending_sync_msgs_ local to IO thread. (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
« no previous file with comments | « ppapi/proxy/nacl_message_scanner.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/nacl_message_scanner_unittest.cc
diff --git a/ppapi/proxy/nacl_message_scanner_unittest.cc b/ppapi/proxy/nacl_message_scanner_unittest.cc
index 3e439559c71b71a704dad515db6da7e208e7d1af..41b1e016335f0e37df3a9a76fd6fe3b2882dde9b 100644
--- a/ppapi/proxy/nacl_message_scanner_unittest.cc
+++ b/ppapi/proxy/nacl_message_scanner_unittest.cc
@@ -23,16 +23,6 @@ class NaClMessageScannerTest : public PluginProxyTest {
public:
NaClMessageScannerTest() {}
- uint32 FindPendingSyncMessage(
- const NaClMessageScanner& scanner,
- const IPC::Message& msg) {
- int msg_id = IPC::SyncMessage::GetMessageId(msg);
- std::map<int, uint32>::const_iterator it =
- scanner.pending_sync_msgs_.find(msg_id);
- // O can signal that no message was found.
- return (it != scanner.pending_sync_msgs_.end()) ? it->second : 0;
- }
-
NaClMessageScanner::FileSystem* FindFileSystem(
const NaClMessageScanner& scanner,
PP_Resource file_system) {
@@ -56,36 +46,16 @@ class NaClMessageScannerTest : public PluginProxyTest {
ResourceMessageReplyParams fio_reply_params(file_io, 0);
scoped_ptr<IPC::Message> new_msg_ptr;
scanner->ScanMessage(
- PpapiPluginMsg_ResourceReply(
- fio_reply_params,
- PpapiPluginMsg_FileIO_OpenReply(file_system, 0)),
- &unused_handles,
- &new_msg_ptr);
+ PpapiPluginMsg_ResourceReply(
+ fio_reply_params,
+ PpapiPluginMsg_FileIO_OpenReply(file_system, 0)),
+ PpapiPluginMsg_ResourceReply::ID,
+ &unused_handles,
+ &new_msg_ptr);
EXPECT_FALSE(new_msg_ptr);
}
};
-TEST_F(NaClMessageScannerTest, SyncMessageAndReply) {
- NaClMessageScanner test;
- ppapi::proxy::SerializedHandle handle(
- ppapi::proxy::SerializedHandle::SHARED_MEMORY);
- int id = -1;
- IPC::Message msg =
- PpapiHostMsg_PPBGraphics3D_CreateTransferBuffer(
- ppapi::API_ID_PPB_GRAPHICS_3D,
- HostResource(),
- 4096, // size
- &id,
- &handle);
- scoped_ptr<IPC::Message> new_msg_ptr;
- EXPECT_NE(msg.type(), FindPendingSyncMessage(test, msg));
- test.ScanUntrustedMessage(msg, &new_msg_ptr);
- EXPECT_FALSE(new_msg_ptr);
- EXPECT_EQ(msg.type(), FindPendingSyncMessage(test, msg));
-
- // TODO(bbudge) Figure out how to put together a sync reply message.
-}
-
TEST_F(NaClMessageScannerTest, FileOpenClose) {
NaClMessageScanner test;
std::vector<SerializedHandle> unused_handles;
@@ -103,6 +73,7 @@ TEST_F(NaClMessageScannerTest, FileOpenClose) {
PpapiPluginMsg_ResourceReply(
fio_reply_params,
PpapiPluginMsg_FileIO_OpenReply(kInvalidResource, 0)),
+ PpapiPluginMsg_ResourceReply::ID,
&unused_handles,
&new_msg_ptr);
EXPECT_FALSE(new_msg_ptr);
@@ -195,6 +166,7 @@ TEST_F(NaClMessageScannerTest, QuotaAuditing) {
PpapiPluginMsg_FileSystem_ReserveQuotaReply(
kQuotaReservationAmount,
file_sizes)),
+ PpapiPluginMsg_ResourceReply::ID,
&unused_handles,
&new_msg_ptr);
EXPECT_FALSE(new_msg_ptr);
@@ -257,6 +229,7 @@ TEST_F(NaClMessageScannerTest, SetLength) {
PpapiPluginMsg_FileSystem_ReserveQuotaReply(
kQuotaReservationAmount,
file_sizes)),
+ PpapiPluginMsg_ResourceReply::ID,
&unused_handles,
&new_msg_ptr);
« no previous file with comments | « ppapi/proxy/nacl_message_scanner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698