#include "content/browser/renderer_host/embedded_frame_sink_provider_impl.h"
#include <algorithm>
#include <memory>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "build/build_config.h"
#include "components/viz/common/quads/compositor_frame.h"
#include "components/viz/host/host_frame_sink_manager.h"
#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h"
#include "components/viz/service/frame_sinks/frame_sink_manager_impl.h"
#include "components/viz/test/compositor_frame_helpers.h"
#include "components/viz/test/fake_host_frame_sink_client.h"
#include "components/viz/test/mock_compositor_frame_sink_client.h"
#include "content/browser/renderer_host/embedded_frame_sink_impl.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "services/viz/public/mojom/compositing/compositor_frame_sink.mojom.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/frame_sinks/embedded_frame_sink.mojom.h"
#include "ui/compositor/compositor.h"
#if !BUILDFLAG(IS_ANDROID)
#include "content/browser/compositor/image_transport_factory.h"
#endif
ElementsAre;
IsEmpty;
namespace content {
namespace {
constexpr uint32_t kRendererSinkIdStart = …;
constexpr uint32_t kRendererClientId = …;
constexpr viz::FrameSinkId kFrameSinkParent(kRendererClientId,
kRendererSinkIdStart);
constexpr viz::FrameSinkId kFrameSinkA(kRendererClientId,
kRendererSinkIdStart + 2);
constexpr viz::FrameSinkId kFrameSinkB(kRendererClientId,
kRendererSinkIdStart + 4);
template <class T>
void WaitForConnectionError(T* endpoint) { … }
class StubEmbeddedFrameSinkClient
: public blink::mojom::EmbeddedFrameSinkClient,
public blink::mojom::SurfaceEmbedder { … };
}
class EmbeddedFrameSinkProviderImplTest : public testing::Test { … };
TEST_F(EmbeddedFrameSinkProviderImplTest,
SingleHTMLCanvasElementTransferToOffscreen) { … }
TEST_F(EmbeddedFrameSinkProviderImplTest, ClientClosesConnection) { … }
TEST_F(EmbeddedFrameSinkProviderImplTest, ProviderClosesConnections) { … }
TEST_F(EmbeddedFrameSinkProviderImplTest, ClientConnectionWrongOrder) { … }
TEST_F(EmbeddedFrameSinkProviderImplTest, ParentNotRegistered) { … }
TEST_F(EmbeddedFrameSinkProviderImplTest, InvalidClientId) { … }
TEST_F(EmbeddedFrameSinkProviderImplTest,
MultiHTMLCanvasElementTransferToOffscreen) { … }
TEST_F(EmbeddedFrameSinkProviderImplTest, RegisterFrameSinkHierarchy) { … }
}