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

Unified Diff: cc/trees/layer_tree_host_unittest_context.cc

Issue 139053002: cc: Release main thread earlier (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests broken by raciness Created 6 years, 11 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 5aa37fe67db19ec2f2ecaef2138e96d9411a0fd9..57c780b7aca1b1cc6386b14b71949fbd02139c1f 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -1925,8 +1925,7 @@ class LayerTreeHostContextTestSurfaceCreateCallback
public:
LayerTreeHostContextTestSurfaceCreateCallback()
: LayerTreeHostContextTest(),
- layer_(FakeContentLayer::Create(&client_)),
- num_commits_(0) {}
+ layer_(FakeContentLayer::Create(&client_)) {}
virtual void SetupTree() OVERRIDE {
layer_->SetBounds(gfx::Size(10, 20));
@@ -1937,29 +1936,28 @@ class LayerTreeHostContextTestSurfaceCreateCallback
virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
virtual void DidCommit() OVERRIDE {
- switch (num_commits_) {
- case 0:
- EXPECT_EQ(1u, layer_->output_surface_created_count());
- layer_tree_host()->SetNeedsCommit();
- break;
+ switch (layer_tree_host()->source_frame_number()) {
case 1:
EXPECT_EQ(1u, layer_->output_surface_created_count());
layer_tree_host()->SetNeedsCommit();
break;
case 2:
EXPECT_EQ(1u, layer_->output_surface_created_count());
+ layer_tree_host()->SetNeedsCommit();
break;
case 3:
+ EXPECT_EQ(1u, layer_->output_surface_created_count());
+ break;
+ case 4:
EXPECT_EQ(2u, layer_->output_surface_created_count());
layer_tree_host()->SetNeedsCommit();
break;
}
- ++num_commits_;
}
virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
LayerTreeHostContextTest::CommitCompleteOnThread(impl);
- switch (num_commits_) {
+ switch (LastCommittedSourceFrameNumber(impl)) {
case 0:
break;
case 1:
@@ -1982,7 +1980,6 @@ class LayerTreeHostContextTestSurfaceCreateCallback
protected:
FakeContentLayerClient client_;
scoped_refptr<FakeContentLayer> layer_;
- int num_commits_;
};
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback);

Powered by Google App Engine
This is Rietveld 408576698