OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/animation_container.h" | 5 #include "app/animation_container.h" |
6 #include "app/animation_container_observer.h" | 6 #include "app/animation_container_observer.h" |
7 #include "app/linear_animation.h" | 7 #include "app/linear_animation.h" |
8 #include "app/test_animation_delegate.h" | 8 #include "app/test_animation_delegate.h" |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // We expect to get these two calls: the animation progressed, and then when | 102 // We expect to get these two calls: the animation progressed, and then when |
103 // the animation completed the container went empty. | 103 // the animation completed the container went empty. |
104 EXPECT_CALL(observer, AnimationContainerProgressed(container.get())).Times( | 104 EXPECT_CALL(observer, AnimationContainerProgressed(container.get())).Times( |
105 AtLeast(1)); | 105 AtLeast(1)); |
106 EXPECT_CALL(observer, AnimationContainerEmpty(container.get())).Times(1); | 106 EXPECT_CALL(observer, AnimationContainerEmpty(container.get())).Times(1); |
107 | 107 |
108 // Start the animation. | 108 // Start the animation. |
109 animation1.Start(); | 109 animation1.Start(); |
110 EXPECT_TRUE(container->is_running()); | 110 EXPECT_TRUE(container->is_running()); |
111 | 111 |
112 // Run the message loop the delegate quits the message loop when notified. | 112 // Run the message loop. The delegate quits the message loop when notified. |
113 MessageLoop::current()->Run(); | 113 MessageLoop::current()->Run(); |
114 | 114 |
115 // The timer should have finished. | 115 // The timer should have finished. |
116 EXPECT_TRUE(delegate1.finished()); | 116 EXPECT_TRUE(delegate1.finished()); |
117 | 117 |
118 // And the container should no longer be runnings. | 118 // And the container should no longer be running. |
119 EXPECT_FALSE(container->is_running()); | 119 EXPECT_FALSE(container->is_running()); |
120 | 120 |
121 container->set_observer(NULL); | 121 container->set_observer(NULL); |
122 } | 122 } |
OLD | NEW |