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

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

Issue 2425923003: Replaced is_null() with is_valid in SurfaceId and related classes. (Closed)
Patch Set: Rebase 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 "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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 gfx::Rect view_rect(view_size); 172 gfx::Rect view_rect(view_size);
173 float scale_factor = 1.f; 173 float scale_factor = 1.f;
174 174
175 view_->SetSize(view_size); 175 view_->SetSize(view_size);
176 view_->Show(); 176 view_->Show();
177 177
178 view_->OnSwapCompositorFrame( 178 view_->OnSwapCompositorFrame(
179 0, CreateDelegatedFrame(scale_factor, view_size, view_rect)); 179 0, CreateDelegatedFrame(scale_factor, view_size, view_rect));
180 180
181 cc::SurfaceId id = GetSurfaceId(); 181 cc::SurfaceId id = GetSurfaceId();
182 if (!id.is_null()) { 182 if (id.is_valid()) {
183 #if !defined(OS_ANDROID) 183 #if !defined(OS_ANDROID)
184 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); 184 ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
185 cc::SurfaceManager* manager = factory->GetSurfaceManager(); 185 cc::SurfaceManager* manager = factory->GetSurfaceManager();
186 cc::Surface* surface = manager->GetSurfaceForId(id); 186 cc::Surface* surface = manager->GetSurfaceForId(id);
187 EXPECT_TRUE(surface); 187 EXPECT_TRUE(surface);
188 // There should be a SurfaceSequence created by the RWHVChildFrame. 188 // There should be a SurfaceSequence created by the RWHVChildFrame.
189 EXPECT_EQ(1u, surface->GetDestructionDependencyCount()); 189 EXPECT_EQ(1u, surface->GetDestructionDependencyCount());
190 #endif 190 #endif
191 191
192 // Surface ID should have been passed to CrossProcessFrameConnector to 192 // Surface ID should have been passed to CrossProcessFrameConnector to
193 // be sent to the embedding renderer. 193 // be sent to the embedding renderer.
194 EXPECT_EQ(id, test_frame_connector_->last_surface_id_received_); 194 EXPECT_EQ(id, test_frame_connector_->last_surface_id_received_);
195 EXPECT_EQ(view_size, test_frame_connector_->last_frame_size_received_); 195 EXPECT_EQ(view_size, test_frame_connector_->last_frame_size_received_);
196 EXPECT_EQ(scale_factor, test_frame_connector_->last_scale_factor_received_); 196 EXPECT_EQ(scale_factor, test_frame_connector_->last_scale_factor_received_);
197 } 197 }
198 } 198 }
199 199
200 } // namespace content 200 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698