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/linear_animation.h" | 5 #include "app/linear_animation.h" |
6 #include "app/test_animation_delegate.h" | 6 #include "app/test_animation_delegate.h" |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include "base/win_util.h" | 8 #include "base/win/windows_version.h" |
9 #endif | 9 #endif |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 class AnimationTest: public testing::Test { | 12 class AnimationTest: public testing::Test { |
13 private: | 13 private: |
14 MessageLoopForUI message_loop_; | 14 MessageLoopForUI message_loop_; |
15 }; | 15 }; |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 TEST_F(AnimationTest, DeleteFromEnd) { | 115 TEST_F(AnimationTest, DeleteFromEnd) { |
116 DeletingAnimationDelegate delegate; | 116 DeletingAnimationDelegate delegate; |
117 RunAnimation* animation = new RunAnimation(150, &delegate); | 117 RunAnimation* animation = new RunAnimation(150, &delegate); |
118 animation->Start(); | 118 animation->Start(); |
119 MessageLoop::current()->Run(); | 119 MessageLoop::current()->Run(); |
120 // delegate should have deleted animation. | 120 // delegate should have deleted animation. |
121 } | 121 } |
122 | 122 |
123 TEST_F(AnimationTest, ShouldRenderRichAnimation) { | 123 TEST_F(AnimationTest, ShouldRenderRichAnimation) { |
124 #if defined(OS_WIN) | 124 #if defined(OS_WIN) |
125 if (win_util::GetWinVersion() >= win_util::WINVERSION_VISTA) { | 125 if (base::win::GetVersion() >= base::win::VERSION_VISTA) { |
126 BOOL result; | 126 BOOL result; |
127 ASSERT_NE( | 127 ASSERT_NE( |
128 0, ::SystemParametersInfo(SPI_GETCLIENTAREAANIMATION, 0, &result, 0)); | 128 0, ::SystemParametersInfo(SPI_GETCLIENTAREAANIMATION, 0, &result, 0)); |
129 // ShouldRenderRichAnimation() should check the SPI_GETCLIENTAREAANIMATION | 129 // ShouldRenderRichAnimation() should check the SPI_GETCLIENTAREAANIMATION |
130 // value on Vista. | 130 // value on Vista. |
131 EXPECT_EQ(!!result, Animation::ShouldRenderRichAnimation()); | 131 EXPECT_EQ(!!result, Animation::ShouldRenderRichAnimation()); |
132 } else { | 132 } else { |
133 // On XP, the function should check the SM_REMOTESESSION value. | 133 // On XP, the function should check the SM_REMOTESESSION value. |
134 EXPECT_EQ(!::GetSystemMetrics(SM_REMOTESESSION), | 134 EXPECT_EQ(!::GetSystemMetrics(SM_REMOTESESSION), |
135 Animation::ShouldRenderRichAnimation()); | 135 Animation::ShouldRenderRichAnimation()); |
136 } | 136 } |
137 #else | 137 #else |
138 EXPECT_TRUE(Animation::ShouldRenderRichAnimation()); | 138 EXPECT_TRUE(Animation::ShouldRenderRichAnimation()); |
139 #endif | 139 #endif |
140 } | 140 } |
OLD | NEW |