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

Side by Side Diff: ui/views/animation/ink_drop_animation_controller_factory_unittest.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr 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
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 "ui/views/animation/ink_drop_animation_controller_factory.h"
6
7 #include <memory>
8
5 #include "base/macros.h" 9 #include "base/macros.h"
6 #include "base/memory/scoped_ptr.h"
7 #include "base/test/test_mock_time_task_runner.h" 10 #include "base/test/test_mock_time_task_runner.h"
8 #include "base/thread_task_runner_handle.h" 11 #include "base/thread_task_runner_handle.h"
9 #include "base/timer/timer.h" 12 #include "base/timer/timer.h"
10 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
11 #include "ui/base/material_design/material_design_controller.h" 14 #include "ui/base/material_design/material_design_controller.h"
12 #include "ui/base/test/material_design_controller_test_api.h" 15 #include "ui/base/test/material_design_controller_test_api.h"
13 #include "ui/compositor/scoped_animation_duration_scale_mode.h" 16 #include "ui/compositor/scoped_animation_duration_scale_mode.h"
14 #include "ui/views/animation/ink_drop_animation_controller.h" 17 #include "ui/views/animation/ink_drop_animation_controller.h"
15 #include "ui/views/animation/ink_drop_animation_controller_factory.h"
16 #include "ui/views/animation/ink_drop_animation_controller_impl.h" 18 #include "ui/views/animation/ink_drop_animation_controller_impl.h"
17 #include "ui/views/animation/ink_drop_host.h" 19 #include "ui/views/animation/ink_drop_host.h"
18 #include "ui/views/animation/ink_drop_state.h" 20 #include "ui/views/animation/ink_drop_state.h"
19 #include "ui/views/animation/test/test_ink_drop_host.h" 21 #include "ui/views/animation/test/test_ink_drop_host.h"
20 22
21 namespace views { 23 namespace views {
22 24
23 class InkDropAnimationControllerFactoryTest 25 class InkDropAnimationControllerFactoryTest
24 : public testing::TestWithParam< 26 : public testing::TestWithParam<
25 testing::tuple<ui::MaterialDesignController::Mode>> { 27 testing::tuple<ui::MaterialDesignController::Mode>> {
26 public: 28 public:
27 InkDropAnimationControllerFactoryTest(); 29 InkDropAnimationControllerFactoryTest();
28 ~InkDropAnimationControllerFactoryTest(); 30 ~InkDropAnimationControllerFactoryTest();
29 31
30 protected: 32 protected:
31 // A dummy InkDropHost required to create an InkDropAnimationController. 33 // A dummy InkDropHost required to create an InkDropAnimationController.
32 TestInkDropHost test_ink_drop_host_; 34 TestInkDropHost test_ink_drop_host_;
33 35
34 // The InkDropAnimationController returned by the 36 // The InkDropAnimationController returned by the
35 // InkDropAnimationControllerFactory test target. 37 // InkDropAnimationControllerFactory test target.
36 scoped_ptr<InkDropAnimationController> ink_drop_animation_controller_; 38 std::unique_ptr<InkDropAnimationController> ink_drop_animation_controller_;
37 39
38 private: 40 private:
39 // Extracts and returns the material design mode from the test parameters. 41 // Extracts and returns the material design mode from the test parameters.
40 ui::MaterialDesignController::Mode GetMaterialMode() const; 42 ui::MaterialDesignController::Mode GetMaterialMode() const;
41 43
42 scoped_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_; 44 std::unique_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_;
43 45
44 // Required by base::Timer's. 46 // Required by base::Timer's.
45 scoped_ptr<base::ThreadTaskRunnerHandle> thread_task_runner_handle_; 47 std::unique_ptr<base::ThreadTaskRunnerHandle> thread_task_runner_handle_;
46 48
47 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationControllerFactoryTest); 49 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationControllerFactoryTest);
48 }; 50 };
49 51
50 InkDropAnimationControllerFactoryTest::InkDropAnimationControllerFactoryTest() 52 InkDropAnimationControllerFactoryTest::InkDropAnimationControllerFactoryTest()
51 : ink_drop_animation_controller_(nullptr) { 53 : ink_drop_animation_controller_(nullptr) {
52 // Any call by a previous test to MaterialDesignController::GetMode() will 54 // Any call by a previous test to MaterialDesignController::GetMode() will
53 // initialize and cache the mode. This ensures that these tests will run from 55 // initialize and cache the mode. This ensures that these tests will run from
54 // a non-initialized state. 56 // a non-initialized state.
55 ui::test::MaterialDesignControllerTestAPI::UninitializeMode(); 57 ui::test::MaterialDesignControllerTestAPI::UninitializeMode();
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTION_PENDING); 156 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTION_PENDING);
155 ink_drop_animation_controller_->AnimateToState( 157 ink_drop_animation_controller_->AnimateToState(
156 InkDropState::ALTERNATE_ACTION_PENDING); 158 InkDropState::ALTERNATE_ACTION_PENDING);
157 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTIVATED); 159 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTIVATED);
158 ink_drop_animation_controller_->AnimateToState(InkDropState::DEACTIVATED); 160 ink_drop_animation_controller_->AnimateToState(InkDropState::DEACTIVATED);
159 EXPECT_EQ(InkDropState::HIDDEN, 161 EXPECT_EQ(InkDropState::HIDDEN,
160 ink_drop_animation_controller_->GetTargetInkDropState()); 162 ink_drop_animation_controller_->GetTargetInkDropState());
161 } 163 }
162 164
163 } // namespace views 165 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/animation/ink_drop_animation_controller_factory.cc ('k') | ui/views/animation/ink_drop_animation_controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698