mock_codec_buffer_wait_coordinator.cc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2019 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.
  4. #include "media/gpu/android/mock_codec_buffer_wait_coordinator.h"
  5. #include "gpu/command_buffer/service/ref_counted_lock_for_test.h"
  6. #include "gpu/config/gpu_finch_features.h"
  7. namespace media {
  8. using testing::Invoke;
  9. using testing::Return;
  10. MockCodecBufferWaitCoordinator::MockCodecBufferWaitCoordinator(
  11. scoped_refptr<NiceMock<gpu::MockTextureOwner>> texture_owner)
  12. : CodecBufferWaitCoordinator(
  13. texture_owner,
  14. features::NeedThreadSafeAndroidMedia()
  15. ? base::MakeRefCounted<gpu::RefCountedLockForTest>()
  16. : nullptr),
  17. mock_texture_owner(std::move(texture_owner)),
  18. expecting_frame_available(false) {
  19. ON_CALL(*this, texture_owner()).WillByDefault(Return(mock_texture_owner));
  20. ON_CALL(*this, SetReleaseTimeToNow())
  21. .WillByDefault(Invoke(
  22. this, &MockCodecBufferWaitCoordinator::FakeSetReleaseTimeToNow));
  23. ON_CALL(*this, IsExpectingFrameAvailable())
  24. .WillByDefault(Invoke(
  25. this,
  26. &MockCodecBufferWaitCoordinator::FakeIsExpectingFrameAvailable));
  27. ON_CALL(*this, WaitForFrameAvailable())
  28. .WillByDefault(Invoke(
  29. this, &MockCodecBufferWaitCoordinator::FakeWaitForFrameAvailable));
  30. }
  31. MockCodecBufferWaitCoordinator::~MockCodecBufferWaitCoordinator() = default;
  32. } // namespace media