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

Side by Side Diff: content/browser/compositor/software_browser_compositor_output_surface_unittest.cc

Issue 2143263002: cc: Remove OutputSurfaceClient::DidSwapBuffers(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removedidswap: fix-webview-swap 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/compositor/software_browser_compositor_output_surface. h" 5 #include "content/browser/compositor/software_browser_compositor_output_surface. h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 TEST_F(SoftwareBrowserCompositorOutputSurfaceTest, NoVSyncProvider) { 114 TEST_F(SoftwareBrowserCompositorOutputSurfaceTest, NoVSyncProvider) {
115 cc::FakeOutputSurfaceClient output_surface_client; 115 cc::FakeOutputSurfaceClient output_surface_client;
116 std::unique_ptr<cc::SoftwareOutputDevice> software_device( 116 std::unique_ptr<cc::SoftwareOutputDevice> software_device(
117 new cc::SoftwareOutputDevice()); 117 new cc::SoftwareOutputDevice());
118 output_surface_ = CreateSurface(std::move(software_device)); 118 output_surface_ = CreateSurface(std::move(software_device));
119 CHECK(output_surface_->BindToClient(&output_surface_client)); 119 CHECK(output_surface_->BindToClient(&output_surface_client));
120 120
121 cc::CompositorFrame frame; 121 cc::CompositorFrame frame;
122 output_surface_->SwapBuffers(std::move(frame)); 122 output_surface_->SwapBuffers(std::move(frame));
123
124 EXPECT_EQ(1, output_surface_client.swap_count());
125 EXPECT_EQ(NULL, output_surface_->software_device()->GetVSyncProvider()); 123 EXPECT_EQ(NULL, output_surface_->software_device()->GetVSyncProvider());
126 } 124 }
127 125
128 TEST_F(SoftwareBrowserCompositorOutputSurfaceTest, VSyncProviderUpdates) { 126 TEST_F(SoftwareBrowserCompositorOutputSurfaceTest, VSyncProviderUpdates) {
129 cc::FakeOutputSurfaceClient output_surface_client; 127 cc::FakeOutputSurfaceClient output_surface_client;
130 std::unique_ptr<cc::SoftwareOutputDevice> software_device( 128 std::unique_ptr<cc::SoftwareOutputDevice> software_device(
131 new FakeSoftwareOutputDevice()); 129 new FakeSoftwareOutputDevice());
132 output_surface_ = CreateSurface(std::move(software_device)); 130 output_surface_ = CreateSurface(std::move(software_device));
133 CHECK(output_surface_->BindToClient(&output_surface_client)); 131 CHECK(output_surface_->BindToClient(&output_surface_client));
134 132
135 FakeVSyncProvider* vsync_provider = static_cast<FakeVSyncProvider*>( 133 FakeVSyncProvider* vsync_provider = static_cast<FakeVSyncProvider*>(
136 output_surface_->software_device()->GetVSyncProvider()); 134 output_surface_->software_device()->GetVSyncProvider());
137 EXPECT_EQ(0, vsync_provider->call_count()); 135 EXPECT_EQ(0, vsync_provider->call_count());
138 136
139 cc::CompositorFrame frame; 137 cc::CompositorFrame frame;
140 output_surface_->SwapBuffers(std::move(frame)); 138 output_surface_->SwapBuffers(std::move(frame));
141
142 EXPECT_EQ(1, output_surface_client.swap_count());
143 EXPECT_EQ(1, vsync_provider->call_count()); 139 EXPECT_EQ(1, vsync_provider->call_count());
144 } 140 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698