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

Side by Side Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1126973002: cc: Make HasImplThread() function work in AfterTest(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « cc/test/layer_tree_test.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "cc/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 LayerTreeHostTest() : contents_texture_manager_(nullptr) {} 79 LayerTreeHostTest() : contents_texture_manager_(nullptr) {}
80 80
81 void DidInitializeOutputSurface() override { 81 void DidInitializeOutputSurface() override {
82 contents_texture_manager_ = layer_tree_host()->contents_texture_manager(); 82 contents_texture_manager_ = layer_tree_host()->contents_texture_manager();
83 } 83 }
84 84
85 protected: 85 protected:
86 PrioritizedResourceManager* contents_texture_manager_; 86 PrioritizedResourceManager* contents_texture_manager_;
87 }; 87 };
88 88
89 class LayerTreeHostTestHasImplThreadTest : public LayerTreeHostTest {
danakj 2015/05/06 22:39:08 while i like tests that test themselves, i don't k
90 public:
91 LayerTreeHostTestHasImplThreadTest() : threaded_(false) {}
92
93 void RunTest(bool threaded,
94 bool delegating_renderer,
95 bool impl_side_painting) override {
96 threaded_ = threaded;
97 LayerTreeHostTest::RunTest(threaded, delegating_renderer,
98 impl_side_painting);
99 }
100
101 void BeginTest() override {
102 EXPECT_EQ(threaded_, HasImplThread());
103 EndTest();
104 }
105
106 void AfterTest() override { EXPECT_EQ(threaded_, HasImplThread()); }
107
108 private:
109 bool threaded_;
110 };
111 SINGLE_AND_MULTI_THREAD_IMPL_TEST_F(LayerTreeHostTestHasImplThreadTest);
danakj 2015/05/06 22:39:08 whitespace after class defn
mithro-old 2015/05/06 23:24:43 Done.
112
89 class LayerTreeHostTestSetNeedsCommitInsideLayout : public LayerTreeHostTest { 113 class LayerTreeHostTestSetNeedsCommitInsideLayout : public LayerTreeHostTest {
90 protected: 114 protected:
91 void BeginTest() override { PostSetNeedsCommitToMainThread(); } 115 void BeginTest() override { PostSetNeedsCommitToMainThread(); }
92 116
93 void Layout() override { 117 void Layout() override {
94 // This shouldn't cause a second commit to happen. 118 // This shouldn't cause a second commit to happen.
95 layer_tree_host()->SetNeedsCommit(); 119 layer_tree_host()->SetNeedsCommit();
96 } 120 }
97 121
98 void DidCommit() override { 122 void DidCommit() override {
(...skipping 6887 matching lines...) Expand 10 before | Expand all | Expand 10 after
6986 void AfterTest() override {} 7010 void AfterTest() override {}
6987 7011
6988 scoped_refptr<FakePictureLayer> content_child_layer_; 7012 scoped_refptr<FakePictureLayer> content_child_layer_;
6989 FakeContentLayerClient client_; 7013 FakeContentLayerClient client_;
6990 }; 7014 };
6991 7015
6992 SINGLE_AND_MULTI_THREAD_TEST_F( 7016 SINGLE_AND_MULTI_THREAD_TEST_F(
6993 LayerTreeTestReflectionMaskLayerForSurfaceWithUnclippedChild); 7017 LayerTreeTestReflectionMaskLayerForSurfaceWithUnclippedChild);
6994 7018
6995 } // namespace cc 7019 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_tree_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698