Chromium Code Reviews| Index: third_party/WebKit/Source/web/tests/CompositorWorkerTest.cpp |
| diff --git a/third_party/WebKit/Source/web/tests/CompositorWorkerTest.cpp b/third_party/WebKit/Source/web/tests/CompositorWorkerTest.cpp |
| index 9966e70fc8096e1f3a528db50a84040a44e79121..644dfe2b5bde1693ced218f8c2a801f23dd032c4 100644 |
| --- a/third_party/WebKit/Source/web/tests/CompositorWorkerTest.cpp |
| +++ b/third_party/WebKit/Source/web/tests/CompositorWorkerTest.cpp |
| @@ -8,6 +8,7 @@ |
| #include "core/layout/compositing/PaintLayerCompositor.h" |
| #include "core/page/Page.h" |
| #include "platform/graphics/CompositorMutableProperties.h" |
| +#include "platform/graphics/CompositorMutation.h" |
| #include "platform/graphics/GraphicsLayer.h" |
| #include "platform/testing/URLTestHelpers.h" |
| #include "public/platform/Platform.h" |
| @@ -210,4 +211,47 @@ TEST_F(CompositorWorkerTest, disconnectedProxies) |
| EXPECT_EQ(0UL, rootScrollLayer->elementId()); |
| } |
| +TEST_F(CompositorWorkerTest, applyingMutations) |
| +{ |
| + registerMockedHttpURLLoad("compositor-proxy-basic.html"); |
| + navigateTo(m_baseURL + "compositor-proxy-basic.html"); |
| + |
| + forceFullCompositingUpdate(); |
| + |
| + Document* document = frame()->document(); |
| + |
| + Element* proxiedElement = document->getElementById("proxied"); |
| + WebLayer* proxiedLayer = webLayerFromElement(proxiedElement); |
| + EXPECT_TRUE(proxiedLayer->compositorMutableProperties() & CompositorMutablePropertyTransform); |
| + EXPECT_FALSE(proxiedLayer->compositorMutableProperties() & (CompositorMutablePropertyScrollLeft | CompositorMutablePropertyScrollTop | CompositorMutablePropertyOpacity)); |
| + uint64_t elementId = proxiedLayer->elementId(); |
| + EXPECT_NE(0UL, elementId); |
| + |
| + { |
| + TransformationMatrix transformMatrix(11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, 44); |
| + OwnPtrWillBeRawPtr<CompositorMutation> mutation = adoptPtr(new CompositorMutation); |
| + mutation->setTransform(TransformationMatrix::toSkMatrix44(transformMatrix)); |
| + |
| + CompositorMutations mutations; |
| + mutations.map.add(elementId, mutation.release()); |
| + |
| + webViewImpl()->applyMutations(mutations); |
| + |
| + const String& cssValue = proxiedElement->inlineStyle()->getPropertyValue(CSSPropertyTransform); |
| + EXPECT_EQ(String("matrix3d(11px, 12px, 13px, 14px, 21px, 22px, 23px, 24px, 31px, 32px, 33px, 34px, 41px, 42px, 43px, 44px)"), cssValue); |
| + } |
| + { |
| + OwnPtrWillBeRawPtr<CompositorMutation> mutation = adoptPtr(new CompositorMutation); |
| + mutation->setOpacity(0.5); |
| + |
| + CompositorMutations mutations; |
| + mutations.map.add(elementId, mutation.release()); |
| + |
| + webViewImpl()->applyMutations(mutations); |
| + |
| + const String& cssValue = proxiedElement->inlineStyle()->getPropertyValue(CSSPropertyOpacity); |
| + EXPECT_EQ(String("0.5"), cssValue); |
|
flackr
2016/01/20 16:50:50
It feels strange that you're testing mutating a pr
majidvp
2016/01/20 19:23:59
Good point, I agree that it is odd. It should be f
|
| + } |
| +} |
| + |
| } // namespace blink |