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

Side by Side Diff: cc/input/scrollbar_animation_controller_linear_fade_unittest.cc

Issue 2080223010: cc: Clean up root_layer code in LTI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase++ 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
« no previous file with comments | « no previous file | cc/input/scrollbar_animation_controller_thinning_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/input/scrollbar_animation_controller_linear_fade.h" 5 #include "cc/input/scrollbar_animation_controller_linear_fade.h"
6 6
7 #include "cc/layers/solid_color_scrollbar_layer_impl.h" 7 #include "cc/layers/solid_color_scrollbar_layer_impl.h"
8 #include "cc/test/fake_impl_task_runner_provider.h" 8 #include "cc/test/fake_impl_task_runner_provider.h"
9 #include "cc/test/fake_layer_tree_host_impl.h" 9 #include "cc/test/fake_layer_tree_host_impl.h"
10 #include "cc/test/geometry_test_utils.h" 10 #include "cc/test/geometry_test_utils.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 kTrackStart, kIsLeftSideVerticalScrollbar, kIsOverlayScrollbar); 57 kTrackStart, kIsLeftSideVerticalScrollbar, kIsOverlayScrollbar);
58 scrollbar_layer_ = scrollbar.get(); 58 scrollbar_layer_ = scrollbar.get();
59 scrollbar_layer_->test_properties()->opacity_can_animate = true; 59 scrollbar_layer_->test_properties()->opacity_can_animate = true;
60 std::unique_ptr<LayerImpl> clip = 60 std::unique_ptr<LayerImpl> clip =
61 LayerImpl::Create(host_impl_.active_tree(), 3); 61 LayerImpl::Create(host_impl_.active_tree(), 3);
62 clip_layer_ = clip.get(); 62 clip_layer_ = clip.get();
63 scroll_layer->SetScrollClipLayer(clip_layer_->id()); 63 scroll_layer->SetScrollClipLayer(clip_layer_->id());
64 LayerImpl* scroll_layer_ptr = scroll_layer.get(); 64 LayerImpl* scroll_layer_ptr = scroll_layer.get();
65 scroll_layer->test_properties()->AddChild(std::move(scrollbar)); 65 scroll_layer->test_properties()->AddChild(std::move(scrollbar));
66 clip->test_properties()->AddChild(std::move(scroll_layer)); 66 clip->test_properties()->AddChild(std::move(scroll_layer));
67 host_impl_.active_tree()->SetRootLayer(std::move(clip)); 67 host_impl_.active_tree()->SetRootLayerForTesting(std::move(clip));
68 68
69 scrollbar_layer_->SetScrollLayerId(scroll_layer_ptr->id()); 69 scrollbar_layer_->SetScrollLayerId(scroll_layer_ptr->id());
70 clip_layer_->SetBounds(gfx::Size(100, 100)); 70 clip_layer_->SetBounds(gfx::Size(100, 100));
71 scroll_layer_ptr->SetBounds(gfx::Size(200, 200)); 71 scroll_layer_ptr->SetBounds(gfx::Size(200, 200));
72 host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting(); 72 host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting();
73 73
74 scrollbar_controller_ = ScrollbarAnimationControllerLinearFade::Create( 74 scrollbar_controller_ = ScrollbarAnimationControllerLinearFade::Create(
75 scroll_layer_ptr->id(), this, base::TimeDelta::FromSeconds(2), 75 scroll_layer_ptr->id(), this, base::TimeDelta::FromSeconds(2),
76 base::TimeDelta::FromSeconds(5), base::TimeDelta::FromSeconds(3)); 76 base::TimeDelta::FromSeconds(5), base::TimeDelta::FromSeconds(3));
77 } 77 }
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 EXPECT_FLOAT_EQ(1, scrollbar_layer_->Opacity()); 482 EXPECT_FLOAT_EQ(1, scrollbar_layer_->Opacity());
483 483
484 time += base::TimeDelta::FromSeconds(1); 484 time += base::TimeDelta::FromSeconds(1);
485 scrollbar_controller_->DidScrollEnd(); 485 scrollbar_controller_->DidScrollEnd();
486 EXPECT_FALSE(did_request_animate_); 486 EXPECT_FALSE(did_request_animate_);
487 EXPECT_FLOAT_EQ(1, scrollbar_layer_->Opacity()); 487 EXPECT_FLOAT_EQ(1, scrollbar_layer_->Opacity());
488 } 488 }
489 489
490 } // namespace 490 } // namespace
491 } // namespace cc 491 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/input/scrollbar_animation_controller_thinning_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698