Need a way to force particular time for page rendering through DevTools |
|
Issue descriptionNov 3 To achieve predictable and reproducible results of rendering a page in headless chrome we need control over what time is being assumed by the JS engine. I suggest adding a method or two to the Emulation domain to override current time and timezone. This will be handled by EmulationHandler (https://cs.chromium.org/chromium/src/content/browser/devtools/protocol/emulation_handler.h). Time needs to be IPC-forwarded (https://cs.chromium.org/chromium/src/content/common/renderer.mojom) to the Renderer process so it can be used as an override in gin's implementation of v8::Platform (https://cs.chromium.org/chromium/src/gin/v8_platform.cc?l=271). Timezone for now must be enforced browser-wide with tzset() straight in the handler because TZ syscalls are proxied from renderer to browser (https://cs.chromium.org/chromium/src/content/zygote/zygote_main_linux.cc?l=150), but when v8 completes their switch to icu timezones (https://cs.chromium.org/chromium/src/v8/src/flag-definitions.h?type=cs&l=267) this can also be set per-renderer by using icu's API's (like this: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/time_zone_monitor/TimeZoneMonitorClient.cpp?q=timezonemonitorclient&dr=CSs&l=63). |
|
►
Sign in to add a comment |
|
Comment 1 by pfeldman@chromium.org
, Dec 14 2017