OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 }; | 87 }; |
88 | 88 |
89 TEST_F(GraphicsLayerTest, updateLayerPreserves3DWithAnimations) | 89 TEST_F(GraphicsLayerTest, updateLayerPreserves3DWithAnimations) |
90 { | 90 { |
91 ASSERT_FALSE(m_platformLayer->hasActiveAnimation()); | 91 ASSERT_FALSE(m_platformLayer->hasActiveAnimation()); |
92 | 92 |
93 OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(Platform::current()->composi
torSupport()->createFloatAnimationCurve()); | 93 OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(Platform::current()->composi
torSupport()->createFloatAnimationCurve()); |
94 curve->add(WebFloatKeyframe(0.0, 0.0)); | 94 curve->add(WebFloatKeyframe(0.0, 0.0)); |
95 OwnPtr<WebAnimation> floatAnimation(adoptPtr(Platform::current()->compositor
Support()->createAnimation(*curve, WebAnimation::TargetPropertyOpacity))); | 95 OwnPtr<WebAnimation> floatAnimation(adoptPtr(Platform::current()->compositor
Support()->createAnimation(*curve, WebAnimation::TargetPropertyOpacity))); |
96 int animationId = floatAnimation->id(); | 96 int animationId = floatAnimation->id(); |
97 ASSERT_TRUE(m_platformLayer->addAnimation(floatAnimation.get())); | 97 ASSERT_TRUE(m_platformLayer->addAnimation(floatAnimation.leakPtr())); |
98 | 98 |
99 ASSERT_TRUE(m_platformLayer->hasActiveAnimation()); | 99 ASSERT_TRUE(m_platformLayer->hasActiveAnimation()); |
100 | 100 |
101 m_graphicsLayer->setPreserves3D(true); | 101 m_graphicsLayer->setPreserves3D(true); |
102 | 102 |
103 m_platformLayer = m_graphicsLayer->platformLayer(); | 103 m_platformLayer = m_graphicsLayer->platformLayer(); |
104 ASSERT_TRUE(m_platformLayer); | 104 ASSERT_TRUE(m_platformLayer); |
105 | 105 |
106 ASSERT_TRUE(m_platformLayer->hasActiveAnimation()); | 106 ASSERT_TRUE(m_platformLayer->hasActiveAnimation()); |
107 m_platformLayer->removeAnimation(animationId); | 107 m_platformLayer->removeAnimation(animationId); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 EXPECT_FALSE(m_graphicsLayer->contentsLayer()); | 163 EXPECT_FALSE(m_graphicsLayer->contentsLayer()); |
164 | 164 |
165 m_graphicsLayer->setContentsToSolidColor(Color::white); | 165 m_graphicsLayer->setContentsToSolidColor(Color::white); |
166 EXPECT_TRUE(m_graphicsLayer->contentsLayer()); | 166 EXPECT_TRUE(m_graphicsLayer->contentsLayer()); |
167 | 167 |
168 m_graphicsLayer->setContentsToSolidColor(Color()); | 168 m_graphicsLayer->setContentsToSolidColor(Color()); |
169 EXPECT_FALSE(m_graphicsLayer->contentsLayer()); | 169 EXPECT_FALSE(m_graphicsLayer->contentsLayer()); |
170 } | 170 } |
171 | 171 |
172 } // namespace | 172 } // namespace |
OLD | NEW |