OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/common/shelf/shelf_view.h" | 5 #include "ash/common/shelf/shelf_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 2606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2617 DISALLOW_COPY_AND_ASSIGN(TestOverflowButtonShellDelegate); | 2617 DISALLOW_COPY_AND_ASSIGN(TestOverflowButtonShellDelegate); |
2618 }; | 2618 }; |
2619 | 2619 |
2620 // A scoped wrapper around TestMockTimeTaskRunner that replaces message loop's | 2620 // A scoped wrapper around TestMockTimeTaskRunner that replaces message loop's |
2621 // task runner with a TestMockTimeTaskRunner and resets it back at the end of | 2621 // task runner with a TestMockTimeTaskRunner and resets it back at the end of |
2622 // the scope. | 2622 // the scope. |
2623 class ScopedMockTaskRunnerWrapper { | 2623 class ScopedMockTaskRunnerWrapper { |
2624 public: | 2624 public: |
2625 ScopedMockTaskRunnerWrapper() { | 2625 ScopedMockTaskRunnerWrapper() { |
2626 mock_task_runner_ = new base::TestMockTimeTaskRunner; | 2626 mock_task_runner_ = new base::TestMockTimeTaskRunner; |
2627 previous_task_runner_ = base::MessageLoop::current()->task_runner(); | 2627 previous_task_runner_ = base::ThreadTaskRunnerHandle::Get(); |
2628 base::MessageLoop::current()->SetTaskRunner(mock_task_runner_); | 2628 base::MessageLoop::current()->SetTaskRunner(mock_task_runner_); |
2629 } | 2629 } |
2630 | 2630 |
2631 ~ScopedMockTaskRunnerWrapper() { | 2631 ~ScopedMockTaskRunnerWrapper() { |
2632 DCHECK_EQ(mock_task_runner_, base::MessageLoop::current()->task_runner()); | 2632 DCHECK_EQ(mock_task_runner_, base::ThreadTaskRunnerHandle::Get()); |
2633 mock_task_runner_->ClearPendingTasks(); | 2633 mock_task_runner_->ClearPendingTasks(); |
2634 base::MessageLoop::current()->SetTaskRunner(previous_task_runner_); | 2634 base::MessageLoop::current()->SetTaskRunner(previous_task_runner_); |
2635 } | 2635 } |
2636 | 2636 |
2637 void FastForwardUntilNoTasksRemain() { | 2637 void FastForwardUntilNoTasksRemain() { |
2638 mock_task_runner_->FastForwardUntilNoTasksRemain(); | 2638 mock_task_runner_->FastForwardUntilNoTasksRemain(); |
2639 } | 2639 } |
2640 | 2640 |
2641 private: | 2641 private: |
2642 scoped_refptr<base::TestMockTimeTaskRunner> mock_task_runner_; | 2642 scoped_refptr<base::TestMockTimeTaskRunner> mock_task_runner_; |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3171 IsEmpty()); | 3171 IsEmpty()); |
3172 | 3172 |
3173 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); | 3173 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); |
3174 } | 3174 } |
3175 } | 3175 } |
3176 | 3176 |
3177 #endif // !defined(OS_WIN) | 3177 #endif // !defined(OS_WIN) |
3178 | 3178 |
3179 } // namespace test | 3179 } // namespace test |
3180 } // namespace ash | 3180 } // namespace ash |
OLD | NEW |