1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 #include "base/memory/shared_memory.h"
8 #include "base/message_loop/message_loop.h"
9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/c/ppb_video_decoder.h"
11 #include "ppapi/proxy/locking_resource_releaser.h"
12 #include "ppapi/proxy/plugin_message_filter.h"
13 #include "ppapi/proxy/ppapi_message_utils.h"
14 #include "ppapi/proxy/ppapi_messages.h"
15 #include "ppapi/proxy/ppapi_proxy_test.h"
16 #include "ppapi/proxy/ppb_graphics_3d_proxy.h"
17 #include "ppapi/proxy/video_decoder_constants.h"
18 #include "ppapi/proxy/video_decoder_resource.h"
19 #include "ppapi/shared_impl/proxy_lock.h"
20 #include "ppapi/thunk/thunk.h"
22 using ppapi::proxy::ResourceMessageTestSink
;
29 const PP_Resource kGraphics3D
= 7;
30 const uint32_t kShmSize
= 256;
31 const size_t kDecodeBufferSize
= 16;
32 const uint32_t kDecodeId
= 5;
33 const uint32_t kTextureId1
= 1;
34 const uint32_t kTextureId2
= 2;
35 const uint32_t kNumRequestedTextures
= 2;
37 class MockCompletionCallback
{
39 MockCompletionCallback() : called_(false) {}
41 bool called() { return called_
; }
42 int32_t result() { return result_
; }
44 void Reset() { called_
= false; }
46 static void Callback(void* user_data
, int32_t result
) {
47 MockCompletionCallback
* that
=
48 reinterpret_cast<MockCompletionCallback
*>(user_data
);
50 that
->result_
= result
;
58 class VideoDecoderResourceTest
: public PluginProxyTest
{
60 VideoDecoderResourceTest()
61 : decoder_iface_(thunk::GetPPB_VideoDecoder_1_0_Thunk()) {}
63 const PPB_VideoDecoder_1_0
* decoder_iface() const { return decoder_iface_
; }
65 void SendReply(const ResourceMessageCallParams
& params
,
67 const IPC::Message
& nested_message
) {
68 ResourceMessageReplyParams
reply_params(params
.pp_resource(),
70 reply_params
.set_result(result
);
71 PluginMessageFilter::DispatchResourceReplyForTest(reply_params
,
75 void SendReplyWithHandle(const ResourceMessageCallParams
& params
,
77 const IPC::Message
& nested_message
,
78 const SerializedHandle
& handle
) {
79 ResourceMessageReplyParams
reply_params(params
.pp_resource(),
81 reply_params
.set_result(result
);
82 reply_params
.AppendHandle(handle
);
83 PluginMessageFilter::DispatchResourceReplyForTest(reply_params
,
87 PP_Resource
CreateDecoder() {
88 PP_Resource result
= decoder_iface()->Create(pp_instance());
91 ppapi::Resource
* resource
=
92 GetGlobals()->GetResourceTracker()->GetResource(result
);
93 proxy::VideoDecoderResource
* decoder
=
94 static_cast<proxy::VideoDecoderResource
*>(resource
);
95 decoder
->SetForTest();
101 PP_Resource
CreateGraphics3d() {
104 HostResource host_resource
;
105 host_resource
.SetHostResource(pp_instance(), kGraphics3D
);
106 scoped_refptr
<ppapi::proxy::Graphics3D
> graphics_3d(
107 new ppapi::proxy::Graphics3D(host_resource
));
108 return graphics_3d
->GetReference();
111 PP_Resource
CreateAndInitializeDecoder() {
112 PP_Resource decoder
= CreateDecoder();
113 LockingResourceReleaser
graphics3d(CreateGraphics3d());
114 MockCompletionCallback cb
;
115 int32_t result
= decoder_iface()->Initialize(
118 PP_VIDEOPROFILE_H264MAIN
,
119 PP_HARDWAREACCELERATION_WITHFALLBACK
,
120 PP_MakeOptionalCompletionCallback(&MockCompletionCallback::Callback
,
122 if (result
!= PP_OK_COMPLETIONPENDING
)
124 ResourceMessageCallParams params
;
126 if (!sink().GetFirstResourceCallMatching(
127 PpapiHostMsg_VideoDecoder_Initialize::ID
, ¶ms
, &msg
))
129 sink().ClearMessages();
130 SendReply(params
, PP_OK
, PpapiPluginMsg_VideoDecoder_InitializeReply());
134 int32_t CallDecode(PP_Resource pp_decoder
,
135 MockCompletionCallback
* cb
,
136 const PpapiHostMsg_VideoDecoder_GetShm
* expected_shm_msg
) {
137 // Set up a handler in case the resource sends a sync message to create
139 PpapiPluginMsg_VideoDecoder_GetShmReply
shm_msg_reply(kShmSize
);
140 ResourceSyncCallHandler
shm_msg_handler(
141 &sink(), PpapiHostMsg_VideoDecoder_GetShm::ID
, PP_OK
, shm_msg_reply
);
142 sink().AddFilter(&shm_msg_handler
);
144 base::SharedMemory shm
;
145 if (expected_shm_msg
) {
146 shm
.CreateAnonymous(kShmSize
);
147 base::SharedMemoryHandle shm_handle
;
148 shm
.ShareToProcess(base::GetCurrentProcessHandle(), &shm_handle
);
149 SerializedHandle
serialized_handle(shm_handle
, kShmSize
);
150 shm_msg_handler
.set_serialized_handle(&serialized_handle
);
153 memset(decode_buffer_
, 0x55, kDecodeBufferSize
);
155 decoder_iface()->Decode(pp_decoder
,
159 PP_MakeOptionalCompletionCallback(
160 &MockCompletionCallback::Callback
, cb
));
162 if (expected_shm_msg
) {
163 uint32_t shm_id
, shm_size
, expected_shm_id
, expected_shm_size
;
164 UnpackMessage
<PpapiHostMsg_VideoDecoder_GetShm
>(
165 *expected_shm_msg
, &expected_shm_id
, &expected_shm_size
);
166 if (shm_msg_handler
.last_handled_msg().type() == 0 ||
167 !UnpackMessage
<PpapiHostMsg_VideoDecoder_GetShm
>(
168 shm_msg_handler
.last_handled_msg(), &shm_id
, &shm_size
) ||
169 shm_id
!= expected_shm_id
||
170 shm_size
!= expected_shm_size
) {
171 // Signal that the expected shm message wasn't sent by failing.
172 result
= PP_ERROR_FAILED
;
176 sink().RemoveFilter(&shm_msg_handler
);
180 int32_t CallGetPicture(PP_Resource pp_decoder
,
181 PP_VideoPicture
* picture
,
182 MockCompletionCallback
* cb
) {
184 decoder_iface()->GetPicture(pp_decoder
,
186 PP_MakeOptionalCompletionCallback(
187 &MockCompletionCallback::Callback
, cb
));
191 void CallRecyclePicture(PP_Resource pp_decoder
,
192 const PP_VideoPicture
& picture
) {
193 decoder_iface()->RecyclePicture(pp_decoder
, &picture
);
196 int32_t CallFlush(PP_Resource pp_decoder
, MockCompletionCallback
* cb
) {
198 decoder_iface()->Flush(pp_decoder
,
199 PP_MakeOptionalCompletionCallback(
200 &MockCompletionCallback::Callback
, cb
));
204 int32_t CallReset(PP_Resource pp_decoder
, MockCompletionCallback
* cb
) {
206 decoder_iface()->Reset(pp_decoder
,
207 PP_MakeOptionalCompletionCallback(
208 &MockCompletionCallback::Callback
, cb
));
212 void SendDecodeReply(const ResourceMessageCallParams
& params
,
214 SendReply(params
, PP_OK
, PpapiPluginMsg_VideoDecoder_DecodeReply(shm_id
));
217 void SendPictureReady(const ResourceMessageCallParams
& params
,
218 uint32_t decode_count
,
219 uint32_t texture_id
) {
220 PP_Rect visible_rect
= PP_MakeRectFromXYWH(0, 0, 640, 480);
221 SendReply(params
, PP_OK
, PpapiPluginMsg_VideoDecoder_PictureReady(
222 decode_count
, texture_id
, visible_rect
));
225 void SendFlushReply(const ResourceMessageCallParams
& params
) {
226 SendReply(params
, PP_OK
, PpapiPluginMsg_VideoDecoder_FlushReply());
229 void SendResetReply(const ResourceMessageCallParams
& params
) {
230 SendReply(params
, PP_OK
, PpapiPluginMsg_VideoDecoder_ResetReply());
233 void SendRequestTextures(const ResourceMessageCallParams
& params
) {
236 PpapiPluginMsg_VideoDecoder_RequestTextures(
237 kNumRequestedTextures
,
238 PP_MakeSize(320, 240),
240 std::vector
<gpu::Mailbox
>()));
243 void SendNotifyError(const ResourceMessageCallParams
& params
, int32_t error
) {
244 SendReply(params
, PP_OK
, PpapiPluginMsg_VideoDecoder_NotifyError(error
));
247 bool CheckDecodeMsg(ResourceMessageCallParams
* params
,
250 int32_t* decode_id
) {
252 if (!sink().GetFirstResourceCallMatching(
253 PpapiHostMsg_VideoDecoder_Decode::ID
, params
, &msg
))
255 sink().ClearMessages();
256 return UnpackMessage
<PpapiHostMsg_VideoDecoder_Decode
>(
257 msg
, shm_id
, size
, decode_id
);
260 bool CheckRecyclePictureMsg(ResourceMessageCallParams
* params
,
261 uint32_t* texture_id
) {
263 if (!sink().GetFirstResourceCallMatching(
264 PpapiHostMsg_VideoDecoder_RecyclePicture::ID
, params
, &msg
))
266 sink().ClearMessages();
267 return UnpackMessage
<PpapiHostMsg_VideoDecoder_RecyclePicture
>(msg
,
271 bool CheckFlushMsg(ResourceMessageCallParams
* params
) {
272 return CheckMsg(params
, PpapiHostMsg_VideoDecoder_Flush::ID
);
275 bool CheckResetMsg(ResourceMessageCallParams
* params
) {
276 return CheckMsg(params
, PpapiHostMsg_VideoDecoder_Reset::ID
);
279 void ClearCallbacks(PP_Resource pp_decoder
) {
280 ResourceMessageCallParams params
;
281 MockCompletionCallback cb
;
283 // Reset to abort Decode and GetPicture callbacks.
284 CallReset(pp_decoder
, &cb
);
285 // Initialize params so we can reply to the Reset.
286 CheckResetMsg(¶ms
);
287 // Run the Reset callback.
288 SendResetReply(params
);
292 bool CheckMsg(ResourceMessageCallParams
* params
, int id
) {
294 if (!sink().GetFirstResourceCallMatching(id
, params
, &msg
))
296 sink().ClearMessages();
300 const PPB_VideoDecoder_1_0
* decoder_iface_
;
302 char decode_buffer_
[kDecodeBufferSize
];
307 TEST_F(VideoDecoderResourceTest
, Initialize
) {
308 // Initialize with 0 graphics3d_context should fail.
310 LockingResourceReleaser
decoder(CreateDecoder());
311 MockCompletionCallback cb
;
312 int32_t result
= decoder_iface()->Initialize(
314 0 /* invalid 3d graphics */,
315 PP_VIDEOPROFILE_H264MAIN
,
316 PP_HARDWAREACCELERATION_WITHFALLBACK
,
317 PP_MakeOptionalCompletionCallback(&MockCompletionCallback::Callback
,
319 ASSERT_EQ(PP_ERROR_BADRESOURCE
, result
);
321 // Initialize with bad profile value should fail.
323 LockingResourceReleaser
decoder(CreateDecoder());
324 MockCompletionCallback cb
;
325 int32_t result
= decoder_iface()->Initialize(
327 1 /* non-zero resource */,
328 static_cast<PP_VideoProfile
>(-1),
329 PP_HARDWAREACCELERATION_WITHFALLBACK
,
330 PP_MakeOptionalCompletionCallback(&MockCompletionCallback::Callback
,
332 ASSERT_EQ(PP_ERROR_BADARGUMENT
, result
);
334 // Initialize with valid graphics3d_context and profile should succeed.
336 LockingResourceReleaser
decoder(CreateDecoder());
337 LockingResourceReleaser
graphics3d(CreateGraphics3d());
338 MockCompletionCallback cb
;
339 int32_t result
= decoder_iface()->Initialize(
342 PP_VIDEOPROFILE_H264MAIN
,
343 PP_HARDWAREACCELERATION_WITHFALLBACK
,
344 PP_MakeOptionalCompletionCallback(&MockCompletionCallback::Callback
,
346 ASSERT_EQ(PP_OK_COMPLETIONPENDING
, result
);
347 ASSERT_TRUE(decoder_iface()->IsVideoDecoder(decoder
.get()));
349 // Another attempt while pending should fail.
350 result
= decoder_iface()->Initialize(
353 PP_VIDEOPROFILE_H264MAIN
,
354 PP_HARDWAREACCELERATION_WITHFALLBACK
,
355 PP_MakeOptionalCompletionCallback(&MockCompletionCallback::Callback
,
357 ASSERT_EQ(PP_ERROR_INPROGRESS
, result
);
359 // Check for host message and send a reply to complete initialization.
360 ResourceMessageCallParams params
;
362 ASSERT_TRUE(sink().GetFirstResourceCallMatching(
363 PpapiHostMsg_VideoDecoder_Initialize::ID
, ¶ms
, &msg
));
364 sink().ClearMessages();
365 SendReply(params
, PP_OK
, PpapiPluginMsg_VideoDecoder_InitializeReply());
366 ASSERT_TRUE(cb
.called());
367 ASSERT_EQ(PP_OK
, cb
.result());
371 TEST_F(VideoDecoderResourceTest
, Uninitialized
) {
372 // Operations on uninitialized decoders should fail.
373 LockingResourceReleaser
decoder(CreateDecoder());
374 MockCompletionCallback uncalled_cb
;
376 ASSERT_EQ(PP_ERROR_FAILED
, CallDecode(decoder
.get(), &uncalled_cb
, NULL
));
377 ASSERT_FALSE(uncalled_cb
.called());
379 ASSERT_EQ(PP_ERROR_FAILED
, CallGetPicture(decoder
.get(), NULL
, &uncalled_cb
));
380 ASSERT_FALSE(uncalled_cb
.called());
382 ASSERT_EQ(PP_ERROR_FAILED
, CallFlush(decoder
.get(), &uncalled_cb
));
383 ASSERT_FALSE(uncalled_cb
.called());
385 ASSERT_EQ(PP_ERROR_FAILED
, CallReset(decoder
.get(), &uncalled_cb
));
386 ASSERT_FALSE(uncalled_cb
.called());
389 // TODO(bbudge) Fix sync message testing on Windows 64 bit builds. The reply
390 // message for GetShm isn't received, causing Decode to fail.
391 // http://crbug.com/379260
392 #if !defined(OS_WIN) || !defined(ARCH_CPU_64_BITS)
393 TEST_F(VideoDecoderResourceTest
, DecodeAndGetPicture
) {
394 LockingResourceReleaser
decoder(CreateAndInitializeDecoder());
395 ResourceMessageCallParams params
, params2
;
396 MockCompletionCallback decode_cb
, get_picture_cb
, uncalled_cb
;
399 uint32_t decode_size
;
401 // Call Decode until we have the maximum pending, minus one.
402 for (uint32_t i
= 0; i
< kMaximumPendingDecodes
- 1; i
++) {
403 PpapiHostMsg_VideoDecoder_GetShm
shm_msg(i
, kDecodeBufferSize
);
404 ASSERT_EQ(PP_OK
, CallDecode(decoder
.get(), &uncalled_cb
, &shm_msg
));
405 ASSERT_FALSE(uncalled_cb
.called());
406 CheckDecodeMsg(¶ms
, &shm_id
, &decode_size
, &decode_id
);
407 ASSERT_EQ(i
, shm_id
);
408 ASSERT_EQ(kDecodeBufferSize
, decode_size
);
409 // The resource generates uids internally, starting at 1.
411 ASSERT_EQ(uid
, decode_id
);
413 // Once we've allocated the maximum number of buffers, we must wait.
414 PpapiHostMsg_VideoDecoder_GetShm
shm_msg(7U, kDecodeBufferSize
);
415 ASSERT_EQ(PP_OK_COMPLETIONPENDING
,
416 CallDecode(decoder
.get(), &decode_cb
, &shm_msg
));
417 CheckDecodeMsg(¶ms
, &shm_id
, &decode_size
, &decode_id
);
418 ASSERT_EQ(7U, shm_id
);
419 ASSERT_EQ(kDecodeBufferSize
, decode_size
);
421 // Calling Decode when another Decode is pending should fail.
422 ASSERT_EQ(PP_ERROR_INPROGRESS
, CallDecode(decoder
.get(), &uncalled_cb
, NULL
));
423 ASSERT_FALSE(uncalled_cb
.called());
424 // Free up the first decode buffer.
425 SendDecodeReply(params
, 0U);
426 // The decoder should run the pending callback.
427 ASSERT_TRUE(decode_cb
.called());
428 ASSERT_EQ(PP_OK
, decode_cb
.result());
431 // Now try to get a picture. No picture ready message has been received yet.
432 PP_VideoPicture picture
;
433 ASSERT_EQ(PP_OK_COMPLETIONPENDING
,
434 CallGetPicture(decoder
.get(), &picture
, &get_picture_cb
));
435 ASSERT_FALSE(get_picture_cb
.called());
436 // Calling GetPicture when another GetPicture is pending should fail.
437 ASSERT_EQ(PP_ERROR_INPROGRESS
,
438 CallGetPicture(decoder
.get(), &picture
, &uncalled_cb
));
439 ASSERT_FALSE(uncalled_cb
.called());
440 // Send 'request textures' message to initialize textures.
441 SendRequestTextures(params
);
442 // Send a picture ready message for Decode call 1. The GetPicture callback
444 SendPictureReady(params
, 1U, kTextureId1
);
445 ASSERT_TRUE(get_picture_cb
.called());
446 ASSERT_EQ(PP_OK
, get_picture_cb
.result());
447 ASSERT_EQ(kDecodeId
, picture
.decode_id
);
448 get_picture_cb
.Reset();
450 // Send a picture ready message for Decode call 2. Since there is no pending
451 // GetPicture call, the picture should be queued.
452 SendPictureReady(params
, 2U, kTextureId2
);
453 // The next GetPicture should return synchronously.
454 ASSERT_EQ(PP_OK
, CallGetPicture(decoder
.get(), &picture
, &uncalled_cb
));
455 ASSERT_FALSE(uncalled_cb
.called());
456 ASSERT_EQ(kDecodeId
, picture
.decode_id
);
458 #endif // !defined(OS_WIN) || !defined(ARCH_CPU_64_BITS)
460 // TODO(bbudge) Fix sync message testing on Windows 64 bit builds. The reply
461 // message for GetShm isn't received, causing Decode to fail.
462 // http://crbug.com/379260
463 #if !defined(OS_WIN) || !defined(ARCH_CPU_64_BITS)
464 TEST_F(VideoDecoderResourceTest
, RecyclePicture
) {
465 LockingResourceReleaser
decoder(CreateAndInitializeDecoder());
466 ResourceMessageCallParams params
;
467 MockCompletionCallback decode_cb
, get_picture_cb
, uncalled_cb
;
469 // Get to a state where we have a picture to recycle.
470 PpapiHostMsg_VideoDecoder_GetShm
shm_msg(0U, kDecodeBufferSize
);
471 ASSERT_EQ(PP_OK
, CallDecode(decoder
.get(), &decode_cb
, &shm_msg
));
473 uint32_t decode_size
;
475 CheckDecodeMsg(¶ms
, &shm_id
, &decode_size
, &decode_id
);
476 SendDecodeReply(params
, 0U);
477 // Send 'request textures' message to initialize textures.
478 SendRequestTextures(params
);
479 // Call GetPicture and send 'picture ready' message to get a picture to
481 PP_VideoPicture picture
;
482 ASSERT_EQ(PP_OK_COMPLETIONPENDING
,
483 CallGetPicture(decoder
.get(), &picture
, &get_picture_cb
));
484 SendPictureReady(params
, 0U, kTextureId1
);
485 ASSERT_EQ(kTextureId1
, picture
.texture_id
);
487 CallRecyclePicture(decoder
.get(), picture
);
489 ASSERT_TRUE(CheckRecyclePictureMsg(¶ms
, &texture_id
));
490 ASSERT_EQ(kTextureId1
, texture_id
);
492 ClearCallbacks(decoder
.get());
494 #endif // !defined(OS_WIN) || !defined(ARCH_CPU_64_BITS)
496 TEST_F(VideoDecoderResourceTest
, Flush
) {
497 LockingResourceReleaser
decoder(CreateAndInitializeDecoder());
498 ResourceMessageCallParams params
, params2
;
499 MockCompletionCallback flush_cb
, get_picture_cb
, uncalled_cb
;
501 ASSERT_EQ(PP_OK_COMPLETIONPENDING
, CallFlush(decoder
.get(), &flush_cb
));
502 ASSERT_FALSE(flush_cb
.called());
503 ASSERT_TRUE(CheckFlushMsg(¶ms
));
505 ASSERT_EQ(PP_ERROR_FAILED
, CallDecode(decoder
.get(), &uncalled_cb
, NULL
));
506 ASSERT_FALSE(uncalled_cb
.called());
508 // Plugin can call GetPicture while Flush is pending.
509 ASSERT_EQ(PP_OK_COMPLETIONPENDING
,
510 CallGetPicture(decoder
.get(), NULL
, &get_picture_cb
));
511 ASSERT_FALSE(get_picture_cb
.called());
513 ASSERT_EQ(PP_ERROR_INPROGRESS
, CallFlush(decoder
.get(), &uncalled_cb
));
514 ASSERT_FALSE(uncalled_cb
.called());
516 ASSERT_EQ(PP_ERROR_FAILED
, CallReset(decoder
.get(), &uncalled_cb
));
517 ASSERT_FALSE(uncalled_cb
.called());
519 // Plugin can call RecyclePicture while Flush is pending.
520 PP_VideoPicture picture
;
521 picture
.texture_id
= kTextureId1
;
522 CallRecyclePicture(decoder
.get(), picture
);
524 ASSERT_TRUE(CheckRecyclePictureMsg(¶ms2
, &texture_id
));
526 SendFlushReply(params
);
527 // Any pending GetPicture call is aborted.
528 ASSERT_TRUE(get_picture_cb
.called());
529 ASSERT_EQ(PP_ERROR_ABORTED
, get_picture_cb
.result());
530 ASSERT_TRUE(flush_cb
.called());
531 ASSERT_EQ(PP_OK
, flush_cb
.result());
534 // TODO(bbudge) Test Reset when we can run the message loop to get aborted
537 // TODO(bbudge) Fix sync message testing on Windows 64 bit builds. The reply
538 // message for GetShm isn't received, causing Decode to fail.
539 // http://crbug.com/379260
540 #if !defined(OS_WIN) || !defined(ARCH_CPU_64_BITS)
541 TEST_F(VideoDecoderResourceTest
, NotifyError
) {
542 LockingResourceReleaser
decoder(CreateAndInitializeDecoder());
543 ResourceMessageCallParams params
;
544 MockCompletionCallback decode_cb
, get_picture_cb
, uncalled_cb
;
546 // Call Decode and GetPicture to have some pending requests.
547 PpapiHostMsg_VideoDecoder_GetShm
shm_msg(0U, kDecodeBufferSize
);
548 ASSERT_EQ(PP_OK
, CallDecode(decoder
.get(), &decode_cb
, &shm_msg
));
549 ASSERT_FALSE(decode_cb
.called());
550 ASSERT_EQ(PP_OK_COMPLETIONPENDING
,
551 CallGetPicture(decoder
.get(), NULL
, &get_picture_cb
));
552 ASSERT_FALSE(get_picture_cb
.called());
554 // Send the decoder resource an unsolicited notify error message. We first
555 // need to initialize 'params' so the message is routed to the decoder.
557 uint32_t decode_size
;
559 CheckDecodeMsg(¶ms
, &shm_id
, &decode_size
, &decode_id
);
560 SendNotifyError(params
, PP_ERROR_RESOURCE_FAILED
);
562 // Any pending message should be run with the reported error.
563 ASSERT_TRUE(get_picture_cb
.called());
564 ASSERT_EQ(PP_ERROR_RESOURCE_FAILED
, get_picture_cb
.result());
566 // All further calls return the reported error.
567 ASSERT_EQ(PP_ERROR_RESOURCE_FAILED
,
568 CallDecode(decoder
.get(), &uncalled_cb
, NULL
));
569 ASSERT_FALSE(uncalled_cb
.called());
570 ASSERT_EQ(PP_ERROR_RESOURCE_FAILED
,
571 CallGetPicture(decoder
.get(), NULL
, &uncalled_cb
));
572 ASSERT_FALSE(uncalled_cb
.called());
573 ASSERT_EQ(PP_ERROR_RESOURCE_FAILED
, CallFlush(decoder
.get(), &uncalled_cb
));
574 ASSERT_FALSE(uncalled_cb
.called());
575 ASSERT_EQ(PP_ERROR_RESOURCE_FAILED
, CallReset(decoder
.get(), &uncalled_cb
));
576 ASSERT_FALSE(uncalled_cb
.called());
578 #endif // !defined(OS_WIN) || !defined(ARCH_CPU_64_BITS)