Chromium Code Reviews| 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 "ash/wm/session_state_animator_impl.h" | |
| 6 | |
| 5 #include "ash/public/cpp/shell_window_ids.h" | 7 #include "ash/public/cpp/shell_window_ids.h" |
| 6 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 7 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
| 8 #include "ash/wm/session_state_animator.h" | 10 #include "ash/wm/session_state_animator.h" |
| 9 #include "ash/wm/session_state_animator_impl.h" | 11 #include "base/bind.h" |
| 12 #include "base/run_loop.h" | |
| 10 #include "ui/aura/client/aura_constants.h" | 13 #include "ui/aura/client/aura_constants.h" |
| 11 | 14 |
| 12 typedef ash::test::AshTestBase SessionStateAnimatiorImplContainersTest; | 15 typedef ash::test::AshTestBase SessionStateAnimatiorImplContainersTest; |
| 13 | 16 |
| 14 namespace ash { | 17 namespace ash { |
| 15 namespace { | 18 namespace { |
| 16 | 19 |
| 17 bool ParentHasWindowWithId(const aura::Window* window, int id) { | 20 bool ParentHasWindowWithId(const aura::Window* window, int id) { |
| 18 return window->parent()->id() == id; | 21 return window->parent()->id() == id; |
| 19 } | 22 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 SessionStateAnimatorImpl::GetContainers( | 76 SessionStateAnimatorImpl::GetContainers( |
| 74 SessionStateAnimator::LOCK_SCREEN_RELATED_CONTAINERS, &containers); | 77 SessionStateAnimator::LOCK_SCREEN_RELATED_CONTAINERS, &containers); |
| 75 EXPECT_TRUE(ContainersHaveWindowWithId( | 78 EXPECT_TRUE(ContainersHaveWindowWithId( |
| 76 containers, kShellWindowId_LockScreenRelatedContainersContainer)); | 79 containers, kShellWindowId_LockScreenRelatedContainersContainer)); |
| 77 | 80 |
| 78 // Empty mask should clear the container. | 81 // Empty mask should clear the container. |
| 79 SessionStateAnimatorImpl::GetContainers(0, &containers); | 82 SessionStateAnimatorImpl::GetContainers(0, &containers); |
| 80 EXPECT_TRUE(containers.empty()); | 83 EXPECT_TRUE(containers.empty()); |
| 81 } | 84 } |
| 82 | 85 |
| 86 TEST_F(SessionStateAnimatiorImplContainersTest, | |
|
James Cook
2017/04/19 16:41:45
nit: Reference the bug or explain what this is tes
xiyuan
2017/04/19 17:30:19
Done.
| |
| 87 AnimationCallbackOnMultiDisplay) { | |
| 88 UpdateDisplay("200x200,400x400"); | |
| 89 | |
| 90 int callback_count = 0; | |
| 91 SessionStateAnimatorImpl animator; | |
| 92 animator.StartAnimationWithCallback( | |
| 93 SessionStateAnimator::LOCK_SCREEN_CONTAINERS, | |
| 94 SessionStateAnimator::ANIMATION_LIFT, | |
| 95 SessionStateAnimator::ANIMATION_SPEED_IMMEDIATE, | |
| 96 base::Bind([](int* count) { ++(*count); }, &callback_count)); | |
| 97 base::RunLoop().RunUntilIdle(); | |
| 98 EXPECT_EQ(1, callback_count); | |
| 99 } | |
| 100 | |
| 83 } // namespace ash | 101 } // namespace ash |
| OLD | NEW |