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_Bool kAllowSoftwareFallback
= PP_TRUE
;
30 const PP_Resource kGraphics3D
= 7;
31 const uint32_t kShmSize
= 256;
32 const size_t kDecodeBufferSize
= 16;
33 const uint32_t kDecodeId
= 5;
34 const uint32_t kTextureId1
= 1;
35 const uint32_t kTextureId2
= 2;
36 const uint32_t kNumRequestedTextures
= 2;
38 class MockCompletionCallback
{
40 MockCompletionCallback() : called_(false) {}
42 bool called() { return called_
; }
43 int32_t result() { return result_
; }
45 void Reset() { called_
= false; }
47 static void Callback(void* user_data
, int32_t result
) {
48 MockCompletionCallback
* that
=
49 reinterpret_cast<MockCompletionCallback
*>(user_data
);
51 that
->result_
= result
;
59 class VideoDecoderResourceTest
: public PluginProxyTest
{
61 VideoDecoderResourceTest()
62 : decoder_iface_(thunk::GetPPB_VideoDecoder_0_1_Thunk()) {}
64 const PPB_VideoDecoder_0_1
* decoder_iface() const { return decoder_iface_
; }
66 void SendReply(const ResourceMessageCallParams
& params
,
68 const IPC::Message
& nested_message
) {
69 ResourceMessageReplyParams
reply_params(params
.pp_resource(),
71 reply_params
.set_result(result
);
72 PluginMessageFilter::DispatchResourceReplyForTest(reply_params
,
76 void SendReplyWithHandle(const ResourceMessageCallParams
& params
,
78 const IPC::Message
& nested_message
,
79 const SerializedHandle
& handle
) {
80 ResourceMessageReplyParams
reply_params(params
.pp_resource(),
82 reply_params
.set_result(result
);
83 reply_params
.AppendHandle(handle
);
84 PluginMessageFilter::DispatchResourceReplyForTest(reply_params
,
88 PP_Resource
CreateDecoder() {
89 PP_Resource result
= decoder_iface()->Create(pp_instance());
92 ppapi::Resource
* resource
=
93 GetGlobals()->GetResourceTracker()->GetResource(result
);
94 proxy::VideoDecoderResource
* decoder
=
95 static_cast<proxy::VideoDecoderResource
*>(resource
);
96 decoder
->SetForTest();
102 PP_Resource
CreateGraphics3d() {
105 HostResource host_resource
;
106 host_resource
.SetHostResource(pp_instance(), kGraphics3D
);
107 scoped_refptr
<ppapi::proxy::Graphics3D
> graphics_3d(
108 new ppapi::proxy::Graphics3D(host_resource
));
109 return graphics_3d
->GetReference();
112 PP_Resource
CreateAndInitializeDecoder() {
113 PP_Resource decoder
= CreateDecoder();
114 LockingResourceReleaser
graphics3d(CreateGraphics3d());
115 MockCompletionCallback cb
;
116 int32_t result
= decoder_iface()->Initialize(
119 PP_VIDEOPROFILE_H264MAIN
,
120 PP_TRUE
/* allow_software_fallback */,
121 PP_MakeOptionalCompletionCallback(&MockCompletionCallback::Callback
,
123 if (result
!= PP_OK_COMPLETIONPENDING
)
125 ResourceMessageCallParams params
;
127 if (!sink().GetFirstResourceCallMatching(
128 PpapiHostMsg_VideoDecoder_Initialize::ID
, ¶ms
, &msg
))
130 sink().ClearMessages();
131 SendReply(params
, PP_OK
, PpapiPluginMsg_VideoDecoder_InitializeReply());
135 int32_t CallDecode(PP_Resource pp_decoder
,
136 MockCompletionCallback
* cb
,
137 const PpapiHostMsg_VideoDecoder_GetShm
* expected_shm_msg
) {
138 // Set up a handler in case the resource sends a sync message to create
140 PpapiPluginMsg_VideoDecoder_GetShmReply
shm_msg_reply(kShmSize
);
141 ResourceSyncCallHandler
shm_msg_handler(
142 &sink(), PpapiHostMsg_VideoDecoder_GetShm::ID
, PP_OK
, shm_msg_reply
);
143 sink().AddFilter(&shm_msg_handler
);
145 base::SharedMemory shm
;
146 if (expected_shm_msg
) {
147 shm
.CreateAnonymous(kShmSize
);
148 base::SharedMemoryHandle shm_handle
;
149 shm
.ShareToProcess(base::GetCurrentProcessHandle(), &shm_handle
);
150 SerializedHandle
serialized_handle(shm_handle
, kShmSize
);
151 shm_msg_handler
.set_serialized_handle(&serialized_handle
);
154 memset(decode_buffer_
, 0x55, kDecodeBufferSize
);
156 decoder_iface()->Decode(pp_decoder
,
160 PP_MakeOptionalCompletionCallback(
161 &MockCompletionCallback::Callback
, cb
));
163 if (expected_shm_msg
) {
164 uint32_t shm_id
, shm_size
, expected_shm_id
, expected_shm_size
;
165 UnpackMessage
<PpapiHostMsg_VideoDecoder_GetShm
>(
166 *expected_shm_msg
, &expected_shm_id
, &expected_shm_size
);
167 if (shm_msg_handler
.last_handled_msg().type() == 0 ||
168 !UnpackMessage
<PpapiHostMsg_VideoDecoder_GetShm
>(
169 shm_msg_handler
.last_handled_msg(), &shm_id
, &shm_size
) ||
170 shm_id
!= expected_shm_id
||
171 shm_size
!= expected_shm_size
) {
172 // Signal that the expected shm message wasn't sent by failing.
173 result
= PP_ERROR_FAILED
;
177 sink().RemoveFilter(&shm_msg_handler
);
181 int32_t CallGetPicture(PP_Resource pp_decoder
,
182 PP_VideoPicture
* picture
,
183 MockCompletionCallback
* cb
) {
185 decoder_iface()->GetPicture(pp_decoder
,
187 PP_MakeOptionalCompletionCallback(
188 &MockCompletionCallback::Callback
, cb
));
192 void CallRecyclePicture(PP_Resource pp_decoder
,
193 const PP_VideoPicture
& picture
) {
194 decoder_iface()->RecyclePicture(pp_decoder
, &picture
);
197 int32_t CallFlush(PP_Resource pp_decoder
, MockCompletionCallback
* cb
) {
199 decoder_iface()->Flush(pp_decoder
,
200 PP_MakeOptionalCompletionCallback(
201 &MockCompletionCallback::Callback
, cb
));
205 int32_t CallReset(PP_Resource pp_decoder
, MockCompletionCallback
* cb
) {
207 decoder_iface()->Reset(pp_decoder
,
208 PP_MakeOptionalCompletionCallback(
209 &MockCompletionCallback::Callback
, cb
));
213 void SendDecodeReply(const ResourceMessageCallParams
& params
,
215 SendReply(params
, PP_OK
, PpapiPluginMsg_VideoDecoder_DecodeReply(shm_id
));
218 void SendPictureReady(const ResourceMessageCallParams
& params
,
219 uint32_t decode_count
,
220 uint32_t texture_id
) {
224 PpapiPluginMsg_VideoDecoder_PictureReady(decode_count
, texture_id
));
227 void SendFlushReply(const ResourceMessageCallParams
& params
) {
228 SendReply(params
, PP_OK
, PpapiPluginMsg_VideoDecoder_FlushReply());
231 void SendResetReply(const ResourceMessageCallParams
& params
) {
232 SendReply(params
, PP_OK
, PpapiPluginMsg_VideoDecoder_ResetReply());
235 void SendRequestTextures(const ResourceMessageCallParams
& params
) {
238 PpapiPluginMsg_VideoDecoder_RequestTextures(
239 kNumRequestedTextures
, PP_MakeSize(320, 240), GL_TEXTURE_2D
));
242 void SendNotifyError(const ResourceMessageCallParams
& params
, int32_t error
) {
243 SendReply(params
, PP_OK
, PpapiPluginMsg_VideoDecoder_NotifyError(error
));
246 bool CheckDecodeMsg(ResourceMessageCallParams
* params
,
249 int32_t* decode_id
) {
251 if (!sink().GetFirstResourceCallMatching(
252 PpapiHostMsg_VideoDecoder_Decode::ID
, params
, &msg
))
254 sink().ClearMessages();
255 return UnpackMessage
<PpapiHostMsg_VideoDecoder_Decode
>(
256 msg
, shm_id
, size
, decode_id
);
259 bool CheckRecyclePictureMsg(ResourceMessageCallParams
* params
,
260 uint32_t* texture_id
) {
262 if (!sink().GetFirstResourceCallMatching(
263 PpapiHostMsg_VideoDecoder_RecyclePicture::ID
, params
, &msg
))
265 sink().ClearMessages();
266 return UnpackMessage
<PpapiHostMsg_VideoDecoder_RecyclePicture
>(msg
,
270 bool CheckFlushMsg(ResourceMessageCallParams
* params
) {
271 return CheckMsg(params
, PpapiHostMsg_VideoDecoder_Flush::ID
);
274 bool CheckResetMsg(ResourceMessageCallParams
* params
) {
275 return CheckMsg(params
, PpapiHostMsg_VideoDecoder_Reset::ID
);
278 void ClearCallbacks(PP_Resource pp_decoder
) {
279 ResourceMessageCallParams params
;
280 MockCompletionCallback cb
;
282 // Reset to abort Decode and GetPicture callbacks.
283 CallReset(pp_decoder
, &cb
);
284 // Initialize params so we can reply to the Reset.
285 CheckResetMsg(¶ms
);
286 // Run the Reset callback.
287 SendResetReply(params
);
291 bool CheckMsg(ResourceMessageCallParams
* params
, int id
) {
293 if (!sink().GetFirstResourceCallMatching(id
, params
, &msg
))
295 sink().ClearMessages();
299 const PPB_VideoDecoder_0_1
* decoder_iface_
;
301 char decode_buffer_
[kDecodeBufferSize
];
306 TEST_F(VideoDecoderResourceTest
, Initialize
) {
307 // Initialize with 0 graphics3d_context should fail.
309 LockingResourceReleaser
decoder(CreateDecoder());
310 MockCompletionCallback cb
;
311 int32_t result
= decoder_iface()->Initialize(
313 0 /* invalid 3d graphics */,
314 PP_VIDEOPROFILE_H264MAIN
,
315 kAllowSoftwareFallback
,
316 PP_MakeOptionalCompletionCallback(&MockCompletionCallback::Callback
,
318 ASSERT_EQ(PP_ERROR_BADRESOURCE
, result
);
320 // Initialize with bad profile value should fail.
322 LockingResourceReleaser
decoder(CreateDecoder());
323 MockCompletionCallback cb
;
324 int32_t result
= decoder_iface()->Initialize(
326 1 /* non-zero resource */,
327 static_cast<PP_VideoProfile
>(-1),
328 kAllowSoftwareFallback
,
329 PP_MakeOptionalCompletionCallback(&MockCompletionCallback::Callback
,
331 ASSERT_EQ(PP_ERROR_BADARGUMENT
, result
);
333 // Initialize with valid graphics3d_context and profile should succeed.
335 LockingResourceReleaser
decoder(CreateDecoder());
336 LockingResourceReleaser
graphics3d(CreateGraphics3d());
337 MockCompletionCallback cb
;
338 int32_t result
= decoder_iface()->Initialize(
341 PP_VIDEOPROFILE_H264MAIN
,
342 kAllowSoftwareFallback
,
343 PP_MakeOptionalCompletionCallback(&MockCompletionCallback::Callback
,
345 ASSERT_EQ(PP_OK_COMPLETIONPENDING
, result
);
346 ASSERT_TRUE(decoder_iface()->IsVideoDecoder(decoder
.get()));
348 // Another attempt while pending should fail.
349 result
= decoder_iface()->Initialize(
352 PP_VIDEOPROFILE_H264MAIN
,
353 kAllowSoftwareFallback
,
354 PP_MakeOptionalCompletionCallback(&MockCompletionCallback::Callback
,
356 ASSERT_EQ(PP_ERROR_INPROGRESS
, result
);
358 // Check for host message and send a reply to complete initialization.
359 ResourceMessageCallParams params
;
361 ASSERT_TRUE(sink().GetFirstResourceCallMatching(
362 PpapiHostMsg_VideoDecoder_Initialize::ID
, ¶ms
, &msg
));
363 sink().ClearMessages();
364 SendReply(params
, PP_OK
, PpapiPluginMsg_VideoDecoder_InitializeReply());
365 ASSERT_TRUE(cb
.called());
366 ASSERT_EQ(PP_OK
, cb
.result());
370 TEST_F(VideoDecoderResourceTest
, Uninitialized
) {
371 // Operations on uninitialized decoders should fail.
372 LockingResourceReleaser
decoder(CreateDecoder());
373 MockCompletionCallback uncalled_cb
;
375 ASSERT_EQ(PP_ERROR_FAILED
, CallDecode(decoder
.get(), &uncalled_cb
, NULL
));
376 ASSERT_FALSE(uncalled_cb
.called());
378 ASSERT_EQ(PP_ERROR_FAILED
, CallGetPicture(decoder
.get(), NULL
, &uncalled_cb
));
379 ASSERT_FALSE(uncalled_cb
.called());
381 ASSERT_EQ(PP_ERROR_FAILED
, CallFlush(decoder
.get(), &uncalled_cb
));
382 ASSERT_FALSE(uncalled_cb
.called());
384 ASSERT_EQ(PP_ERROR_FAILED
, CallReset(decoder
.get(), &uncalled_cb
));
385 ASSERT_FALSE(uncalled_cb
.called());
388 // TODO(bbudge) Fix sync message testing on Windows 64 bit builds. The reply
389 // message for GetShm isn't received, causing Decode to fail.
390 // http://crbug.com/379260
391 #if !defined(OS_WIN) || !defined(ARCH_CPU_64_BITS)
392 TEST_F(VideoDecoderResourceTest
, DecodeAndGetPicture
) {
393 LockingResourceReleaser
decoder(CreateAndInitializeDecoder());
394 ResourceMessageCallParams params
, params2
;
395 MockCompletionCallback decode_cb
, get_picture_cb
, uncalled_cb
;
398 uint32_t decode_size
;
400 // Call Decode until we have the maximum pending, minus one.
401 for (uint32_t i
= 0; i
< kMaximumPendingDecodes
- 1; i
++) {
402 PpapiHostMsg_VideoDecoder_GetShm
shm_msg(i
, kDecodeBufferSize
);
403 ASSERT_EQ(PP_OK
, CallDecode(decoder
.get(), &uncalled_cb
, &shm_msg
));
404 ASSERT_FALSE(uncalled_cb
.called());
405 CheckDecodeMsg(¶ms
, &shm_id
, &decode_size
, &decode_id
);
406 ASSERT_EQ(i
, shm_id
);
407 ASSERT_EQ(kDecodeBufferSize
, decode_size
);
408 // The resource generates uids internally, starting at 1.
410 ASSERT_EQ(uid
, decode_id
);
412 // Once we've allocated the maximum number of buffers, we must wait.
413 PpapiHostMsg_VideoDecoder_GetShm
shm_msg(7U, kDecodeBufferSize
);
414 ASSERT_EQ(PP_OK_COMPLETIONPENDING
,
415 CallDecode(decoder
.get(), &decode_cb
, &shm_msg
));
416 CheckDecodeMsg(¶ms
, &shm_id
, &decode_size
, &decode_id
);
417 ASSERT_EQ(7U, shm_id
);
418 ASSERT_EQ(kDecodeBufferSize
, decode_size
);
420 // Calling Decode when another Decode is pending should fail.
421 ASSERT_EQ(PP_ERROR_INPROGRESS
, CallDecode(decoder
.get(), &uncalled_cb
, NULL
));
422 ASSERT_FALSE(uncalled_cb
.called());
423 // Free up the first decode buffer.
424 SendDecodeReply(params
, 0U);
425 // The decoder should run the pending callback.
426 ASSERT_TRUE(decode_cb
.called());
427 ASSERT_EQ(PP_OK
, decode_cb
.result());
430 // Now try to get a picture. No picture ready message has been received yet.
431 PP_VideoPicture picture
;
432 ASSERT_EQ(PP_OK_COMPLETIONPENDING
,
433 CallGetPicture(decoder
.get(), &picture
, &get_picture_cb
));
434 ASSERT_FALSE(get_picture_cb
.called());
435 // Calling GetPicture when another GetPicture is pending should fail.
436 ASSERT_EQ(PP_ERROR_INPROGRESS
,
437 CallGetPicture(decoder
.get(), &picture
, &uncalled_cb
));
438 ASSERT_FALSE(uncalled_cb
.called());
439 // Send 'request textures' message to initialize textures.
440 SendRequestTextures(params
);
441 // Send a picture ready message for Decode call 1. The GetPicture callback
443 SendPictureReady(params
, 1U, kTextureId1
);
444 ASSERT_TRUE(get_picture_cb
.called());
445 ASSERT_EQ(PP_OK
, get_picture_cb
.result());
446 ASSERT_EQ(kDecodeId
, picture
.decode_id
);
447 get_picture_cb
.Reset();
449 // Send a picture ready message for Decode call 2. Since there is no pending
450 // GetPicture call, the picture should be queued.
451 SendPictureReady(params
, 2U, kTextureId2
);
452 // The next GetPicture should return synchronously.
453 ASSERT_EQ(PP_OK
, CallGetPicture(decoder
.get(), &picture
, &uncalled_cb
));
454 ASSERT_FALSE(uncalled_cb
.called());
455 ASSERT_EQ(kDecodeId
, picture
.decode_id
);
457 #endif // !defined(OS_WIN) || !defined(ARCH_CPU_64_BITS)
459 // TODO(bbudge) Fix sync message testing on Windows 64 bit builds. The reply
460 // message for GetShm isn't received, causing Decode to fail.
461 // http://crbug.com/379260
462 #if !defined(OS_WIN) || !defined(ARCH_CPU_64_BITS)
463 TEST_F(VideoDecoderResourceTest
, RecyclePicture
) {
464 LockingResourceReleaser
decoder(CreateAndInitializeDecoder());
465 ResourceMessageCallParams params
;
466 MockCompletionCallback decode_cb
, get_picture_cb
, uncalled_cb
;
468 // Get to a state where we have a picture to recycle.
469 PpapiHostMsg_VideoDecoder_GetShm
shm_msg(0U, kDecodeBufferSize
);
470 ASSERT_EQ(PP_OK
, CallDecode(decoder
.get(), &decode_cb
, &shm_msg
));
472 uint32_t decode_size
;
474 CheckDecodeMsg(¶ms
, &shm_id
, &decode_size
, &decode_id
);
475 SendDecodeReply(params
, 0U);
476 // Send 'request textures' message to initialize textures.
477 SendRequestTextures(params
);
478 // Call GetPicture and send 'picture ready' message to get a picture to
480 PP_VideoPicture picture
;
481 ASSERT_EQ(PP_OK_COMPLETIONPENDING
,
482 CallGetPicture(decoder
.get(), &picture
, &get_picture_cb
));
483 SendPictureReady(params
, 0U, kTextureId1
);
484 ASSERT_EQ(kTextureId1
, picture
.texture_id
);
486 CallRecyclePicture(decoder
.get(), picture
);
488 ASSERT_TRUE(CheckRecyclePictureMsg(¶ms
, &texture_id
));
489 ASSERT_EQ(kTextureId1
, texture_id
);
491 ClearCallbacks(decoder
.get());
493 #endif // !defined(OS_WIN) || !defined(ARCH_CPU_64_BITS)
495 TEST_F(VideoDecoderResourceTest
, Flush
) {
496 LockingResourceReleaser
decoder(CreateAndInitializeDecoder());
497 ResourceMessageCallParams params
, params2
;
498 MockCompletionCallback flush_cb
, get_picture_cb
, uncalled_cb
;
500 ASSERT_EQ(PP_OK_COMPLETIONPENDING
, CallFlush(decoder
.get(), &flush_cb
));
501 ASSERT_FALSE(flush_cb
.called());
502 ASSERT_TRUE(CheckFlushMsg(¶ms
));
504 ASSERT_EQ(PP_ERROR_FAILED
, CallDecode(decoder
.get(), &uncalled_cb
, NULL
));
505 ASSERT_FALSE(uncalled_cb
.called());
507 // Plugin can call GetPicture while Flush is pending.
508 ASSERT_EQ(PP_OK_COMPLETIONPENDING
,
509 CallGetPicture(decoder
.get(), NULL
, &get_picture_cb
));
510 ASSERT_FALSE(get_picture_cb
.called());
512 ASSERT_EQ(PP_ERROR_INPROGRESS
, CallFlush(decoder
.get(), &uncalled_cb
));
513 ASSERT_FALSE(uncalled_cb
.called());
515 ASSERT_EQ(PP_ERROR_FAILED
, CallReset(decoder
.get(), &uncalled_cb
));
516 ASSERT_FALSE(uncalled_cb
.called());
518 // Plugin can call RecyclePicture while Flush is pending.
519 PP_VideoPicture picture
;
520 picture
.texture_id
= kTextureId1
;
521 CallRecyclePicture(decoder
.get(), picture
);
523 ASSERT_TRUE(CheckRecyclePictureMsg(¶ms2
, &texture_id
));
525 SendFlushReply(params
);
526 // Any pending GetPicture call is aborted.
527 ASSERT_TRUE(get_picture_cb
.called());
528 ASSERT_EQ(PP_ERROR_ABORTED
, get_picture_cb
.result());
529 ASSERT_TRUE(flush_cb
.called());
530 ASSERT_EQ(PP_OK
, flush_cb
.result());
533 // TODO(bbudge) Test Reset when we can run the message loop to get aborted
536 // TODO(bbudge) Fix sync message testing on Windows 64 bit builds. The reply
537 // message for GetShm isn't received, causing Decode to fail.
538 // http://crbug.com/379260
539 #if !defined(OS_WIN) || !defined(ARCH_CPU_64_BITS)
540 TEST_F(VideoDecoderResourceTest
, NotifyError
) {
541 LockingResourceReleaser
decoder(CreateAndInitializeDecoder());
542 ResourceMessageCallParams params
;
543 MockCompletionCallback decode_cb
, get_picture_cb
, uncalled_cb
;
545 // Call Decode and GetPicture to have some pending requests.
546 PpapiHostMsg_VideoDecoder_GetShm
shm_msg(0U, kDecodeBufferSize
);
547 ASSERT_EQ(PP_OK
, CallDecode(decoder
.get(), &decode_cb
, &shm_msg
));
548 ASSERT_FALSE(decode_cb
.called());
549 ASSERT_EQ(PP_OK_COMPLETIONPENDING
,
550 CallGetPicture(decoder
.get(), NULL
, &get_picture_cb
));
551 ASSERT_FALSE(get_picture_cb
.called());
553 // Send the decoder resource an unsolicited notify error message. We first
554 // need to initialize 'params' so the message is routed to the decoder.
556 uint32_t decode_size
;
558 CheckDecodeMsg(¶ms
, &shm_id
, &decode_size
, &decode_id
);
559 SendNotifyError(params
, PP_ERROR_RESOURCE_FAILED
);
561 // Any pending message should be run with the reported error.
562 ASSERT_TRUE(get_picture_cb
.called());
563 ASSERT_EQ(PP_ERROR_RESOURCE_FAILED
, get_picture_cb
.result());
565 // All further calls return the reported error.
566 ASSERT_EQ(PP_ERROR_RESOURCE_FAILED
,
567 CallDecode(decoder
.get(), &uncalled_cb
, NULL
));
568 ASSERT_FALSE(uncalled_cb
.called());
569 ASSERT_EQ(PP_ERROR_RESOURCE_FAILED
,
570 CallGetPicture(decoder
.get(), NULL
, &uncalled_cb
));
571 ASSERT_FALSE(uncalled_cb
.called());
572 ASSERT_EQ(PP_ERROR_RESOURCE_FAILED
, CallFlush(decoder
.get(), &uncalled_cb
));
573 ASSERT_FALSE(uncalled_cb
.called());
574 ASSERT_EQ(PP_ERROR_RESOURCE_FAILED
, CallReset(decoder
.get(), &uncalled_cb
));
575 ASSERT_FALSE(uncalled_cb
.called());
577 #endif // !defined(OS_WIN) || !defined(ARCH_CPU_64_BITS)