| 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..c5c1fdeb386c51e0d2d6663ce2c98d29b790467a
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/basic-plumbing-worker-to-main.html
|
| @@ -0,0 +1,55 @@
|
| +<!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) {
|
| + // Wait until the next frame to ensure we have received the update from compositor worker.
|
| + requestAnimationFrame(finishTest);
|
| +}
|
| +
|
| +function finishTest(timestamp) {
|
| + var box = document.getElementById('box');
|
| + 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>
|
|
|