blob: 8f687beb3d176a43f90d898eab5323f2478a264e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/gpu/android/mock_codec_buffer_wait_coordinator.h"
#include "gpu/command_buffer/service/ref_counted_lock_for_test.h"
#include "gpu/config/gpu_finch_features.h"
namespace media {
using testing::Invoke;
using testing::Return;
MockCodecBufferWaitCoordinator::MockCodecBufferWaitCoordinator(
scoped_refptr<NiceMock<gpu::MockTextureOwner>> texture_owner)
: CodecBufferWaitCoordinator(
texture_owner,
features::NeedThreadSafeAndroidMedia()
? base::MakeRefCounted<gpu::RefCountedLockForTest>()
: nullptr),
mock_texture_owner(std::move(texture_owner)),
expecting_frame_available(false) {
ON_CALL(*this, texture_owner()).WillByDefault(Return(mock_texture_owner));
ON_CALL(*this, SetReleaseTimeToNow())
.WillByDefault(Invoke(
this, &MockCodecBufferWaitCoordinator::FakeSetReleaseTimeToNow));
ON_CALL(*this, IsExpectingFrameAvailable())
.WillByDefault(Invoke(
this,
&MockCodecBufferWaitCoordinator::FakeIsExpectingFrameAvailable));
ON_CALL(*this, WaitForFrameAvailable())
.WillByDefault(Invoke(
this, &MockCodecBufferWaitCoordinator::FakeWaitForFrameAvailable));
}
MockCodecBufferWaitCoordinator::~MockCodecBufferWaitCoordinator() = default;
} // namespace media
|