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

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

Issue 2443003004: cc: Make OutputSurface::BindToClient pure virtual and not return bool (Closed)
Patch Set: bindtoclient-pure-virtual: 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/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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 return base::MakeUnique<content::SoftwareBrowserCompositorOutputSurface>( 111 return base::MakeUnique<content::SoftwareBrowserCompositorOutputSurface>(
112 std::move(device), compositor_->vsync_manager(), &begin_frame_source_, 112 std::move(device), compositor_->vsync_manager(), &begin_frame_source_,
113 base::ThreadTaskRunnerHandle::Get()); 113 base::ThreadTaskRunnerHandle::Get());
114 } 114 }
115 115
116 TEST_F(SoftwareBrowserCompositorOutputSurfaceTest, NoVSyncProvider) { 116 TEST_F(SoftwareBrowserCompositorOutputSurfaceTest, NoVSyncProvider) {
117 cc::FakeOutputSurfaceClient output_surface_client; 117 cc::FakeOutputSurfaceClient output_surface_client;
118 std::unique_ptr<cc::SoftwareOutputDevice> software_device( 118 std::unique_ptr<cc::SoftwareOutputDevice> software_device(
119 new cc::SoftwareOutputDevice()); 119 new cc::SoftwareOutputDevice());
120 output_surface_ = CreateSurface(std::move(software_device)); 120 output_surface_ = CreateSurface(std::move(software_device));
121 CHECK(output_surface_->BindToClient(&output_surface_client)); 121 output_surface_->BindToClient(&output_surface_client);
122 122
123 output_surface_->SwapBuffers(cc::OutputSurfaceFrame()); 123 output_surface_->SwapBuffers(cc::OutputSurfaceFrame());
124 EXPECT_EQ(NULL, output_surface_->software_device()->GetVSyncProvider()); 124 EXPECT_EQ(NULL, output_surface_->software_device()->GetVSyncProvider());
125 } 125 }
126 126
127 TEST_F(SoftwareBrowserCompositorOutputSurfaceTest, VSyncProviderUpdates) { 127 TEST_F(SoftwareBrowserCompositorOutputSurfaceTest, VSyncProviderUpdates) {
128 cc::FakeOutputSurfaceClient output_surface_client; 128 cc::FakeOutputSurfaceClient output_surface_client;
129 std::unique_ptr<cc::SoftwareOutputDevice> software_device( 129 std::unique_ptr<cc::SoftwareOutputDevice> software_device(
130 new FakeSoftwareOutputDevice()); 130 new FakeSoftwareOutputDevice());
131 output_surface_ = CreateSurface(std::move(software_device)); 131 output_surface_ = CreateSurface(std::move(software_device));
132 CHECK(output_surface_->BindToClient(&output_surface_client)); 132 output_surface_->BindToClient(&output_surface_client);
133 133
134 FakeVSyncProvider* vsync_provider = static_cast<FakeVSyncProvider*>( 134 FakeVSyncProvider* vsync_provider = static_cast<FakeVSyncProvider*>(
135 output_surface_->software_device()->GetVSyncProvider()); 135 output_surface_->software_device()->GetVSyncProvider());
136 EXPECT_EQ(0, vsync_provider->call_count()); 136 EXPECT_EQ(0, vsync_provider->call_count());
137 137
138 output_surface_->SwapBuffers(cc::OutputSurfaceFrame()); 138 output_surface_->SwapBuffers(cc::OutputSurfaceFrame());
139 EXPECT_EQ(1, vsync_provider->call_count()); 139 EXPECT_EQ(1, vsync_provider->call_count());
140 } 140 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698