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

Unified Diff: ppapi/proxy/device_enumeration_resource_helper_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/ppapi_proxy.gypi ('k') | ppapi/proxy/file_chooser_resource_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/device_enumeration_resource_helper_unittest.cc
diff --git a/ppapi/proxy/device_enumeration_resource_helper_unittest.cc b/ppapi/proxy/device_enumeration_resource_helper_unittest.cc
index 56c09d7966cf1f969017a292a0b64045b3448205..bbf70527065d69fc7a88d5afcc99498f44b0cf36 100644
--- a/ppapi/proxy/device_enumeration_resource_helper_unittest.cc
+++ b/ppapi/proxy/device_enumeration_resource_helper_unittest.cc
@@ -7,6 +7,7 @@
#include "ppapi/c/pp_errors.h"
#include "ppapi/proxy/connection.h"
#include "ppapi/proxy/device_enumeration_resource_helper.h"
+#include "ppapi/proxy/plugin_message_filter.h"
#include "ppapi/proxy/plugin_resource.h"
#include "ppapi/proxy/plugin_resource_tracker.h"
#include "ppapi/proxy/plugin_var_tracker.h"
@@ -258,10 +259,9 @@ TEST_F(DeviceEnumerationResourceHelperTest, EnumerateDevices) {
{
ProxyAutoUnlock unlock;
- ASSERT_TRUE(plugin_dispatcher()->OnMessageReceived(
- PpapiPluginMsg_ResourceReply(
- reply_params,
- PpapiPluginMsg_DeviceEnumeration_EnumerateDevicesReply(data))));
+ PluginMessageFilter::DispatchResourceReplyForTest(
+ reply_params,
+ PpapiPluginMsg_DeviceEnumeration_EnumerateDevicesReply(data));
}
EXPECT_TRUE(callback.called());
EXPECT_EQ(PP_OK, callback.result());
@@ -304,11 +304,10 @@ TEST_F(DeviceEnumerationResourceHelperTest, MonitorDeviceChange) {
{
ProxyAutoUnlock unlock;
// Synthesize a response with no device.
- ASSERT_TRUE(plugin_dispatcher()->OnMessageReceived(
- PpapiPluginMsg_ResourceReply(
- reply_params,
- PpapiPluginMsg_DeviceEnumeration_NotifyDeviceChange(
- callback_id, data))));
+ PluginMessageFilter::DispatchResourceReplyForTest(
+ reply_params,
+ PpapiPluginMsg_DeviceEnumeration_NotifyDeviceChange(
+ callback_id, data));
}
EXPECT_TRUE(helper.called() && helper.same_as_expected());
@@ -327,11 +326,10 @@ TEST_F(DeviceEnumerationResourceHelperTest, MonitorDeviceChange) {
{
ProxyAutoUnlock unlock;
// Synthesize a response with some devices.
- ASSERT_TRUE(plugin_dispatcher()->OnMessageReceived(
- PpapiPluginMsg_ResourceReply(
- reply_params,
- PpapiPluginMsg_DeviceEnumeration_NotifyDeviceChange(
- callback_id, data))));
+ PluginMessageFilter::DispatchResourceReplyForTest(
+ reply_params,
+ PpapiPluginMsg_DeviceEnumeration_NotifyDeviceChange(
+ callback_id, data));
}
EXPECT_TRUE(helper.called() && helper.same_as_expected());
@@ -357,11 +355,10 @@ TEST_F(DeviceEnumerationResourceHelperTest, MonitorDeviceChange) {
{
ProxyAutoUnlock unlock;
// |helper2| should receive the result while |helper| shouldn't.
- ASSERT_TRUE(plugin_dispatcher()->OnMessageReceived(
- PpapiPluginMsg_ResourceReply(
- reply_params,
- PpapiPluginMsg_DeviceEnumeration_NotifyDeviceChange(
- callback_id2, data))));
+ PluginMessageFilter::DispatchResourceReplyForTest(
+ reply_params,
+ PpapiPluginMsg_DeviceEnumeration_NotifyDeviceChange(
+ callback_id2, data));
}
EXPECT_TRUE(helper2.called() && helper2.same_as_expected());
EXPECT_FALSE(helper.called());
@@ -372,11 +369,10 @@ TEST_F(DeviceEnumerationResourceHelperTest, MonitorDeviceChange) {
ProxyAutoUnlock unlock;
// Even if a message with |callback_id| arrives. |helper| shouldn't receive
// the result.
- ASSERT_TRUE(plugin_dispatcher()->OnMessageReceived(
- PpapiPluginMsg_ResourceReply(
- reply_params,
- PpapiPluginMsg_DeviceEnumeration_NotifyDeviceChange(
- callback_id, data))));
+ PluginMessageFilter::DispatchResourceReplyForTest(
+ reply_params,
+ PpapiPluginMsg_DeviceEnumeration_NotifyDeviceChange(
+ callback_id, data));
}
EXPECT_FALSE(helper2.called());
EXPECT_FALSE(helper.called());
@@ -396,11 +392,10 @@ TEST_F(DeviceEnumerationResourceHelperTest, MonitorDeviceChange) {
{
ProxyAutoUnlock unlock;
// |helper2| shouldn't receive any result any more.
- ASSERT_TRUE(plugin_dispatcher()->OnMessageReceived(
- PpapiPluginMsg_ResourceReply(
- reply_params,
- PpapiPluginMsg_DeviceEnumeration_NotifyDeviceChange(
- callback_id2, data))));
+ PluginMessageFilter::DispatchResourceReplyForTest(
+ reply_params,
+ PpapiPluginMsg_DeviceEnumeration_NotifyDeviceChange(
+ callback_id2, data));
}
EXPECT_FALSE(helper2.called());
}
« no previous file with comments | « ppapi/ppapi_proxy.gypi ('k') | ppapi/proxy/file_chooser_resource_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698