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

Unified Diff: ppapi/proxy/talk_resource_unittest.cc

Issue 46433002: Support using TrackedCallbacks as hints to determine the handling thread of resource reply messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/resource_reply_thread_registrar.cc ('k') | ppapi/proxy/tcp_socket_resource_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/talk_resource_unittest.cc
diff --git a/ppapi/proxy/talk_resource_unittest.cc b/ppapi/proxy/talk_resource_unittest.cc
index e81a8a6aca35f9e4d9eced36358c3df8d45a5bbb..3b7d5ff43fec7d2adb845ac8793ccc84d5fd2f99 100644
--- a/ppapi/proxy/talk_resource_unittest.cc
+++ b/ppapi/proxy/talk_resource_unittest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "ppapi/proxy/locking_resource_releaser.h"
+#include "ppapi/proxy/plugin_message_filter.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/proxy/ppapi_proxy_test.h"
#include "ppapi/proxy/talk_resource.h"
@@ -58,8 +59,7 @@ class TalkResourceTest : public PluginProxyTest {
ResourceMessageReplyParams reply_params(params.pp_resource(),
params.sequence());
reply_params.set_result(result);
- IPC::Message reply_msg = PpapiPluginMsg_ResourceReply(reply_params, reply);
- ASSERT_TRUE(plugin_dispatcher()->OnMessageReceived(reply_msg));
+ PluginMessageFilter::DispatchResourceReplyForTest(reply_params, reply);
}
};
@@ -84,9 +84,8 @@ TEST_F(TalkResourceTest, GetPermission) {
ResourceMessageReplyParams reply_params(params.pp_resource(),
params.sequence());
reply_params.set_result(1);
- IPC::Message reply = PpapiPluginMsg_ResourceReply(
+ PluginMessageFilter::DispatchResourceReplyForTest(
reply_params, PpapiPluginMsg_Talk_RequestPermissionReply());
- ASSERT_TRUE(plugin_dispatcher()->OnMessageReceived(reply));
ASSERT_TRUE(callback.called());
ASSERT_EQ(1, callback.result());
@@ -111,9 +110,8 @@ TEST_F(TalkResourceTest, RequestPermission) {
ResourceMessageReplyParams reply_params(params.pp_resource(),
params.sequence());
reply_params.set_result(1);
- IPC::Message reply = PpapiPluginMsg_ResourceReply(
+ PluginMessageFilter::DispatchResourceReplyForTest(
reply_params, PpapiPluginMsg_Talk_RequestPermissionReply());
- ASSERT_TRUE(plugin_dispatcher()->OnMessageReceived(reply));
ASSERT_TRUE(callback.called());
ASSERT_EQ(1, callback.result());
@@ -143,9 +141,8 @@ TEST_F(TalkResourceTest, StartStopRemoting) {
// Receive an event
ASSERT_FALSE(event_callback.called());
ResourceMessageReplyParams notify_params(res.get(), 0);
- IPC::Message notify = PpapiPluginMsg_ResourceReply(
+ PluginMessageFilter::DispatchResourceReplyForTest(
notify_params, PpapiPluginMsg_Talk_NotifyEvent(PP_TALKEVENT_ERROR));
- ASSERT_TRUE(plugin_dispatcher()->OnMessageReceived(notify));
ASSERT_TRUE(event_callback.called());
ASSERT_EQ(PP_TALKEVENT_ERROR, event_callback.result());
@@ -165,7 +162,8 @@ TEST_F(TalkResourceTest, StartStopRemoting) {
// Events should be discarded at this point
event_callback.Reset();
- ASSERT_TRUE(plugin_dispatcher()->OnMessageReceived(notify));
+ PluginMessageFilter::DispatchResourceReplyForTest(
+ notify_params, PpapiPluginMsg_Talk_NotifyEvent(PP_TALKEVENT_ERROR));
ASSERT_FALSE(event_callback.called());
}
« no previous file with comments | « ppapi/proxy/resource_reply_thread_registrar.cc ('k') | ppapi/proxy/tcp_socket_resource_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698