Index: content/browser/fileapi/fileapi_message_filter_unittest.cc |
=================================================================== |
--- content/browser/fileapi/fileapi_message_filter_unittest.cc (revision 225900) |
+++ content/browser/fileapi/fileapi_message_filter_unittest.cc (working copy) |
@@ -76,12 +76,10 @@ |
} |
// Tests via OnMessageReceived(const IPC::Message&). The channel proxy calls |
- // this method. Since OnMessageReceived is hidden on FileAPIMessageFilter, |
- // we need to cast it. |
+ // this method. |
bool InvokeOnMessageReceived(const IPC::Message& message) { |
- IPC::ChannelProxy::MessageFilter* casted_filter = |
- static_cast<IPC::ChannelProxy::MessageFilter*>(filter_.get()); |
- return casted_filter->OnMessageReceived(message); |
+ bool message_was_ok; |
+ return filter_->OnMessageReceived(message, &message_was_ok); |
} |
base::MessageLoop message_loop_; |
@@ -108,13 +106,11 @@ |
// Complete initialization. |
message_loop_.RunUntilIdle(); |
- IPC::ChannelProxy::MessageFilter* casted_filter = |
- static_cast<IPC::ChannelProxy::MessageFilter*>(filter.get()); |
- |
int request_id = 0; |
const GURL kUrl("filesystem:http://example.com/temporary/foo"); |
FileSystemHostMsg_ReadMetadata read_metadata(request_id++, kUrl); |
- EXPECT_TRUE(casted_filter->OnMessageReceived(read_metadata)); |
+ bool message_was_ok; |
+ EXPECT_TRUE(filter->OnMessageReceived(read_metadata, &message_was_ok)); |
// Close the filter while it has inflight request. |
filter->OnChannelClosing(); |
@@ -144,13 +140,11 @@ |
// Complete initialization. |
message_loop_.RunUntilIdle(); |
- IPC::ChannelProxy::MessageFilter* casted_filter = |
- static_cast<IPC::ChannelProxy::MessageFilter*>(filter1.get()); |
- |
int request_id = 0; |
const GURL kUrl("filesystem:http://example.com/temporary/foo"); |
FileSystemHostMsg_ReadMetadata read_metadata(request_id++, kUrl); |
- EXPECT_TRUE(casted_filter->OnMessageReceived(read_metadata)); |
+ bool message_was_ok; |
+ EXPECT_TRUE(filter1->OnMessageReceived(read_metadata, &message_was_ok)); |
// Close the other filter before the request for filter1 is processed. |
filter2->OnChannelClosing(); |
@@ -251,8 +245,7 @@ |
// OnAppendSharedMemoryToStream passes the peer process's handle to |
// SharedMemory's constructor. If it's incorrect, DuplicateHandle won't work |
// correctly. |
- static_cast<IPC::ChannelProxy::MessageFilter*>( |
- filter_.get())->OnChannelConnected(base::Process::Current().pid()); |
+ filter_->set_peer_pid_for_testing(base::Process::Current().pid()); |
StreamHostMsg_StartBuilding start_message(kUrl, kFakeContentType); |
EXPECT_TRUE(InvokeOnMessageReceived(start_message)); |