| Index: third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/basic-plumbing-main-to-worker.html
|
| diff --git a/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/basic-plumbing-main-to-worker.html b/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/basic-plumbing-main-to-worker.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8cc2a1cb439aa84875091ded15461e4cbc711c13
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/basic-plumbing-main-to-worker.html
|
| @@ -0,0 +1,66 @@
|
| +<!DOCTYPE html>
|
| +<!--
|
| +Tests that a change from the main thread is received on the compositor 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-main-to-worker.js');
|
| + cw.onmessage = continueTest;
|
| + var keys = ['opacity', 'transform', 'scrollTop', 'scrollLeft'];
|
| + cw.postMessage({'proxy': new CompositorProxy(document.getElementById('box'), keys)});
|
| +}
|
| +
|
| +function continueTest(e) {
|
| + shouldBe(JSON.stringify(e.data.opacity), '1.0');
|
| + shouldBe(JSON.stringify(e.data.scrollLeft), '0');
|
| + shouldBe(JSON.stringify(e.data.scrollTop), '0');
|
| + shouldBe("'" + JSON.stringify(e.data.transform) + "'", '\'{"0":1,"1":0,"2":0,"3":0,"4":0,"5":1,"6":0,"7":0,"8":0,"9":0,"10":1,"11":0,"12":0,"13":0,"14":0,"15":1}\'');
|
| + var element = document.getElementById('box');
|
| + element.scrollLeft = 10;
|
| + element.scrollTop = 20;
|
| + element.style.transform = 'translate3d(30px, 0, 0)';
|
| + element.style.opacity = 0.5;
|
| + cw.onmessage = finishTest;
|
| + // Delay posting to the compositor until we have had another frame (i.e. commit).
|
| + requestAnimationFrame(function() {
|
| + cw.postMessage({});
|
| + });
|
| +}
|
| +
|
| +function finishTest(e) {
|
| + shouldBe(JSON.stringify(e.data.opacity), '0.5');
|
| + shouldBe(JSON.stringify(e.data.scrollLeft), '10');
|
| + shouldBe(JSON.stringify(e.data.scrollTop), '20');
|
| + shouldBe("'" + JSON.stringify(e.data.transform) + "'", '\'{"0":1,"1":0,"2":0,"3":0,"4":0,"5":1,"6":0,"7":0,"8":0,"9":0,"10":1,"11":0,"12":30,"13":0,"14":0,"15":1}\'');
|
| + 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>
|
|
|