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

Unified Diff: cc/trees/layer_tree_host_unittest_animation.cc

Issue 23907006: cc: Allow sending BeginMainFrame before draw or activation (Closed) Base URL: http://git.chromium.org/chromium/src.git@schedDeadline3
Patch Set: rebase Created 6 years, 9 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/scheduler/scheduler_state_machine_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest_animation.cc
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc
index 7a9b63f5881962d3d3737dcccbda7c7c45dba115..aeeb4f5a54b5efc975e0d43f6d61f783f66660e0 100644
--- a/cc/trees/layer_tree_host_unittest_animation.cc
+++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -829,33 +829,43 @@ MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestContinuousAnimate);
class LayerTreeHostAnimationTestCancelAnimateCommit
: public LayerTreeHostAnimationTest {
public:
- LayerTreeHostAnimationTestCancelAnimateCommit() : num_animate_calls_(0) {}
+ LayerTreeHostAnimationTestCancelAnimateCommit()
+ : num_animate_calls_(0), num_commit_calls_(0), num_draw_calls_(0) {}
virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
virtual void Animate(base::TimeTicks) OVERRIDE {
+ num_animate_calls_++;
// No-op animate will cancel the commit.
- if (++num_animate_calls_ == 2) {
+ if (layer_tree_host()->source_frame_number() == 1) {
EndTest();
return;
}
layer_tree_host()->SetNeedsAnimate();
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* tree_impl) OVERRIDE {
- if (num_animate_calls_ > 1)
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ num_commit_calls_++;
+ if (impl->active_tree()->source_frame_number() > 1)
FAIL() << "Commit should have been canceled.";
}
virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
- if (num_animate_calls_ > 1)
+ num_draw_calls_++;
+ if (impl->active_tree()->source_frame_number() > 1)
FAIL() << "Draw should have been canceled.";
}
- virtual void AfterTest() OVERRIDE { EXPECT_EQ(2, num_animate_calls_); }
+ virtual void AfterTest() OVERRIDE {
+ EXPECT_EQ(2, num_animate_calls_);
+ EXPECT_EQ(1, num_commit_calls_);
+ EXPECT_EQ(1, num_draw_calls_);
+ }
private:
int num_animate_calls_;
+ int num_commit_calls_;
+ int num_draw_calls_;
FakeContentLayerClient client_;
scoped_refptr<FakeContentLayer> content_;
};
« no previous file with comments | « cc/scheduler/scheduler_state_machine_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698