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

Side by Side Diff: cc/layers/scrollbar_layer_unittest.cc

Issue 254643002: Scrollbars should get notifications from all scrollable layers up to container. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test issues. Created 6 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 | Annotate | Revision Log
« no previous file with comments | « cc/layers/scrollbar_layer_impl_base.cc ('k') | cc/trees/layer_tree_host_impl_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 "base/containers/hash_tables.h" 5 #include "base/containers/hash_tables.h"
6 #include "cc/animation/scrollbar_animation_controller.h" 6 #include "cc/animation/scrollbar_animation_controller.h"
7 #include "cc/layers/append_quads_data.h" 7 #include "cc/layers/append_quads_data.h"
8 #include "cc/layers/painted_scrollbar_layer.h" 8 #include "cc/layers/painted_scrollbar_layer.h"
9 #include "cc/layers/painted_scrollbar_layer_impl.h" 9 #include "cc/layers/painted_scrollbar_layer_impl.h"
10 #include "cc/layers/scrollbar_layer_interface.h" 10 #include "cc/layers/scrollbar_layer_interface.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 if (use_solid_color_scrollbar) { 45 if (use_solid_color_scrollbar) {
46 const bool kIsLeftSideVerticalScrollbar = false; 46 const bool kIsLeftSideVerticalScrollbar = false;
47 child2 = SolidColorScrollbarLayer::Create(scrollbar->Orientation(), 47 child2 = SolidColorScrollbarLayer::Create(scrollbar->Orientation(),
48 thumb_thickness, 48 thumb_thickness,
49 track_start, 49 track_start,
50 kIsLeftSideVerticalScrollbar, 50 kIsLeftSideVerticalScrollbar,
51 child1->id()); 51 child1->id());
52 } else { 52 } else {
53 child2 = PaintedScrollbarLayer::Create(scrollbar.Pass(), child1->id()); 53 child2 = PaintedScrollbarLayer::Create(scrollbar.Pass(), child1->id());
54 } 54 }
55 child2->ToScrollbarLayer()->SetClipLayer(layer_tree_root->id());
55 layer_tree_root->AddChild(child1); 56 layer_tree_root->AddChild(child1);
56 layer_tree_root->InsertChild(child2, reverse_order ? 0 : 1); 57 layer_tree_root->InsertChild(child2, reverse_order ? 0 : 1);
57 host->SetRootLayer(layer_tree_root); 58 host->SetRootLayer(layer_tree_root);
58 return host->CommitAndCreateLayerImplTree(); 59 return host->CommitAndCreateLayerImplTree();
59 } 60 }
60 61
61 TEST(ScrollbarLayerTest, ResolveScrollLayerPointer) { 62 TEST(ScrollbarLayerTest, ResolveScrollLayerPointer) {
62 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); 63 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create();
63 scoped_ptr<Scrollbar> scrollbar(new FakeScrollbar); 64 scoped_ptr<Scrollbar> scrollbar(new FakeScrollbar);
64 LayerImpl* layer_impl_tree_root = LayerImplForScrollAreaAndScrollbar( 65 LayerImpl* layer_impl_tree_root = LayerImplForScrollAreaAndScrollbar(
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f); 884 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f);
884 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f); 885 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f);
885 886
886 // Horizontal Scrollbars. 887 // Horizontal Scrollbars.
887 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f); 888 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f);
888 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f); 889 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f);
889 } 890 }
890 891
891 } // namespace 892 } // namespace
892 } // namespace cc 893 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/scrollbar_layer_impl_base.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698