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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 OwnPtr<WebLayerTreeView> m_layerTreeView; | 94 OwnPtr<WebLayerTreeView> m_layerTreeView; |
95 MockGraphicsLayerClient m_client; | 95 MockGraphicsLayerClient m_client; |
96 }; | 96 }; |
97 | 97 |
98 TEST_F(GraphicsLayerTest, updateLayerShouldFlattenTransformWithAnimations) | 98 TEST_F(GraphicsLayerTest, updateLayerShouldFlattenTransformWithAnimations) |
99 { | 99 { |
100 ASSERT_FALSE(m_platformLayer->hasActiveAnimation()); | 100 ASSERT_FALSE(m_platformLayer->hasActiveAnimation()); |
101 | 101 |
102 OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(Platform::current()->composi
torSupport()->createFloatAnimationCurve()); | 102 OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(Platform::current()->composi
torSupport()->createFloatAnimationCurve()); |
103 curve->add(WebFloatKeyframe(0.0, 0.0)); | 103 curve->add(WebFloatKeyframe(0.0, 0.0)); |
104 OwnPtr<WebCompositorAnimation> floatAnimation(adoptPtr(Platform::current()->
compositorSupport()->createAnimation(*curve, WebCompositorAnimation::TargetPrope
rtyOpacity))); | 104 OwnPtr<WebAnimation> floatAnimation(adoptPtr(Platform::current()->compositor
Support()->createAnimation(*curve, WebAnimation::TargetPropertyOpacity))); |
105 int animationId = floatAnimation->id(); | 105 int animationId = floatAnimation->id(); |
106 ASSERT_TRUE(m_platformLayer->addAnimation(floatAnimation.leakPtr())); | 106 ASSERT_TRUE(m_platformLayer->addAnimation(floatAnimation.leakPtr())); |
107 | 107 |
108 ASSERT_TRUE(m_platformLayer->hasActiveAnimation()); | 108 ASSERT_TRUE(m_platformLayer->hasActiveAnimation()); |
109 | 109 |
110 m_graphicsLayer->setShouldFlattenTransform(false); | 110 m_graphicsLayer->setShouldFlattenTransform(false); |
111 | 111 |
112 m_platformLayer = m_graphicsLayer->platformLayer(); | 112 m_platformLayer = m_graphicsLayer->platformLayer(); |
113 ASSERT_TRUE(m_platformLayer); | 113 ASSERT_TRUE(m_platformLayer); |
114 | 114 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 m_graphicsLayer->setScrollableArea(&scrollableArea, false); | 159 m_graphicsLayer->setScrollableArea(&scrollableArea, false); |
160 | 160 |
161 WebPoint scrollPosition(7, 9); | 161 WebPoint scrollPosition(7, 9); |
162 m_platformLayer->setScrollPosition(scrollPosition); | 162 m_platformLayer->setScrollPosition(scrollPosition); |
163 m_graphicsLayer->didScroll(); | 163 m_graphicsLayer->didScroll(); |
164 | 164 |
165 EXPECT_EQ(scrollPosition, WebPoint(scrollableArea.scrollPosition())); | 165 EXPECT_EQ(scrollPosition, WebPoint(scrollableArea.scrollPosition())); |
166 } | 166 } |
167 | 167 |
168 } // namespace | 168 } // namespace |
OLD | NEW |