| OLD | NEW |
| 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "ui/views/animation/ink_drop_impl.h" | 7 #include "ui/views/animation/ink_drop_impl.h" |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 std::unique_ptr<test::InkDropImplTestApi> test_api_; | 57 std::unique_ptr<test::InkDropImplTestApi> test_api_; |
| 58 | 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(InkDropImplTest); | 59 DISALLOW_COPY_AND_ASSIGN(InkDropImplTest); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 InkDropImplTest::InkDropImplTest() | 62 InkDropImplTest::InkDropImplTest() |
| 63 : task_runner_(new base::TestSimpleTaskRunner), | 63 : task_runner_(new base::TestSimpleTaskRunner), |
| 64 thread_task_runner_handle_( | 64 thread_task_runner_handle_( |
| 65 new base::ThreadTaskRunnerHandle(task_runner_)), | 65 new base::ThreadTaskRunnerHandle(task_runner_)), |
| 66 ink_drop_host_(base::MakeUnique<TestInkDropHost>()), | 66 ink_drop_host_(base::MakeUnique<TestInkDropHost>()), |
| 67 ink_drop_(base::MakeUnique<InkDropImpl>(ink_drop_host_.get())), | 67 ink_drop_( |
| 68 base::MakeUnique<InkDropImpl>(ink_drop_host_.get(), gfx::Size())), |
| 68 test_api_(base::MakeUnique<test::InkDropImplTestApi>(ink_drop_.get())) { | 69 test_api_(base::MakeUnique<test::InkDropImplTestApi>(ink_drop_.get())) { |
| 69 ink_drop_host_->set_disable_timers_for_test(true); | 70 ink_drop_host_->set_disable_timers_for_test(true); |
| 70 } | 71 } |
| 71 | 72 |
| 72 InkDropImplTest::~InkDropImplTest() {} | 73 InkDropImplTest::~InkDropImplTest() {} |
| 73 | 74 |
| 74 void InkDropImplTest::RunPendingTasks() { | 75 void InkDropImplTest::RunPendingTasks() { |
| 75 task_runner_->RunPendingTasks(); | 76 task_runner_->RunPendingTasks(); |
| 76 EXPECT_FALSE(task_runner_->HasPendingTask()); | 77 EXPECT_FALSE(task_runner_->HasPendingTask()); |
| 77 } | 78 } |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 EXPECT_TRUE(test_api()->IsHighlightFadingInOrVisible()); | 559 EXPECT_TRUE(test_api()->IsHighlightFadingInOrVisible()); |
| 559 | 560 |
| 560 ink_drop()->SetHovered(false); | 561 ink_drop()->SetHovered(false); |
| 561 ink_drop()->SetFocused(false); | 562 ink_drop()->SetFocused(false); |
| 562 | 563 |
| 563 EXPECT_TRUE(test_api()->IsHighlightFadingInOrVisible()); | 564 EXPECT_TRUE(test_api()->IsHighlightFadingInOrVisible()); |
| 564 EXPECT_FALSE(test_api()->ShouldHighlight()); | 565 EXPECT_FALSE(test_api()->ShouldHighlight()); |
| 565 } | 566 } |
| 566 | 567 |
| 567 } // namespace views | 568 } // namespace views |
| OLD | NEW |