Fixing timestamp in workers for the callback in request animation frame

The time that the worker is presention in the requestAnimationFrame
callback, has to take into account if the worker is in the WorkerGlobalScope
as in https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/performance.

Replace how the time was capture for the callback to take into account the time
since the worker started by calling performance.now with the right performance
obtained from WorkerGlobalScope.

Fixing the test so it passes the test.

Bug: 935096
Change-Id: If6e15c084ac73f718a5454f9470b91a883d4e2d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1591420
Commit-Queue: Juanmi Huertas <juanmihd@chromium.org>
Reviewed-by: Fernando Serboncini <fserb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#655678}
2 files changed