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

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

Issue 2144733005: [WIP] cc: Plumb SurfaceId from clients Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ensure only SurfaceFactoy and tests can update hierarchy Created 4 years, 5 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_child_frame.h" 5 #include "content/browser/frame_host/render_widget_host_view_child_frame.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // frame is received from a renderer process. 152 // frame is received from a renderer process.
153 TEST_F(RenderWidgetHostViewChildFrameTest, SwapCompositorFrame) { 153 TEST_F(RenderWidgetHostViewChildFrameTest, SwapCompositorFrame) {
154 gfx::Size view_size(100, 100); 154 gfx::Size view_size(100, 100);
155 gfx::Rect view_rect(view_size); 155 gfx::Rect view_rect(view_size);
156 float scale_factor = 1.f; 156 float scale_factor = 1.f;
157 157
158 view_->SetSize(view_size); 158 view_->SetSize(view_size);
159 view_->Show(); 159 view_->Show();
160 160
161 view_->OnSwapCompositorFrame( 161 view_->OnSwapCompositorFrame(
162 0, CreateDelegatedFrame(scale_factor, view_size, view_rect)); 162 0, cc::SurfaceId(),
163 CreateDelegatedFrame(scale_factor, view_size, view_rect));
163 164
164 cc::SurfaceId id = surface_id(); 165 cc::SurfaceId id = surface_id();
165 if (!id.is_null()) { 166 if (!id.is_null()) {
166 #if !defined(OS_ANDROID) 167 #if !defined(OS_ANDROID)
167 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); 168 ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
168 cc::SurfaceManager* manager = factory->GetSurfaceManager(); 169 cc::SurfaceManager* manager = factory->GetSurfaceManager();
169 cc::Surface* surface = manager->GetSurfaceForId(id); 170 cc::Surface* surface = manager->GetSurfaceForId(id);
170 EXPECT_TRUE(surface); 171 EXPECT_TRUE(surface);
171 // There should be a SurfaceSequence created by the RWHVChildFrame. 172 // There should be a SurfaceSequence created by the RWHVChildFrame.
172 EXPECT_EQ(1u, surface->GetDestructionDependencyCount()); 173 EXPECT_EQ(1u, surface->GetDestructionDependencyCount());
173 #endif 174 #endif
174 175
175 // Surface ID should have been passed to CrossProcessFrameConnector to 176 // Surface ID should have been passed to CrossProcessFrameConnector to
176 // be sent to the embedding renderer. 177 // be sent to the embedding renderer.
177 EXPECT_EQ(id, test_frame_connector_->last_surface_id_received_); 178 EXPECT_EQ(id, test_frame_connector_->last_surface_id_received_);
178 EXPECT_EQ(view_size, test_frame_connector_->last_frame_size_received_); 179 EXPECT_EQ(view_size, test_frame_connector_->last_frame_size_received_);
179 EXPECT_EQ(scale_factor, test_frame_connector_->last_scale_factor_received_); 180 EXPECT_EQ(scale_factor, test_frame_connector_->last_scale_factor_received_);
180 } 181 }
181 } 182 }
182 183
183 } // namespace content 184 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698