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

Unified Diff: third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/basic-plumbing-worker-to-main.html

Issue 2041193005: [compositorworker] compositor proxy mutation updates underlying layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@compositor-worker-upstream-registration
Patch Set: Use RAII pattern Created 4 years, 6 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
Index: third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/basic-plumbing-worker-to-main.html
diff --git a/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/basic-plumbing-worker-to-main.html b/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/basic-plumbing-worker-to-main.html
new file mode 100644
index 0000000000000000000000000000000000000000..b29601f1f5093ebc849e3eb6590c22ee9e2257bc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/basic-plumbing-worker-to-main.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<style>
+#box {
+ width: 100px;
+ height: 100px;
+ overflow: scroll;
+}
+
+#scrolled {
+ background: white;
+ width: 300px;
+ height: 300px;
+}
+</style>
+
+<div id="box">
+ <div id="scrolled"></div>
+</div>
+
+<script src="../../../../resources/testharness.js"></script>
+<script src="../../../../resources/testharnessreport.js"></script>
+<script>
+if (window.internals)
+ internals.settings.setCompositorWorkerEnabled(true);
+
+var test = async_test('Tests that a change from the worker thread is received on the main thread.');
+test.step(function() {
+ var worker = new CompositorWorker('resources/basic-plumbing-worker-to-main.js');
+ worker.onmessage = test.step_func(function() {
+ // Wait until the next frame to ensure we have received the update from compositor worker.
+ requestAnimationFrame(test.step_func(function() {
+ var box = document.getElementById('box');
+ assert_equals(getComputedStyle(box).opacity, '0.5');
+ assert_equals(box.scrollLeft, 10);
+ assert_equals(box.scrollTop, 20);
+ assert_equals(getComputedStyle(box).transform, 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 30, 0, 0, 2)');
+
+ test.done();
+ }));
+ });
+
+ var keys = ['opacity', 'transform', 'scrollTop', 'scrollLeft'];
+ worker.postMessage({'proxy': new CompositorProxy(document.getElementById('box'), keys)});
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698