From c2246db2baba90c420116590d669c3ebec548d5e Mon Sep 17 00:00:00 2001 From: Adam Raine Date: Tue, 18 Oct 2022 15:33:26 -0700 Subject: [PATCH] [lighthouse] Remove deprecated internal flags Lighthouse issue: https://github.com/GoogleChrome/lighthouse/issues/13980 Bug: None Change-Id: I290d56d1cbf9d61f0ef6b10ce5a5009eddec8460 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3965275 Reviewed-by: Connor Clark Commit-Queue: Connor Clark --- .../lighthouse_worker/LighthouseWorkerService.ts | 2 +- front_end/panels/lighthouse/LighthouseController.ts | 13 ++++--------- front_end/panels/lighthouse/LighthousePanel.ts | 6 ++---- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/front_end/entrypoints/lighthouse_worker/LighthouseWorkerService.ts b/front_end/entrypoints/lighthouse_worker/LighthouseWorkerService.ts index 336eced87f..c5f337a7d1 100644 --- a/front_end/entrypoints/lighthouse_worker/LighthouseWorkerService.ts +++ b/front_end/entrypoints/lighthouse_worker/LighthouseWorkerService.ts @@ -125,7 +125,7 @@ async function invokeLH(action: string, args: any): Promise { } // @ts-expect-error https://github.com/GoogleChrome/lighthouse/issues/11628 - const config = args.config || self.createConfig(args.categoryIDs, flags.emulatedFormFactor); + const config = args.config || self.createConfig(args.categoryIDs, flags.formFactor); const url = args.url; // Handle legacy Lighthouse runner path. diff --git a/front_end/panels/lighthouse/LighthouseController.ts b/front_end/panels/lighthouse/LighthouseController.ts index 88e3fcd96e..de9c37b801 100644 --- a/front_end/panels/lighthouse/LighthouseController.ts +++ b/front_end/panels/lighthouse/LighthouseController.ts @@ -346,21 +346,16 @@ export class LighthouseController extends Common.ObjectWrapper.ObjectWrapper { // See Audits.AuditsPanel._setupEmulationAndProtocolConnection() - flags.emulatedFormFactor = value; + flags.formFactor = value; }, options: [ {label: i18nLazyString(UIStrings.mobile), value: 'mobile'}, diff --git a/front_end/panels/lighthouse/LighthousePanel.ts b/front_end/panels/lighthouse/LighthousePanel.ts index c1ff44552f..0ed1716c05 100644 --- a/front_end/panels/lighthouse/LighthousePanel.ts +++ b/front_end/panels/lighthouse/LighthousePanel.ts @@ -454,8 +454,6 @@ export class LighthousePanel extends UI.Panel.Panel { * We set the device emulation on the DevTools-side for two reasons: * 1. To workaround some odd device metrics emulation bugs like occuluding viewports * 2. To get the attractive device outline - * - * We also set flags.internalDisableDeviceScreenEmulation = true to let LH only apply UA emulation */ private async setupEmulationAndProtocolConnection(): Promise { const flags = this.controller.getFlags(); @@ -475,10 +473,10 @@ export class LighthousePanel extends UI.Panel.Panel { }; emulationModel.toolbarControlsEnabledSetting().set(false); - if ('emulatedFormFactor' in flags && flags.emulatedFormFactor === 'desktop') { + if ('formFactor' in flags && flags.formFactor === 'desktop') { emulationModel.enabledSetting().set(false); emulationModel.emulate(EmulationModel.DeviceModeModel.Type.None, null, null); - } else if (flags.emulatedFormFactor === 'mobile') { + } else if (flags.formFactor === 'mobile') { emulationModel.enabledSetting().set(true); emulationModel.deviceOutlineSetting().set(true);