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

Side by Side Diff: services/ui/ws/window_tree_client_unittest.cc

Issue 2449853004: Getting rid of DelegatedFrameData (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 2139 matching lines...) Expand 10 before | Expand all | Expand 10 after
2150 2150
2151 // Submit a CompositorFrame to window_2_101 and make sure server gets it. 2151 // Submit a CompositorFrame to window_2_101 and make sure server gets it.
2152 cc::mojom::MojoCompositorFrameSinkPtr surface_ptr; 2152 cc::mojom::MojoCompositorFrameSinkPtr surface_ptr;
2153 cc::mojom::MojoCompositorFrameSinkClientRequest client_request; 2153 cc::mojom::MojoCompositorFrameSinkClientRequest client_request;
2154 cc::mojom::MojoCompositorFrameSinkClientPtr surface_client_ptr; 2154 cc::mojom::MojoCompositorFrameSinkClientPtr surface_client_ptr;
2155 client_request = mojo::GetProxy(&surface_client_ptr); 2155 client_request = mojo::GetProxy(&surface_client_ptr);
2156 wt2()->AttachCompositorFrameSink( 2156 wt2()->AttachCompositorFrameSink(
2157 window_2_101, mojom::CompositorFrameSinkType::DEFAULT, 2157 window_2_101, mojom::CompositorFrameSinkType::DEFAULT,
2158 mojo::GetProxy(&surface_ptr), std::move(surface_client_ptr)); 2158 mojo::GetProxy(&surface_ptr), std::move(surface_client_ptr));
2159 cc::CompositorFrame compositor_frame; 2159 cc::CompositorFrame compositor_frame;
2160 compositor_frame.delegated_frame_data =
2161 base::MakeUnique<cc::DelegatedFrameData>();
2162 std::unique_ptr<cc::RenderPass> render_pass = cc::RenderPass::Create(); 2160 std::unique_ptr<cc::RenderPass> render_pass = cc::RenderPass::Create();
2163 gfx::Rect frame_rect(0, 0, 100, 100); 2161 gfx::Rect frame_rect(0, 0, 100, 100);
2164 render_pass->SetNew(cc::RenderPassId(1, 1), frame_rect, frame_rect, 2162 render_pass->SetNew(cc::RenderPassId(1, 1), frame_rect, frame_rect,
2165 gfx::Transform()); 2163 gfx::Transform());
2166 compositor_frame.delegated_frame_data->render_pass_list.push_back( 2164 compositor_frame.render_pass_list.push_back(std::move(render_pass));
2167 std::move(render_pass));
2168 surface_ptr->SubmitCompositorFrame(std::move(compositor_frame)); 2165 surface_ptr->SubmitCompositorFrame(std::move(compositor_frame));
2169 // Make sure the parent connection gets the surface ID. 2166 // Make sure the parent connection gets the surface ID.
2170 wt_client1()->WaitForChangeCount(1); 2167 wt_client1()->WaitForChangeCount(1);
2171 // Verify that the submitted frame is for |window_2_101|. 2168 // Verify that the submitted frame is for |window_2_101|.
2172 EXPECT_EQ(window_2_101_in_ws1, 2169 EXPECT_EQ(window_2_101_in_ws1,
2173 changes1()->back().surface_id.frame_sink_id().client_id()); 2170 changes1()->back().surface_id.frame_sink_id().client_id());
2174 } 2171 }
2175 2172
2176 // TODO(sky): need to better track changes to initial client. For example, 2173 // TODO(sky): need to better track changes to initial client. For example,
2177 // that SetBounsdWindows/AddWindow and the like don't result in messages to the 2174 // that SetBounsdWindows/AddWindow and the like don't result in messages to the
2178 // originating client. 2175 // originating client.
2179 2176
2180 // TODO(sky): make sure coverage of what was 2177 // TODO(sky): make sure coverage of what was
2181 // WindowManagerTest.SecondEmbedRoot_InitService and 2178 // WindowManagerTest.SecondEmbedRoot_InitService and
2182 // WindowManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window 2179 // WindowManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window
2183 // manager 2180 // manager
2184 // tests. 2181 // tests.
2185 2182
2186 } // namespace test 2183 } // namespace test
2187 } // namespace ws 2184 } // namespace ws
2188 } // namespace ui 2185 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698