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

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: Removed added printf statements; LocalFrameId::is_valid() no longer checks if nonce is 0. Created 4 years, 2 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 gfx::Rect view_rect(view_size); 173 gfx::Rect view_rect(view_size);
174 float scale_factor = 1.f; 174 float scale_factor = 1.f;
175 175
176 view_->SetSize(view_size); 176 view_->SetSize(view_size);
177 view_->Show(); 177 view_->Show();
178 178
179 view_->OnSwapCompositorFrame( 179 view_->OnSwapCompositorFrame(
180 0, CreateDelegatedFrame(scale_factor, view_size, view_rect)); 180 0, CreateDelegatedFrame(scale_factor, view_size, view_rect));
181 181
182 cc::SurfaceId id = GetSurfaceId(); 182 cc::SurfaceId id = GetSurfaceId();
183 if (!id.is_null()) { 183 if (id.is_valid()) {
184 #if !defined(OS_ANDROID) 184 #if !defined(OS_ANDROID)
185 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); 185 ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
186 cc::SurfaceManager* manager = factory->GetSurfaceManager(); 186 cc::SurfaceManager* manager = factory->GetSurfaceManager();
187 cc::Surface* surface = manager->GetSurfaceForId(id); 187 cc::Surface* surface = manager->GetSurfaceForId(id);
188 EXPECT_TRUE(surface); 188 EXPECT_TRUE(surface);
189 // There should be a SurfaceSequence created by the RWHVChildFrame. 189 // There should be a SurfaceSequence created by the RWHVChildFrame.
190 EXPECT_EQ(1u, surface->GetDestructionDependencyCount()); 190 EXPECT_EQ(1u, surface->GetDestructionDependencyCount());
191 #endif 191 #endif
192 192
193 // Surface ID should have been passed to CrossProcessFrameConnector to 193 // Surface ID should have been passed to CrossProcessFrameConnector to
194 // be sent to the embedding renderer. 194 // be sent to the embedding renderer.
195 EXPECT_EQ(id, test_frame_connector_->last_surface_id_received_); 195 EXPECT_EQ(id, test_frame_connector_->last_surface_id_received_);
196 EXPECT_EQ(view_size, test_frame_connector_->last_frame_size_received_); 196 EXPECT_EQ(view_size, test_frame_connector_->last_frame_size_received_);
197 EXPECT_EQ(scale_factor, test_frame_connector_->last_scale_factor_received_); 197 EXPECT_EQ(scale_factor, test_frame_connector_->last_scale_factor_received_);
198 } 198 }
199 } 199 }
200 200
201 } // namespace content 201 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698