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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 508373002: cc: Single-threaded impl-side painting for unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also abort remaining swap promises for synchronous composite Created 6 years, 2 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.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 4a3fa7efdfe4b440a5dfd01a5f32bb60bbe70463..37c23209e6b5344a248950d2d10a0f7c486517a0 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -529,7 +529,8 @@ class LayerTreeHostTestSetNextCommitForcesRedraw : public LayerTreeHostTest {
scoped_refptr<ContentLayer> root_layer_;
};
-SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSetNextCommitForcesRedraw);
+SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(
+ LayerTreeHostTestSetNextCommitForcesRedraw);
// Tests that if a layer is not drawn because of some reason in the parent then
// its damage is preserved until the next time it is drawn.
@@ -737,7 +738,8 @@ class LayerTreeHostTestFrameTimeUpdatesAfterActivationFails
virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) OVERRIDE {
EXPECT_EQ(frame_count_with_pending_tree_, 0);
- impl->BlockNotifyReadyToActivateForTesting(true);
+ if (impl->settings().impl_side_painting)
+ impl->BlockNotifyReadyToActivateForTesting(true);
}
virtual void WillBeginImplFrameOnThread(LayerTreeHostImpl* impl,
@@ -748,7 +750,8 @@ class LayerTreeHostTestFrameTimeUpdatesAfterActivationFails
if (frame_count_with_pending_tree_ == 1) {
EXPECT_EQ(first_frame_time_.ToInternalValue(), 0);
first_frame_time_ = impl->CurrentBeginFrameArgs().frame_time;
- } else if (frame_count_with_pending_tree_ == 2) {
+ } else if (frame_count_with_pending_tree_ == 2 &&
+ impl->settings().impl_side_painting) {
impl->BlockNotifyReadyToActivateForTesting(false);
}
}
@@ -777,7 +780,7 @@ class LayerTreeHostTestFrameTimeUpdatesAfterActivationFails
base::TimeTicks first_frame_time_;
};
-SINGLE_AND_MULTI_THREAD_TEST_F(
+SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(
LayerTreeHostTestFrameTimeUpdatesAfterActivationFails);
// This test verifies that LayerTreeHostImpl's current frame time gets
@@ -2406,12 +2409,18 @@ class LayerTreeHostTestChangeLayerPropertiesInPaintContents
LayerTreeHostTestChangeLayerPropertiesInPaintContents() : num_commits_(0) {}
virtual void SetupTree() OVERRIDE {
- scoped_refptr<ContentLayer> root_layer = ContentLayer::Create(&client_);
+ if (layer_tree_host()->settings().impl_side_painting) {
+ scoped_refptr<PictureLayer> root_layer = PictureLayer::Create(&client_);
+ layer_tree_host()->SetRootLayer(root_layer);
+ } else {
+ scoped_refptr<ContentLayer> root_layer = ContentLayer::Create(&client_);
+ layer_tree_host()->SetRootLayer(root_layer);
+ }
+ Layer* root_layer = layer_tree_host()->root_layer();
root_layer->SetIsDrawable(true);
root_layer->SetBounds(gfx::Size(1, 1));
- layer_tree_host()->SetRootLayer(root_layer);
- client_.set_layer(root_layer.get());
+ client_.set_layer(root_layer);
LayerTreeHostTest::SetupTree();
}
@@ -2419,7 +2428,7 @@ class LayerTreeHostTestChangeLayerPropertiesInPaintContents
virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
virtual void AfterTest() OVERRIDE {}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
num_commits_++;
if (num_commits_ == 1) {
LayerImpl* root_layer = host_impl->active_tree()->root_layer();
@@ -2436,7 +2445,8 @@ class LayerTreeHostTestChangeLayerPropertiesInPaintContents
int num_commits_;
};
-SINGLE_THREAD_TEST_F(LayerTreeHostTestChangeLayerPropertiesInPaintContents);
+SINGLE_AND_MULTI_THREAD_TEST_F(
+ LayerTreeHostTestChangeLayerPropertiesInPaintContents);
class MockIOSurfaceWebGraphicsContext3D : public TestWebGraphicsContext3D {
public:

Powered by Google App Engine
This is Rietveld 408576698