Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(811)

Unified Diff: third_party/WebKit/Source/web/tests/CompositorWorkerTest.cpp

Issue 1602343002: compositor-worker: cc->blink mutation plumbing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@compositor-worker-ian-patch
Patch Set: Fix DEPS issue and some missing methods Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | third_party/WebKit/public/platform/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | third_party/WebKit/public/platform/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698