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

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

Issue 2860293002: Change cc::ElementId to be a uint64_t (Closed)
Patch Set: none Created 3 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/single_scrollbar_animation_controller_thinning.h" 5 #include "cc/input/single_scrollbar_animation_controller_thinning.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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 client_(&host_impl_) {} 60 client_(&host_impl_) {}
61 61
62 protected: 62 protected:
63 const base::TimeDelta kThinningDuration = base::TimeDelta::FromSeconds(2); 63 const base::TimeDelta kThinningDuration = base::TimeDelta::FromSeconds(2);
64 64
65 void SetUp() override { 65 void SetUp() override {
66 std::unique_ptr<LayerImpl> scroll_layer = 66 std::unique_ptr<LayerImpl> scroll_layer =
67 LayerImpl::Create(host_impl_.active_tree(), 1); 67 LayerImpl::Create(host_impl_.active_tree(), 1);
68 std::unique_ptr<LayerImpl> clip = 68 std::unique_ptr<LayerImpl> clip =
69 LayerImpl::Create(host_impl_.active_tree(), 3); 69 LayerImpl::Create(host_impl_.active_tree(), 3);
70 scroll_layer->SetElementId( 70 ElementId element_id;
71 LayerIdToElementIdForTesting(scroll_layer->id())); 71 element_id.id = scroll_layer->id();
72 scroll_layer->SetElementId(element_id);
72 clip_layer_ = clip.get(); 73 clip_layer_ = clip.get();
73 scroll_layer->SetScrollClipLayer(clip_layer_->id()); 74 scroll_layer->SetScrollClipLayer(clip_layer_->id());
74 LayerImpl* scroll_layer_ptr = scroll_layer.get(); 75 LayerImpl* scroll_layer_ptr = scroll_layer.get();
75 76
76 const int kId = 2; 77 const int kId = 2;
77 const int kThumbThickness = 10; 78 const int kThumbThickness = 10;
78 const int kTrackStart = 0; 79 const int kTrackStart = 0;
79 const int kTrackLength = 100; 80 const int kTrackLength = 100;
80 const bool kIsLeftSideVerticalScrollbar = false; 81 const bool kIsLeftSideVerticalScrollbar = false;
81 const bool kIsOverlayScrollbar = true; 82 const bool kIsOverlayScrollbar = true;
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 scrollbar_layer_->thumb_thickness_scale_factor()); 399 scrollbar_layer_->thumb_thickness_scale_factor());
399 400
400 time += kThinningDuration / 2; 401 time += kThinningDuration / 2;
401 scrollbar_controller_->Animate(time); 402 scrollbar_controller_->Animate(time);
402 EXPECT_FLOAT_EQ(kIdleThicknessScale, 403 EXPECT_FLOAT_EQ(kIdleThicknessScale,
403 scrollbar_layer_->thumb_thickness_scale_factor()); 404 scrollbar_layer_->thumb_thickness_scale_factor());
404 } 405 }
405 406
406 } // namespace 407 } // namespace
407 } // namespace cc 408 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698