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

Side by Side 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 test 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 unified diff | Download patch
« no previous file with comments | « cc/scheduler/scheduler_state_machine.cc ('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/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 2386 matching lines...) Expand 10 before | Expand all | Expand 10 after
2397 base::Bind(&LayerTreeHostTestBeginFrameNotification::EndTest, 2397 base::Bind(&LayerTreeHostTestBeginFrameNotification::EndTest,
2398 base::Unretained(this))); 2398 base::Unretained(this)));
2399 } 2399 }
2400 2400
2401 virtual void AfterTest() OVERRIDE {} 2401 virtual void AfterTest() OVERRIDE {}
2402 }; 2402 };
2403 2403
2404 MULTI_THREAD_TEST_F( 2404 MULTI_THREAD_TEST_F(
2405 LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled); 2405 LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled);
2406 2406
2407 class LayerTreeHostTestAbortedCommitDoesntStallNextCommitWhenIdle
brianderson 2013/09/11 23:19:32 This test times out without the fix in this patch.
2408 : public LayerTreeHostTest {
2409 protected:
2410 LayerTreeHostTestAbortedCommitDoesntStallNextCommitWhenIdle()
2411 : commit_count_(0) {}
enne (OOO) 2013/09/11 23:28:12 style nit: this needs to be indented.
2412
2413 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
2414 settings->begin_frame_scheduling_enabled = true;
2415 settings->using_synchronous_renderer_compositor = true;
2416 }
2417
2418 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
2419
2420 virtual void DidCommit() OVERRIDE {
2421 commit_count_++;
2422 if (commit_count_== 2) {
2423 // A commit was just aborted, request a real commit now.
2424 layer_tree_host()->SetNeedsCommit();
2425 } else if (commit_count_ == 3) {
2426 // Make sure the real commit following an aborted commit will still
2427 // complete.
2428 EndTest();
2429 }
2430 }
2431
2432 virtual void CommitCompleteOnThread(LayerTreeHostImpl *host_impl) OVERRIDE {
enne (OOO) 2013/09/11 23:28:12 style nit: '* ' not ' *'
2433 // Initiate an aborted commit after every real commit.
2434 host_impl->SetNeedsCommit();
2435 }
2436
2437 virtual void AfterTest() OVERRIDE {}
enne (OOO) 2013/09/11 23:28:12 As a sanity check for this test, can you also chec
2438
2439 int commit_count_;
2440 };
2441
2442 MULTI_THREAD_TEST_F(
2443 LayerTreeHostTestAbortedCommitDoesntStallNextCommitWhenIdle);
2444
2407 class LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation 2445 class LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation
2408 : public LayerTreeHostTest { 2446 : public LayerTreeHostTest {
2409 protected: 2447 protected:
2410 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { 2448 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
2411 settings->impl_side_painting = true; 2449 settings->impl_side_painting = true;
2412 } 2450 }
2413 2451
2414 virtual void SetupTree() OVERRIDE { 2452 virtual void SetupTree() OVERRIDE {
2415 LayerTreeHostTest::SetupTree(); 2453 LayerTreeHostTest::SetupTree();
2416 2454
(...skipping 2223 matching lines...) Expand 10 before | Expand all | Expand 10 after
4640 scoped_refptr<TestContextProvider> context_provider_; 4678 scoped_refptr<TestContextProvider> context_provider_;
4641 FakeContentLayerClient client_; 4679 FakeContentLayerClient client_;
4642 }; 4680 };
4643 4681
4644 // Impl-side painting is a multi-threaded compositor feature. 4682 // Impl-side painting is a multi-threaded compositor feature.
4645 MULTI_THREAD_TEST_F(LayerTreeHostTestMaxTransferBufferUsageBytes); 4683 MULTI_THREAD_TEST_F(LayerTreeHostTestMaxTransferBufferUsageBytes);
4646 4684
4647 } // namespace 4685 } // namespace
4648 4686
4649 } // namespace cc 4687 } // namespace cc
OLDNEW
« 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