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

Side by Side Diff: trunk/src/ppapi/proxy/flash_resource_unittest.cc

Issue 12920003: Revert 189518 "PPAPI: Remove threading options; it's always on" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "ppapi/c/dev/ppb_video_capture_dev.h" 5 #include "ppapi/c/dev/ppb_video_capture_dev.h"
6 #include "ppapi/c/pp_errors.h" 6 #include "ppapi/c/pp_errors.h"
7 #include "ppapi/c/private/ppb_flash.h" 7 #include "ppapi/c/private/ppb_flash.h"
8 #include "ppapi/proxy/locking_resource_releaser.h"
9 #include "ppapi/proxy/ppapi_messages.h" 8 #include "ppapi/proxy/ppapi_messages.h"
10 #include "ppapi/proxy/ppapi_proxy_test.h" 9 #include "ppapi/proxy/ppapi_proxy_test.h"
10 #include "ppapi/shared_impl/scoped_pp_resource.h"
11 #include "ppapi/thunk/thunk.h" 11 #include "ppapi/thunk/thunk.h"
12 12
13 namespace ppapi { 13 namespace ppapi {
14 namespace proxy { 14 namespace proxy {
15 15
16 namespace { 16 namespace {
17 17
18 typedef PluginProxyTest FlashResourceTest; 18 typedef PluginProxyTest FlashResourceTest;
19 19
20 void* Unused(void* user_data, uint32_t element_count, uint32_t element_size) { 20 void* Unused(void* user_data, uint32_t element_count, uint32_t element_size) {
(...skipping 15 matching lines...) Expand all
36 PpapiPluginMsg_DeviceEnumeration_EnumerateDevicesReply reply_msg( 36 PpapiPluginMsg_DeviceEnumeration_EnumerateDevicesReply reply_msg(
37 reply_device_ref_data); 37 reply_device_ref_data);
38 ResourceSyncCallHandler enumerate_video_devices_handler( 38 ResourceSyncCallHandler enumerate_video_devices_handler(
39 &sink(), 39 &sink(),
40 PpapiHostMsg_DeviceEnumeration_EnumerateDevices::ID, 40 PpapiHostMsg_DeviceEnumeration_EnumerateDevices::ID,
41 expected_result, 41 expected_result,
42 reply_msg); 42 reply_msg);
43 sink().AddFilter(&enumerate_video_devices_handler); 43 sink().AddFilter(&enumerate_video_devices_handler);
44 44
45 // Set up the arguments to the call. 45 // Set up the arguments to the call.
46 LockingResourceReleaser video_capture( 46 ScopedPPResource video_capture(ScopedPPResource::PassRef(),
47 ::ppapi::thunk::GetPPB_VideoCapture_Dev_0_3_Thunk()->Create( 47 ::ppapi::thunk::GetPPB_VideoCapture_Dev_0_3_Thunk()->Create(
48 pp_instance())); 48 pp_instance()));
49 std::vector<PP_Resource> unused; 49 std::vector<PP_Resource> unused;
50 PP_ArrayOutput output; 50 PP_ArrayOutput output;
51 output.GetDataBuffer = &Unused; 51 output.GetDataBuffer = &Unused;
52 output.user_data = &unused; 52 output.user_data = &unused;
53 53
54 // Make the call. 54 // Make the call.
55 const PPB_Flash_12_6* flash_iface = ::ppapi::thunk::GetPPB_Flash_12_6_Thunk(); 55 const PPB_Flash_12_6* flash_iface = ::ppapi::thunk::GetPPB_Flash_12_6_Thunk();
56 int32_t actual_result = flash_iface->EnumerateVideoCaptureDevices( 56 int32_t actual_result = flash_iface->EnumerateVideoCaptureDevices(
57 pp_instance(), video_capture.get(), output); 57 pp_instance(), video_capture.get(), output);
58 58
59 // Check the result is as expected. 59 // Check the result is as expected.
60 EXPECT_EQ(expected_result, actual_result); 60 EXPECT_EQ(expected_result, actual_result);
61 61
62 // Should have sent an "DeviceEnumeration_EnumerateDevices" message. 62 // Should have sent an "DeviceEnumeration_EnumerateDevices" message.
63 ASSERT_TRUE(enumerate_video_devices_handler.last_handled_msg().type() == 63 ASSERT_TRUE(enumerate_video_devices_handler.last_handled_msg().type() ==
64 PpapiHostMsg_DeviceEnumeration_EnumerateDevices::ID); 64 PpapiHostMsg_DeviceEnumeration_EnumerateDevices::ID);
65 65
66 // Remove the filter or it will be destroyed before the sink() is destroyed. 66 // Remove the filter or it will be destroyed before the sink() is destroyed.
67 sink().RemoveFilter(&enumerate_video_devices_handler); 67 sink().RemoveFilter(&enumerate_video_devices_handler);
68 } 68 }
69 69
70 } // namespace proxy 70 } // namespace proxy
71 } // namespace ppapi 71 } // namespace ppapi
OLDNEW
« no previous file with comments | « trunk/src/ppapi/proxy/file_chooser_resource_unittest.cc ('k') | trunk/src/ppapi/proxy/locking_resource_releaser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698