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

Unified Diff: cc/output/output_surface_unittest.cc

Issue 2002303002: Consolidate OutputSurface constructors into GL vs Vulkan. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: outputsurface-constructors: rebase-and-fixcrash Created 4 years, 7 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 bebd2457275116d0fa4ae27025d84486118c9ea4..38285da59c19d19ebba96ba22c8c1f098d2ba132 100644
--- a/cc/output/output_surface_unittest.cc
+++ b/cc/output/output_surface_unittest.cc
@@ -23,19 +23,23 @@ namespace {
class TestOutputSurface : public OutputSurface {
public:
explicit TestOutputSurface(scoped_refptr<ContextProvider> context_provider)
- : OutputSurface(context_provider) {}
+ : OutputSurface(std::move(context_provider), nullptr, nullptr) {}
TestOutputSurface(scoped_refptr<ContextProvider> context_provider,
scoped_refptr<ContextProvider> worker_context_provider)
- : OutputSurface(worker_context_provider) {}
+ : OutputSurface(std::move(context_provider),
+ std::move(worker_context_provider),
+ nullptr) {}
explicit TestOutputSurface(
std::unique_ptr<SoftwareOutputDevice> software_device)
- : OutputSurface(std::move(software_device)) {}
+ : OutputSurface(nullptr, nullptr, std::move(software_device)) {}
TestOutputSurface(scoped_refptr<ContextProvider> context_provider,
std::unique_ptr<SoftwareOutputDevice> software_device)
- : OutputSurface(context_provider, std::move(software_device)) {}
+ : OutputSurface(std::move(context_provider),
+ nullptr,
+ std::move(software_device)) {}
void SwapBuffers(CompositorFrame* frame) override {
client_->DidSwapBuffers();
@@ -117,6 +121,8 @@ TEST(OutputSurfaceTest, ClientPointerIndicatesWorkerBindToClientSuccess) {
EXPECT_TRUE(client.did_lose_output_surface_called());
}
+// TODO(danakj): Add a test for worker context failure as well when
+// OutputSurface creates/binds it.
TEST(OutputSurfaceTest, ClientPointerIndicatesBindToClientFailure) {
scoped_refptr<TestContextProvider> context_provider =
TestContextProvider::Create();
@@ -132,23 +138,6 @@ TEST(OutputSurfaceTest, ClientPointerIndicatesBindToClientFailure) {
EXPECT_FALSE(output_surface.HasClient());
}
-TEST(OutputSurfaceTest, ClientPointerIndicatesWorkerBindToClientFailure) {
- scoped_refptr<TestContextProvider> context_provider =
- TestContextProvider::Create();
- scoped_refptr<TestContextProvider> worker_context_provider =
- TestContextProvider::Create();
-
- // Lose the context so BindToClient fails.
- worker_context_provider->UnboundTestContext3d()->set_context_lost(true);
-
- TestOutputSurface output_surface(context_provider, worker_context_provider);
- EXPECT_FALSE(output_surface.HasClient());
-
- FakeOutputSurfaceClient client;
- EXPECT_FALSE(output_surface.BindToClient(&client));
- EXPECT_FALSE(output_surface.HasClient());
-}
-
TEST(OutputSurfaceTest, SoftwareOutputDeviceBackbufferManagement) {
TestSoftwareOutputDevice* software_output_device =
new TestSoftwareOutputDevice();
« 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