Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(645)

Unified Diff: services/ui/ws/frame_generator_unittest.cc

Issue 2453013002: Mus: Remove dependency on ServerWindowCompositorFrameSink from FrameGenerator (Closed)
Patch Set: Rebased Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/ws/frame_generator.cc ('k') | services/ui/ws/server_window_compositor_frame_sink.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/frame_generator_unittest.cc
diff --git a/services/ui/ws/frame_generator_unittest.cc b/services/ui/ws/frame_generator_unittest.cc
index b30a6aa6fc721ee8a998e697a03be82ff47cf6dc..a561cb0b7fa81faa79de6ec18ed6c9adceedd047 100644
--- a/services/ui/ws/frame_generator_unittest.cc
+++ b/services/ui/ws/frame_generator_unittest.cc
@@ -31,10 +31,14 @@ void InitWindow(ServerWindow* window) {
window->SetVisible(true);
ServerWindowCompositorFrameSinkManager* compositor_frame_sink_manager =
window->GetOrCreateCompositorFrameSinkManager();
- compositor_frame_sink_manager->CreateCompositorFrameSink(
+ compositor_frame_sink_manager->SetLatestSurfaceInfo(
mojom::CompositorFrameSinkType::DEFAULT,
- mojo::InterfaceRequest<cc::mojom::MojoCompositorFrameSink>(),
- cc::mojom::MojoCompositorFrameSinkClientPtr());
+ cc::SurfaceId(
+ cc::FrameSinkId(
+ WindowIdToTransportId(window->id()),
+ static_cast<uint32_t>(mojom::CompositorFrameSinkType::DEFAULT)),
+ cc::LocalFrameId(1u, 1u)),
+ gfx::Size(100, 100));
}
} // namespace
@@ -74,9 +78,8 @@ class FrameGeneratorTest : public testing::Test {
};
void FrameGeneratorTest::DrawWindowTree(cc::RenderPass* pass) {
- frame_generator_->DrawWindowTree(pass,
- frame_generator_delegate_->GetRootWindow(),
- gfx::Vector2d(), 1.0f, nullptr);
+ frame_generator_->DrawWindowTree(
+ pass, frame_generator_delegate_->GetRootWindow(), gfx::Vector2d(), 1.0f);
}
void FrameGeneratorTest::SetUp() {
@@ -120,13 +123,16 @@ TEST_F(FrameGeneratorTest, DrawWindowTree) {
// which should be a product of the child and the parent opacity.
EXPECT_EQ(child_opacity * root_opacity, child_sqs->opacity);
- // Create the UNDERLAY Surface for the child window, and confirm that this
- // creates an extra SharedQuadState in the CompositorFrame.
- child_window.GetOrCreateCompositorFrameSinkManager()
- ->CreateCompositorFrameSink(
- mojom::CompositorFrameSinkType::UNDERLAY,
- cc::mojom::MojoCompositorFrameSinkRequest(),
- cc::mojom::MojoCompositorFrameSinkClientPtr());
+ // Pretend to create the UNDERLAY Surface for the child window, and confirm
+ // that this creates an extra SharedQuadState in the CompositorFrame.
+ child_window.GetOrCreateCompositorFrameSinkManager()->SetLatestSurfaceInfo(
+ mojom::CompositorFrameSinkType::UNDERLAY,
+ cc::SurfaceId(
+ cc::FrameSinkId(
+ WindowIdToTransportId(child_window.id()),
+ static_cast<uint32_t>(mojom::CompositorFrameSinkType::UNDERLAY)),
+ cc::LocalFrameId(1u, 1u)),
+ gfx::Size(100, 100));
render_pass = cc::RenderPass::Create();
DrawWindowTree(render_pass.get());
« no previous file with comments | « services/ui/ws/frame_generator.cc ('k') | services/ui/ws/server_window_compositor_frame_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698