Commit 52c95c0c authored by Paul Irish's avatar Paul Irish Committed by Commit Bot

DevTools: [Audits] Fix race during emulation state reset

Updated emulation state is applied in stopAndReattach, 
but that was racing against the state being reset within
hideDialog. 

Bug: 747245
Change-Id: I1c1698525691f37d4c988349cd7bc84a23a3e7f6
Reviewed-on: https://chromium-review.googlesource.com/592464Reviewed-by: default avatarPavel Feldman <pfeldman@chromium.org>
Commit-Queue: Paul Irish <paulirish@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490624}
parent 28e0f19a
......@@ -310,11 +310,6 @@ Audits2.Audits2Panel = class extends UI.Panel {
return;
this._dialog.hide();
var emulationModel = self.singleton(Emulation.DeviceModeModel);
emulationModel.enabledSetting().set(this._emulationEnabledBefore);
emulationModel.deviceOutlineSetting().set(this._emulationOutlineEnabledBefore);
emulationModel.toolbarControlsEnabledSetting().set(true);
delete this._dialog;
delete this._statusView;
delete this._statusIcon;
......@@ -368,7 +363,13 @@ Audits2.Audits2Panel = class extends UI.Panel {
*/
async _stopAndReattach() {
await this._protocolService.detach();
var emulationModel = self.singleton(Emulation.DeviceModeModel);
emulationModel.enabledSetting().set(this._emulationEnabledBefore);
emulationModel.deviceOutlineSetting().set(this._emulationOutlineEnabledBefore);
emulationModel.toolbarControlsEnabledSetting().set(true);
Emulation.InspectedPagePlaceholder.instance().update(true);
Host.userMetrics.actionTaken(Host.UserMetrics.Action.Audits2Finished);
var resourceTreeModel = SDK.targetManager.mainTarget().model(SDK.ResourceTreeModel);
// reload to reset the page state
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment