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> |