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

Unified Diff: cc/output/output_surface_unittest.cc

Issue 2009443002: Revert of Consolidate OutputSurface constructors into GL vs Vulkan. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 38285da59c19d19ebba96ba22c8c1f098d2ba132..bebd2457275116d0fa4ae27025d84486118c9ea4 100644
--- a/cc/output/output_surface_unittest.cc
+++ b/cc/output/output_surface_unittest.cc
@@ -23,23 +23,19 @@
class TestOutputSurface : public OutputSurface {
public:
explicit TestOutputSurface(scoped_refptr<ContextProvider> context_provider)
- : OutputSurface(std::move(context_provider), nullptr, nullptr) {}
+ : OutputSurface(context_provider) {}
TestOutputSurface(scoped_refptr<ContextProvider> context_provider,
scoped_refptr<ContextProvider> worker_context_provider)
- : OutputSurface(std::move(context_provider),
- std::move(worker_context_provider),
- nullptr) {}
+ : OutputSurface(worker_context_provider) {}
explicit TestOutputSurface(
std::unique_ptr<SoftwareOutputDevice> software_device)
- : OutputSurface(nullptr, nullptr, std::move(software_device)) {}
+ : OutputSurface(std::move(software_device)) {}
TestOutputSurface(scoped_refptr<ContextProvider> context_provider,
std::unique_ptr<SoftwareOutputDevice> software_device)
- : OutputSurface(std::move(context_provider),
- nullptr,
- std::move(software_device)) {}
+ : OutputSurface(context_provider, std::move(software_device)) {}
void SwapBuffers(CompositorFrame* frame) override {
client_->DidSwapBuffers();
@@ -121,8 +117,6 @@
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();
@@ -131,6 +125,23 @@
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, 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;
« 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