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

Side by Side Diff: cc/trees/layer_tree_host_unittest_scroll.cc

Issue 2158973002: cc: Clean up LayerTreeTest and TestHooks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: proxy-impls: android-build Created 4 years, 5 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "base/location.h" 7 #include "base/location.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after
1526 ->scroll_clip_layer() 1526 ->scroll_clip_layer()
1527 ->id(); 1527 ->id();
1528 layer_tree_host()->outer_viewport_scroll_layer()->SetScrollOffset( 1528 layer_tree_host()->outer_viewport_scroll_layer()->SetScrollOffset(
1529 initial_scroll_); 1529 initial_scroll_);
1530 layer_tree_host()->outer_viewport_scroll_layer()->set_did_scroll_callback( 1530 layer_tree_host()->outer_viewport_scroll_layer()->set_did_scroll_callback(
1531 base::Bind(&LayerTreeHostScrollTestScrollMFBA::DidScrollOuterViewport, 1531 base::Bind(&LayerTreeHostScrollTestScrollMFBA::DidScrollOuterViewport,
1532 base::Unretained(this))); 1532 base::Unretained(this)));
1533 PostSetNeedsCommitToMainThread(); 1533 PostSetNeedsCommitToMainThread();
1534 } 1534 }
1535 1535
1536 void StartCommitOnImpl() override { 1536 void BeginMainFrameCompletedOnThread(LayerTreeHostImpl* impl) override {
1537 switch (num_commits_) { 1537 switch (num_commits_) {
1538 case 1: 1538 case 1:
1539 // Ask for commit here because activation (and draw) will be blocked. 1539 // Ask for commit here because activation (and draw) will be blocked.
1540 GetProxyImplForTest()->SetNeedsCommitOnImpl(); 1540 impl->SetNeedsCommit();
1541 // Block activation after second commit until third commit is ready. 1541 // Block activation after second commit until third commit is ready.
1542 GetProxyImplForTest()->BlockNotifyReadyToActivateForTesting(true); 1542 impl->BlockNotifyReadyToActivateForTesting(true);
1543 break; 1543 break;
1544 case 2: 1544 case 2:
1545 // Unblock activation after third commit is ready. 1545 // Unblock activation after third commit is ready.
1546 GetProxyImplForTest()->BlockNotifyReadyToActivateForTesting(false); 1546 impl->BlockNotifyReadyToActivateForTesting(false);
1547 break; 1547 break;
1548 } 1548 }
1549 num_commits_++; 1549 num_commits_++;
1550 } 1550 }
1551 1551
1552 void UpdateLayerTreeHost() override { 1552 void UpdateLayerTreeHost() override {
1553 Layer* scroll_layer = layer_tree_host()->outer_viewport_scroll_layer(); 1553 Layer* scroll_layer = layer_tree_host()->outer_viewport_scroll_layer();
1554 switch (layer_tree_host()->source_frame_number()) { 1554 switch (layer_tree_host()->source_frame_number()) {
1555 case 0: 1555 case 0:
1556 EXPECT_VECTOR_EQ(initial_scroll_, scroll_layer->scroll_offset()); 1556 EXPECT_VECTOR_EQ(initial_scroll_, scroll_layer->scroll_offset());
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1851 int num_impl_commits_; 1851 int num_impl_commits_;
1852 int num_aborted_commits_; 1852 int num_aborted_commits_;
1853 int num_impl_scrolls_; 1853 int num_impl_scrolls_;
1854 int num_draws_; 1854 int num_draws_;
1855 }; 1855 };
1856 1856
1857 MULTI_THREAD_TEST_F(LayerTreeHostScrollTestScrollAbortedCommitMFBA); 1857 MULTI_THREAD_TEST_F(LayerTreeHostScrollTestScrollAbortedCommitMFBA);
1858 1858
1859 } // namespace 1859 } // namespace
1860 } // namespace cc 1860 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698