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

Side by Side Diff: content/browser/frame_host/render_widget_host_view_guest_unittest.cc

Issue 2755463002: [cc] Fix CompositorFrameSinkSupport BeginFrameAck interface. (Closed)
Patch Set: sync Created 3 years, 9 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 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 "content/browser/frame_host/render_widget_host_view_guest.h" 5 #include "content/browser/frame_host/render_widget_host_view_guest.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 private: 210 private:
211 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewGuestSurfaceTest); 211 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewGuestSurfaceTest);
212 }; 212 };
213 213
214 namespace { 214 namespace {
215 cc::CompositorFrame CreateDelegatedFrame(float scale_factor, 215 cc::CompositorFrame CreateDelegatedFrame(float scale_factor,
216 gfx::Size size, 216 gfx::Size size,
217 const gfx::Rect& damage) { 217 const gfx::Rect& damage) {
218 cc::CompositorFrame frame; 218 cc::CompositorFrame frame;
219 frame.metadata.device_scale_factor = scale_factor; 219 frame.metadata.device_scale_factor = scale_factor;
220 frame.metadata.begin_frame_ack = cc::BeginFrameAck(0, 1, 1, 0, true);
220 221
221 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create(); 222 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create();
222 pass->SetNew(1, gfx::Rect(size), damage, gfx::Transform()); 223 pass->SetNew(1, gfx::Rect(size), damage, gfx::Transform());
223 frame.render_pass_list.push_back(std::move(pass)); 224 frame.render_pass_list.push_back(std::move(pass));
224 return frame; 225 return frame;
225 } 226 }
226 } // anonymous namespace 227 } // anonymous namespace
227 228
228 TEST_F(RenderWidgetHostViewGuestSurfaceTest, TestGuestSurface) { 229 TEST_F(RenderWidgetHostViewGuestSurfaceTest, TestGuestSurface) {
229 gfx::Size view_size(100, 100); 230 gfx::Size view_size(100, 100);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 288
288 view_->OnSwapCompositorFrame( 289 view_->OnSwapCompositorFrame(
289 0, local_surface_id, 290 0, local_surface_id,
290 CreateDelegatedFrame(scale_factor, view_size, view_rect)); 291 CreateDelegatedFrame(scale_factor, view_size, view_rect));
291 // Since guest is not attached, the CompositorFrame must be processed but the 292 // Since guest is not attached, the CompositorFrame must be processed but the
292 // frame must be evicted to return the resources immediately. 293 // frame must be evicted to return the resources immediately.
293 EXPECT_FALSE(view_->has_frame()); 294 EXPECT_FALSE(view_->has_frame());
294 } 295 }
295 296
296 } // namespace content 297 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698