OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <style> |
| 3 #box { |
| 4 width: 100px; |
| 5 height: 100px; |
| 6 overflow: scroll; |
| 7 } |
| 8 |
| 9 #scrolled { |
| 10 background: white; |
| 11 width: 300px; |
| 12 height: 300px; |
| 13 } |
| 14 </style> |
| 15 |
| 16 <div id="box"> |
| 17 <div id="scrolled"></div> |
| 18 </div> |
| 19 |
| 20 <script src="../../../../resources/testharness.js"></script> |
| 21 <script src="../../../../resources/testharnessreport.js"></script> |
| 22 <script> |
| 23 if (window.internals) |
| 24 internals.settings.setCompositorWorkerEnabled(true); |
| 25 |
| 26 var test = async_test('Tests that a change from the worker thread is received on
the main thread.'); |
| 27 test.step(function() { |
| 28 var worker = new CompositorWorker('resources/basic-plumbing-worker-to-main.js'
); |
| 29 worker.onmessage = test.step_func(function() { |
| 30 // Wait until the next frame to ensure we have received the update from comp
ositor worker. |
| 31 requestAnimationFrame(test.step_func(function() { |
| 32 var box = document.getElementById('box'); |
| 33 assert_equals(getComputedStyle(box).opacity, '0.5'); |
| 34 assert_equals(box.scrollLeft, 10); |
| 35 assert_equals(box.scrollTop, 20); |
| 36 assert_equals(getComputedStyle(box).transform, 'matrix3d(1, 0, 0, 0, 0, 1,
0, 0, 0, 0, 1, 0, 30, 0, 0, 2)'); |
| 37 |
| 38 test.done(); |
| 39 })); |
| 40 }); |
| 41 |
| 42 var keys = ['opacity', 'transform', 'scrollTop', 'scrollLeft']; |
| 43 worker.postMessage({'proxy': new CompositorProxy(document.getElementById('box'
), keys)}); |
| 44 }); |
| 45 </script> |
OLD | NEW |