For now we exposed `Emulation.setDeviceMetricsOverride` but with an empty implementation: https://searchfox.org/mozilla-central/rev/0376cbf447efa16922c550da3bfd783b916e35d3/remote/domains/content/Emulation.jsm#14 Wordpress test suites uses it to change the viewport size over here: https://github.com/WordPress/gutenberg/blob/b786aad41b4670190b6cac4d99bab3abd3f85049/packages/e2e-test-utils/src/set-browser-viewport.js#L17-L18 and relies on setDeviceMetricsOverride to update the page width and height. It only requires to implement setDeviceMetricsOverride's `width` and `height` arguments.
Bug 1544417 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setDeviceMetricsOverride Emulation.setDeviceMetricsOverride: Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media query results). For now we exposed `Emulation.setDeviceMetricsOverride` but with an empty implementation: https://searchfox.org/mozilla-central/rev/0376cbf447efa16922c550da3bfd783b916e35d3/remote/domains/content/Emulation.jsm#14 Wordpress test suites uses it to change the viewport size over here: https://github.com/WordPress/gutenberg/blob/b786aad41b4670190b6cac4d99bab3abd3f85049/packages/e2e-test-utils/src/set-browser-viewport.js#L17-L18 and relies on setDeviceMetricsOverride to update the page width and height. It only requires to implement setDeviceMetricsOverride's `width` and `height` arguments.