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

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

Issue 2171143002: cc: Get rid of non-delegated rendering in most cc unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@killdirecttests
Patch Set: fakeoutputsurface: no-constructor 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 | « cc/layers/nine_patch_layer_unittest.cc ('k') | cc/layers/picture_image_layer_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"
11 #include "testing/gmock/include/gmock/gmock.h" 11 #include "testing/gmock/include/gmock/gmock.h"
12 12
13 using ::testing::Mock; 13 using ::testing::Mock;
14 using ::testing::_; 14 using ::testing::_;
15 15
16 namespace cc { 16 namespace cc {
17 17
18 namespace { 18 namespace {
19 19
20 class MockScrollbar : public FakeScrollbar { 20 class MockScrollbar : public FakeScrollbar {
21 public: 21 public:
22 MockScrollbar() : FakeScrollbar(true, true, true) {} 22 MockScrollbar() : FakeScrollbar(true, true, true) {}
23 MOCK_METHOD3(PaintPart, 23 MOCK_METHOD3(PaintPart,
24 void(SkCanvas* canvas, 24 void(SkCanvas* canvas,
25 ScrollbarPart part, 25 ScrollbarPart part,
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_(FakeLayerTreeHostClient::DIRECT_3D); 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; 36 RendererCapabilities renderer_capabilities;
37 renderer_capabilities.max_texture_size = 2048; 37 renderer_capabilities.max_texture_size = 2048;
38 layer_tree_host_->set_renderer_capabilities(renderer_capabilities); 38 layer_tree_host_->set_renderer_capabilities(renderer_capabilities);
39 39
40 MockScrollbar* scrollbar = new MockScrollbar(); 40 MockScrollbar* scrollbar = new MockScrollbar();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 EXPECT_CALL(*scrollbar, PaintPart(_, THUMB, _)).Times(0); 75 EXPECT_CALL(*scrollbar, PaintPart(_, THUMB, _)).Times(0);
76 EXPECT_CALL(*scrollbar, PaintPart(_, TRACK, _)).Times(1); 76 EXPECT_CALL(*scrollbar, PaintPart(_, TRACK, _)).Times(1);
77 scrollbar->set_needs_paint_thumb(false); 77 scrollbar->set_needs_paint_thumb(false);
78 scrollbar->set_needs_paint_track(true); 78 scrollbar->set_needs_paint_track(true);
79 scrollbar_layer->Update(); 79 scrollbar_layer->Update();
80 Mock::VerifyAndClearExpectations(scrollbar); 80 Mock::VerifyAndClearExpectations(scrollbar);
81 } 81 }
82 82
83 } // namespace 83 } // namespace
84 } // namespace cc 84 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/nine_patch_layer_unittest.cc ('k') | cc/layers/picture_image_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698