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..a2ccc97621b4f758fba8a2b05094a1b1cefeb942 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/basic-plumbing-worker-to-main.html |
@@ -0,0 +1,56 @@ |
+<!DOCTYPE html> |
+<!-- |
+Tests that a change from the worker thread is received on the main thread. |
+--> |
+<script> |
+window.jsTestIsAsync = true; |
+</script> |
+<script src="../../../../resources/js-test.js"></script> |
+ |
+<script> |
+if (window.internals) { |
+ internals.settings.setCompositorWorkerEnabled(true); |
+} |
+ |
+var cw; |
+onload = function() { |
+ cw = new CompositorWorker('resources/basic-plumbing-worker-to-main.js'); |
+ cw.onmessage = continueTest; |
+ var keys = ['opacity', 'transform', 'scrollTop', 'scrollLeft']; |
+ cw.postMessage({'proxy': new CompositorProxy(document.getElementById('box'), keys)}); |
+} |
+ |
+function continueTest(e) { |
+ requestAnimationFrame(finishTest); |
+} |
+ |
+function finishTest(timestamp) { |
+ var box = document.getElementById('box'); |
+ requestAnimationFrame(function(timestamp) { |
+ shouldBe(box.style.opacity, '0.5'); |
+ shouldBe(JSON.stringify(box.scrollLeft), '10'); |
+ shouldBe(JSON.stringify(box.scrollTop), '20'); |
+ shouldBe("'" + box.style.transform + "'", '\'matrix3d(1px, 0px, 0px, 0px, 0px, 1px, 0px, 0px, 0px, 0px, 1px, 0px, 30px, 0px, 0px, 1px)\''); |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
+ }); |
+} |
+</script> |
+ |
+<style> |
+#box { |
+ width: 100px; |
+ height: 100px; |
+ overflow: scroll; |
+} |
+ |
+#scrolled { |
+ background: white; |
+ width: 300px; |
+ height: 300px; |
+} |
+</style> |
+ |
+<div id="box"> |
+ <div id="scrolled"></div> |
+</div> |