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

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

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase Created 4 years, 8 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/input/top_controls_manager.cc ('k') | cc/layers/draw_properties.h » ('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 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/top_controls_manager.h" 5 #include "cc/input/top_controls_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <memory>
9 10
10 #include "base/logging.h" 11 #include "base/logging.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "cc/input/top_controls_manager_client.h" 13 #include "cc/input/top_controls_manager_client.h"
14 #include "cc/layers/layer_impl.h" 14 #include "cc/layers/layer_impl.h"
15 #include "cc/test/fake_impl_task_runner_provider.h" 15 #include "cc/test/fake_impl_task_runner_provider.h"
16 #include "cc/test/fake_layer_tree_host_impl.h" 16 #include "cc/test/fake_layer_tree_host_impl.h"
17 #include "cc/test/test_shared_bitmap_manager.h" 17 #include "cc/test/test_shared_bitmap_manager.h"
18 #include "cc/test/test_task_graph_runner.h" 18 #include "cc/test/test_task_graph_runner.h"
19 #include "cc/trees/layer_tree_impl.h" 19 #include "cc/trees/layer_tree_impl.h"
20 #include "testing/gtest/include/gtest/gtest.h" 20 #include "testing/gtest/include/gtest/gtest.h"
21 #include "ui/gfx/geometry/vector2d_f.h" 21 #include "ui/gfx/geometry/vector2d_f.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 return manager_.get(); 80 return manager_.get();
81 } 81 }
82 82
83 void SetTopControlsHeight(float height) { top_controls_height_ = height; } 83 void SetTopControlsHeight(float height) { top_controls_height_ = height; }
84 84
85 private: 85 private:
86 FakeImplTaskRunnerProvider task_runner_provider_; 86 FakeImplTaskRunnerProvider task_runner_provider_;
87 TestSharedBitmapManager shared_bitmap_manager_; 87 TestSharedBitmapManager shared_bitmap_manager_;
88 TestTaskGraphRunner task_graph_runner_; 88 TestTaskGraphRunner task_graph_runner_;
89 FakeLayerTreeHostImpl host_impl_; 89 FakeLayerTreeHostImpl host_impl_;
90 scoped_ptr<LayerTreeImpl> active_tree_; 90 std::unique_ptr<LayerTreeImpl> active_tree_;
91 scoped_ptr<LayerImpl> root_scroll_layer_; 91 std::unique_ptr<LayerImpl> root_scroll_layer_;
92 scoped_ptr<TopControlsManager> manager_; 92 std::unique_ptr<TopControlsManager> manager_;
93 bool redraw_needed_; 93 bool redraw_needed_;
94 bool update_draw_properties_needed_; 94 bool update_draw_properties_needed_;
95 95
96 float top_controls_shown_ratio_; 96 float top_controls_shown_ratio_;
97 float top_controls_height_; 97 float top_controls_height_;
98 float top_controls_show_threshold_; 98 float top_controls_show_threshold_;
99 float top_controls_hide_threshold_; 99 float top_controls_hide_threshold_;
100 }; 100 };
101 101
102 TEST(TopControlsManagerTest, EnsureScrollThresholdApplied) { 102 TEST(TopControlsManagerTest, EnsureScrollThresholdApplied) {
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 EXPECT_FLOAT_EQ(20.f, pending.y()); 464 EXPECT_FLOAT_EQ(20.f, pending.y());
465 EXPECT_FLOAT_EQ(0.f, manager->ControlsTopOffset()); 465 EXPECT_FLOAT_EQ(0.f, manager->ControlsTopOffset());
466 EXPECT_FLOAT_EQ(0.f, manager->ContentTopOffset()); 466 EXPECT_FLOAT_EQ(0.f, manager->ContentTopOffset());
467 EXPECT_FLOAT_EQ(1.f, client.CurrentTopControlsShownRatio()); 467 EXPECT_FLOAT_EQ(1.f, client.CurrentTopControlsShownRatio());
468 manager->ScrollEnd(); 468 manager->ScrollEnd();
469 } 469 }
470 470
471 471
472 } // namespace 472 } // namespace
473 } // namespace cc 473 } // namespace cc
OLDNEW
« no previous file with comments | « cc/input/top_controls_manager.cc ('k') | cc/layers/draw_properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698