OLD | NEW |
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 Loading... |
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 285 |
285 view_->OnSwapCompositorFrame( | 286 view_->OnSwapCompositorFrame( |
286 0, CreateDelegatedFrame(scale_factor, view_size, view_rect)); | 287 0, CreateDelegatedFrame(scale_factor, view_size, view_rect)); |
287 | 288 |
288 // Since guest is not attached, the CompositorFrame must be processed but the | 289 // Since guest is not attached, the CompositorFrame must be processed but the |
289 // frame must be evicted to return the resources immediately. | 290 // frame must be evicted to return the resources immediately. |
290 EXPECT_FALSE(view_->has_frame()); | 291 EXPECT_FALSE(view_->has_frame()); |
291 } | 292 } |
292 | 293 |
293 } // namespace content | 294 } // namespace content |
OLD | NEW |