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

Unified Diff: cc/trees/layer_tree_host_unittest_context.cc

Issue 1287043002: cc: Setup API to release OutputSurface from LTHClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unit test Created 5 years, 4 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
Index: cc/trees/layer_tree_host_unittest_context.cc
diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
index b5799bc4ca33706f63ace563d51724a896efaba3..e35ecaafb03ab500f16baec6808294599431f6ec 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -382,6 +382,44 @@ class LayerTreeHostClientNotReadyDoesNotCreateOutputSurface
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostClientNotReadyDoesNotCreateOutputSurface);
+class LayerTreeHostClientTakeAwayOutputSurface
+ : public LayerTreeHostContextTest {
+ public:
+ LayerTreeHostClientTakeAwayOutputSurface() : LayerTreeHostContextTest() {
+ setos_counter = 0;
+ }
+
+ void BeginTest() override { PostSetNeedsCommitToMainThread(); }
+
+ void RequestNewOutputSurface() override { CreateAndSetOutputSurface(); }
+
+ void CreateAndSetOutputSurface() {
+ scoped_ptr<OutputSurface> surface =
+ LayerTreeHostContextTest::CreateOutputSurface();
+ CHECK(surface);
+ SetOutputSurface(surface.Pass());
+ }
+
+ void SetOutputSurface(scoped_ptr<OutputSurface> surface) {
no sievers 2015/09/10 00:00:22 Can this just be part of the function above?
sohanjg 2015/09/10 15:07:23 Done.
+ layer_tree_host()->SetOutputSurface(surface.Pass());
+ setos_counter++;
+ if (setos_counter > 1)
+ EndTest();
no sievers 2015/09/10 00:00:22 Don't end the test yet.
sohanjg 2015/09/10 15:07:23 Done.
+ }
+
+ void ReturnOpSurface() {
+ scoped_ptr<OutputSurface> surface = layer_tree_host()->GetOutputSurface();
+ }
+
+ void DidInitializeOutputSurface() override { ReturnOpSurface(); }
sohanjg 2015/08/26 14:38:56 It expects this to be called in ImplThread, if we
no sievers 2015/09/10 00:00:22 What you can do here is: EXPECT_TRUE(layer_tre
sohanjg 2015/09/10 15:07:23 For Single Threaded test, the call to MakeVisible
+
+ void AfterTest() override {}
+
+ int setos_counter;
+};
+
+MULTI_THREAD_TEST_F(LayerTreeHostClientTakeAwayOutputSurface);
no sievers 2015/09/10 00:00:22 SINGLE_AND_MULTI_THREAD_TEST_F
sohanjg 2015/09/10 15:07:23 Done.
+
class MultipleCompositeDoesNotCreateOutputSurface
: public LayerTreeHostContextTest {
public:

Powered by Google App Engine
This is Rietveld 408576698