#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "remoting/client/dual_buffer_frame_consumer.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
#include "third_party/webrtc/modules/desktop_capture/shared_desktop_frame.h"
namespace remoting {
namespace {
webrtc::DesktopFrame* GetUnderlyingFrame(
const std::unique_ptr<webrtc::DesktopFrame>& frame) { … }
void FillRGBARect(uint8_t r,
uint8_t g,
uint8_t b,
uint8_t a,
const webrtc::DesktopRect& rect,
webrtc::DesktopFrame* frame) { … }
void CheckFrameColor(uint8_t r,
uint8_t g,
uint8_t b,
uint8_t a,
const webrtc::DesktopVector& pos,
const webrtc::DesktopFrame& frame) { … }
}
class DualBufferFrameConsumerTest : public testing::Test { … };
void DualBufferFrameConsumerTest::SetUp() { … }
void DualBufferFrameConsumerTest::OnFrameReceived(
std::unique_ptr<webrtc::DesktopFrame> frame,
base::OnceClosure done) { … }
TEST_F(DualBufferFrameConsumerTest, AllocateOneFrame) { … }
TEST_F(DualBufferFrameConsumerTest, BufferRotation) { … }
TEST_F(DualBufferFrameConsumerTest, DrawAndMergeFrames) { … }
TEST_F(DualBufferFrameConsumerTest, ChangeScreenSizeAndReallocateBuffers) { … }
}