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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 23463014: cc: Poll for state that triggers draws (synchronous compositor only) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add more test expectations; formatting; Created 7 years, 3 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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3db7e6786012b723608e7188a8c8a55ba4e6f291..fc1d582067d5cb93a96ddf622d578b51ad3844de 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -2404,6 +2404,51 @@ class LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled
MULTI_THREAD_TEST_F(
LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled);
+class LayerTreeHostTestAbortedCommitDoesntStallNextCommitWhenIdle
+ : public LayerTreeHostTest {
+ protected:
+ LayerTreeHostTestAbortedCommitDoesntStallNextCommitWhenIdle()
+ : commit_count_(0), commit_complete_count_(0) {}
+
+ virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ settings->begin_frame_scheduling_enabled = true;
+ settings->using_synchronous_renderer_compositor = true;
+ }
+
+ virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+
+ virtual void DidCommit() OVERRIDE {
+ commit_count_++;
+ if (commit_count_ == 2) {
+ // A commit was just aborted, request a real commit now to make sure a
+ // real commit following an aborted commit will still complete and
+ // end the test even when the Impl thread is idle.
+ layer_tree_host()->SetNeedsCommit();
+ }
+ }
+
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ commit_complete_count_++;
+ if (commit_complete_count_ == 1) {
+ // Initiate an aborted commit after the first commit.
+ host_impl->SetNeedsCommit();
+ } else {
+ EndTest();
+ }
+ }
+
+ virtual void AfterTest() OVERRIDE {
+ EXPECT_EQ(commit_count_, 3);
+ EXPECT_EQ(commit_complete_count_, 2);
+ }
+
+ int commit_count_;
+ int commit_complete_count_;
+};
+
+MULTI_THREAD_TEST_F(
+ LayerTreeHostTestAbortedCommitDoesntStallNextCommitWhenIdle);
+
class LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation
: public LayerTreeHostTest {
protected:
« no previous file with comments | « cc/scheduler/scheduler_state_machine.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698