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

Unified Diff: services/ui/surfaces/display_compositor_unittest.cc

Issue 2610723002: Unify SurfaceInfo (Closed)
Patch Set: Cleanup offscreen canvas Created 3 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/surfaces/display_compositor.cc ('k') | services/ui/ws/frame_generator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/surfaces/display_compositor_unittest.cc
diff --git a/services/ui/surfaces/display_compositor_unittest.cc b/services/ui/surfaces/display_compositor_unittest.cc
index c3dc07b454614e1eedcc91c38f87bcb3e06ca4b3..23d32a5e5adcf5e73fd5550a686bb80808c4b339 100644
--- a/services/ui/surfaces/display_compositor_unittest.cc
+++ b/services/ui/surfaces/display_compositor_unittest.cc
@@ -72,12 +72,10 @@ class TestDisplayCompositorClient : public cc::mojom::DisplayCompositorClient {
got_root_surface_id_ = true;
}
- void OnSurfaceCreated(const cc::SurfaceId& surface_id,
- const gfx::Size& frame_size,
- float device_scale_factor) override {
+ void OnSurfaceCreated(const cc::SurfaceInfo& surface_info) override {
EXPECT_TRUE(got_root_surface_id_);
AddEvent(base::StringPrintf("OnSurfaceCreated(%s)",
- SurfaceIdString(surface_id).c_str()));
+ SurfaceIdString(surface_info.id()).c_str()));
}
mojo::Binding<cc::mojom::DisplayCompositorClient> binding_;
@@ -193,7 +191,8 @@ class DisplayCompositorTest : public TaskRunnerTestBase {
TEST_F(DisplayCompositorTest, AddSurfaceThenReference) {
const cc::SurfaceId parent_id = MakeSurfaceId(1, 1, 1);
const cc::SurfaceId surface_id = MakeSurfaceId(2, 1, 1);
- surface_observer()->OnSurfaceCreated(surface_id, gfx::Size(1, 1), 1.0f);
+ surface_observer()->OnSurfaceCreated(
+ cc::SurfaceInfo(surface_id, 1.0f, gfx::Size(1, 1)));
RunUntilIdle();
// Client should get OnSurfaceCreated call and temporary reference added.
@@ -212,7 +211,8 @@ TEST_F(DisplayCompositorTest, AddSurfaceThenReference) {
TEST_F(DisplayCompositorTest, AddSurfaceThenRootReference) {
const cc::SurfaceId surface_id = MakeSurfaceId(1, 1, 1);
- surface_observer()->OnSurfaceCreated(surface_id, gfx::Size(1, 1), 1.0f);
+ surface_observer()->OnSurfaceCreated(
+ cc::SurfaceInfo(surface_id, 1.0f, gfx::Size(1, 1)));
RunUntilIdle();
// Temporary reference should be added.
@@ -234,8 +234,10 @@ TEST_F(DisplayCompositorTest, AddTwoSurfacesThenOneReference) {
const cc::SurfaceId surface_id2 = MakeSurfaceId(3, 1, 1);
// Add two surfaces with different FrameSinkIds.
- surface_observer()->OnSurfaceCreated(surface_id1, gfx::Size(1, 1), 1.0f);
- surface_observer()->OnSurfaceCreated(surface_id2, gfx::Size(1, 1), 1.0f);
+ surface_observer()->OnSurfaceCreated(
+ cc::SurfaceInfo(surface_id1, 1.0f, gfx::Size(1, 1)));
+ surface_observer()->OnSurfaceCreated(
+ cc::SurfaceInfo(surface_id2, 1.0f, gfx::Size(1, 1)));
RunUntilIdle();
// Temporary reference should be added for both surfaces.
@@ -259,8 +261,10 @@ TEST_F(DisplayCompositorTest, AddSurfacesSkipReference) {
// Add two surfaces that have the same FrameSinkId. This would happen when a
// client submits two CFs before parent submits a new CF.
- surface_observer()->OnSurfaceCreated(surface_id1, gfx::Size(1, 1), 1.0f);
- surface_observer()->OnSurfaceCreated(surface_id2, gfx::Size(1, 1), 1.0f);
+ surface_observer()->OnSurfaceCreated(
+ cc::SurfaceInfo(surface_id1, 1.0f, gfx::Size(1, 1)));
+ surface_observer()->OnSurfaceCreated(
+ cc::SurfaceInfo(surface_id2, 1.0f, gfx::Size(1, 1)));
RunUntilIdle();
// Client should get OnSurfaceCreated call and temporary reference added for
« no previous file with comments | « services/ui/surfaces/display_compositor.cc ('k') | services/ui/ws/frame_generator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698