Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/request-animation-frame.html |
| diff --git a/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/request-animation-frame.html b/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/request-animation-frame.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..74c17c8b0e8b4b61b5c6c3faf9bcbdcf15251f6f |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/request-animation-frame.html |
| @@ -0,0 +1,22 @@ |
| +<!DOCTYPE html> |
| +<script src="../../../../resources/js-test.js"></script> |
| +<script> |
| +var jsTestIsAsync = true; |
| +description('Tests that requestAnimationFrame is invoked with correct timestamp on CompositorWorker.'); |
| +if (window.internals) |
| + internals.settings.setCompositorWorkerEnabled(true); |
| + |
| +var cw = new CompositorWorker('resources/request-animation-frame.js'); |
| +var startTime = performance.now(); |
| +var rafTime; |
| +var endTime; |
| +cw.postMessage(''); |
|
jbroman
2016/04/29 19:42:22
you can remove this postMessage, now that the work
flackr
2016/05/03 22:24:54
Oops, forgot to remove it, thanks. Removed.
|
| +cw.onmessage = function(e) { |
| + rafTime = e.data; |
| + endTime = performance.now(); |
| + shouldBe('startTime <= rafTime', 'true'); |
|
jbroman
2016/04/29 19:42:22
nit:
shouldBeGreaterThanOrEqual('rafTime', 'startT
flackr
2016/05/03 22:24:54
Done.
|
| + shouldBe('rafTime <= endTime', 'true'); |
| + testPassed('Received reply from CompositorWorker.'); |
| + finishJSTest(); |
| +} |
| +</script> |