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

Unified Diff: cc/output/output_surface_unittest.cc

Issue 2352963002: cc: Make most of cc::OutputSurface abstract. (Closed)
Patch Set: outputsurface-cleanup: rebase Created 4 years, 3 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 | « cc/output/output_surface.cc ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/output_surface_unittest.cc
diff --git a/cc/output/output_surface_unittest.cc b/cc/output/output_surface_unittest.cc
index 780f1bd421dd67a66749afec47cb836324cf7fa7..f53561bdc7098bfadf5cf92cbbecf643e013fb37 100644
--- a/cc/output/output_surface_unittest.cc
+++ b/cc/output/output_surface_unittest.cc
@@ -29,6 +29,9 @@ class TestOutputSurface : public OutputSurface {
std::unique_ptr<SoftwareOutputDevice> software_device)
: OutputSurface(std::move(software_device)) {}
+ void EnsureBackbuffer() override {}
+ void DiscardBackbuffer() override {}
+ void BindFramebuffer() override {}
void SwapBuffers(CompositorFrame frame) override {
client_->DidSwapBuffersComplete();
}
@@ -36,6 +39,14 @@ class TestOutputSurface : public OutputSurface {
// TestContextProvider has no real framebuffer, just use RGB.
return GL_RGB;
}
+ OverlayCandidateValidator* GetOverlayCandidateValidator() const override {
+ return nullptr;
+ }
+ bool IsDisplayedAsOverlayPlane() const override { return false; }
+ unsigned GetOverlayTextureId() const override { return 0; }
+ bool SurfaceIsSuspendForRecycle() const override { return false; }
+ bool HasExternalStencilTest() const override { return false; }
+ void ApplyExternalStencil() override {}
void OnSwapBuffersCompleteForTesting() { client_->DidSwapBuffersComplete(); }
@@ -77,11 +88,9 @@ void TestSoftwareOutputDevice::EnsureBackbuffer() {
TEST(OutputSurfaceTest, ContextLossInformsClient) {
scoped_refptr<TestContextProvider> provider = TestContextProvider::Create();
TestOutputSurface output_surface(provider);
- EXPECT_FALSE(output_surface.HasClient());
FakeOutputSurfaceClient client;
EXPECT_TRUE(output_surface.BindToClient(&client));
- EXPECT_TRUE(output_surface.HasClient());
// Verify DidLoseOutputSurface callback is hooked up correctly.
EXPECT_FALSE(client.did_lose_output_surface_called());
@@ -101,31 +110,9 @@ TEST(OutputSurfaceTest, ContextLossFailsBind) {
context_provider->UnboundTestContext3d()->set_context_lost(true);
TestOutputSurface output_surface(context_provider);
- EXPECT_FALSE(output_surface.HasClient());
FakeOutputSurfaceClient client;
EXPECT_FALSE(output_surface.BindToClient(&client));
- EXPECT_FALSE(output_surface.HasClient());
-}
-
-TEST(OutputSurfaceTest, SoftwareOutputDeviceBackbufferManagement) {
- auto device_owned = base::MakeUnique<TestSoftwareOutputDevice>();
- TestSoftwareOutputDevice* software_output_device = device_owned.get();
-
- // TestOutputSurface now owns software_output_device and has responsibility to
- // free it.
- TestOutputSurface output_surface(std::move(device_owned));
-
- EXPECT_EQ(0, software_output_device->ensure_backbuffer_count());
- EXPECT_EQ(0, software_output_device->discard_backbuffer_count());
-
- output_surface.EnsureBackbuffer();
- EXPECT_EQ(1, software_output_device->ensure_backbuffer_count());
- EXPECT_EQ(0, software_output_device->discard_backbuffer_count());
- output_surface.DiscardBackbuffer();
-
- EXPECT_EQ(1, software_output_device->ensure_backbuffer_count());
- EXPECT_EQ(1, software_output_device->discard_backbuffer_count());
}
} // namespace
« no previous file with comments | « cc/output/output_surface.cc ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698