Preserve emulation state across Lighthouse runs
Preserve emulation state across Lighthouse runs

A bug in CDP prevents sessions from manipulating the device emulation
if another session detaches.

Calling "Emulation.clearDeviceMetricOverride" will correct the
behavior, so calling it before resetting the previous emulation
settings is an adequate workaround.

This CL also preserves the emulation type, display scale, and device
mode across Lighthouse runs.

Lighthouse issue:
https://github.com/GoogleChrome/lighthouse/issues/14134

Bug: 1337089
Change-Id: I9c54fb82276998d63887f7c2dc7085b9d280d32f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3710871
Reviewed-by: Paul Irish <5f672bbedd2fccb2b3e838838e74ef989148de66@chromium.org>
Reviewed-by: Connor Clark <2d5c837a0b2cf015b24acdf5e50262e50d986795@chromium.org>
Commit-Queue: Adam Raine <7e7869e510a2e8e4e90b5749fd5d70443c19f753@chromium.org>

ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend