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

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

Issue 2282433002: Revert of cc: Delete all the RendererCapabilities. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-prepare-mailbox-param
Patch Set: Created 4 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/layers/heads_up_display_layer_impl.cc ('k') | cc/layers/picture_layer_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/layers/painted_scrollbar_layer.h" 5 #include "cc/layers/painted_scrollbar_layer.h"
6 6
7 #include "cc/test/fake_layer_tree_host.h" 7 #include "cc/test/fake_layer_tree_host.h"
8 #include "cc/test/fake_layer_tree_host_client.h" 8 #include "cc/test/fake_layer_tree_host_client.h"
9 #include "cc/test/fake_scrollbar.h" 9 #include "cc/test/fake_scrollbar.h"
10 #include "cc/test/test_task_graph_runner.h" 10 #include "cc/test/test_task_graph_runner.h"
(...skipping 15 matching lines...) Expand all
26 const gfx::Rect& content_rect)); 26 const gfx::Rect& content_rect));
27 }; 27 };
28 28
29 TEST(PaintedScrollbarLayerTest, NeedsPaint) { 29 TEST(PaintedScrollbarLayerTest, NeedsPaint) {
30 FakeLayerTreeHostClient fake_client_; 30 FakeLayerTreeHostClient fake_client_;
31 TestTaskGraphRunner task_graph_runner_; 31 TestTaskGraphRunner task_graph_runner_;
32 std::unique_ptr<FakeLayerTreeHost> layer_tree_host_; 32 std::unique_ptr<FakeLayerTreeHost> layer_tree_host_;
33 33
34 layer_tree_host_ = 34 layer_tree_host_ =
35 FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_); 35 FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_);
36 RendererCapabilities renderer_capabilities;
37 renderer_capabilities.max_texture_size = 2048;
38 layer_tree_host_->set_renderer_capabilities(renderer_capabilities);
36 39
37 MockScrollbar* scrollbar = new MockScrollbar(); 40 MockScrollbar* scrollbar = new MockScrollbar();
38 scoped_refptr<PaintedScrollbarLayer> scrollbar_layer = 41 scoped_refptr<PaintedScrollbarLayer> scrollbar_layer =
39 PaintedScrollbarLayer::Create(std::unique_ptr<Scrollbar>(scrollbar), 1); 42 PaintedScrollbarLayer::Create(std::unique_ptr<Scrollbar>(scrollbar), 1);
40 43
41 scrollbar_layer->SetIsDrawable(true); 44 scrollbar_layer->SetIsDrawable(true);
42 scrollbar_layer->SetBounds(gfx::Size(100, 100)); 45 scrollbar_layer->SetBounds(gfx::Size(100, 100));
43 46
44 layer_tree_host_->SetRootLayer(scrollbar_layer); 47 layer_tree_host_->SetRootLayer(scrollbar_layer);
45 EXPECT_EQ(scrollbar_layer->layer_tree_host(), layer_tree_host_.get()); 48 EXPECT_EQ(scrollbar_layer->layer_tree_host(), layer_tree_host_.get());
(...skipping 26 matching lines...) Expand all
72 EXPECT_CALL(*scrollbar, PaintPart(_, THUMB, _)).Times(0); 75 EXPECT_CALL(*scrollbar, PaintPart(_, THUMB, _)).Times(0);
73 EXPECT_CALL(*scrollbar, PaintPart(_, TRACK, _)).Times(1); 76 EXPECT_CALL(*scrollbar, PaintPart(_, TRACK, _)).Times(1);
74 scrollbar->set_needs_paint_thumb(false); 77 scrollbar->set_needs_paint_thumb(false);
75 scrollbar->set_needs_paint_track(true); 78 scrollbar->set_needs_paint_track(true);
76 scrollbar_layer->Update(); 79 scrollbar_layer->Update();
77 Mock::VerifyAndClearExpectations(scrollbar); 80 Mock::VerifyAndClearExpectations(scrollbar);
78 } 81 }
79 82
80 } // namespace 83 } // namespace
81 } // namespace cc 84 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/heads_up_display_layer_impl.cc ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698