OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <map> | 5 #include <map> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 class PepperDeviceEnumerationHostHelperTest : public testing::Test { | 74 class PepperDeviceEnumerationHostHelperTest : public testing::Test { |
75 protected: | 75 protected: |
76 PepperDeviceEnumerationHostHelperTest() | 76 PepperDeviceEnumerationHostHelperTest() |
77 : ppapi_host_(&sink_, ppapi::PpapiPermissions()), | 77 : ppapi_host_(&sink_, ppapi::PpapiPermissions()), |
78 resource_host_(&ppapi_host_, 12345, 67890), | 78 resource_host_(&ppapi_host_, 12345, 67890), |
79 device_enumeration_(&resource_host_, | 79 device_enumeration_(&resource_host_, |
80 delegate_.AsWeakPtr(), | 80 delegate_.AsWeakPtr(), |
81 PP_DEVICETYPE_DEV_AUDIOCAPTURE, | 81 PP_DEVICETYPE_DEV_AUDIOCAPTURE, |
82 GURL("http://example.com")) {} | 82 GURL("http://example.com")) {} |
83 | 83 |
84 virtual ~PepperDeviceEnumerationHostHelperTest() {} | 84 ~PepperDeviceEnumerationHostHelperTest() override {} |
85 | 85 |
86 void SimulateMonitorDeviceChangeReceived(uint32_t callback_id) { | 86 void SimulateMonitorDeviceChangeReceived(uint32_t callback_id) { |
87 PpapiHostMsg_DeviceEnumeration_MonitorDeviceChange msg(callback_id); | 87 PpapiHostMsg_DeviceEnumeration_MonitorDeviceChange msg(callback_id); |
88 ppapi::proxy::ResourceMessageCallParams call_params( | 88 ppapi::proxy::ResourceMessageCallParams call_params( |
89 resource_host_.pp_resource(), 123); | 89 resource_host_.pp_resource(), 123); |
90 ppapi::host::HostMessageContext context(call_params); | 90 ppapi::host::HostMessageContext context(call_params); |
91 int32_t result = PP_ERROR_FAILED; | 91 int32_t result = PP_ERROR_FAILED; |
92 ASSERT_TRUE( | 92 ASSERT_TRUE( |
93 device_enumeration_.HandleResourceMessage(msg, &context, &result)); | 93 device_enumeration_.HandleResourceMessage(msg, &context, &result)); |
94 EXPECT_EQ(PP_OK, result); | 94 EXPECT_EQ(PP_OK, result); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 ppapi::host::HostMessageContext context(call_params); | 226 ppapi::host::HostMessageContext context(call_params); |
227 int32_t result = PP_ERROR_FAILED; | 227 int32_t result = PP_ERROR_FAILED; |
228 ASSERT_TRUE( | 228 ASSERT_TRUE( |
229 device_enumeration_.HandleResourceMessage(msg, &context, &result)); | 229 device_enumeration_.HandleResourceMessage(msg, &context, &result)); |
230 EXPECT_EQ(PP_OK, result); | 230 EXPECT_EQ(PP_OK, result); |
231 | 231 |
232 EXPECT_EQ(0U, delegate_.GetRegisteredCallbackCount()); | 232 EXPECT_EQ(0U, delegate_.GetRegisteredCallbackCount()); |
233 } | 233 } |
234 | 234 |
235 } // namespace content | 235 } // namespace content |
OLD | NEW |