Skip to content

Commit

Permalink
stop checking for LH version <7 and use new params by default. Fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
tkadlec committed Sep 27, 2021
1 parent 92f4856 commit b45f054
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions internal/devtools_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,15 +798,13 @@ def run_lighthouse_test(self, task):
command.append('--save-assets')
if not self.job['keep_lighthouse_screenshots']:
command.extend(['--skip-audits', 'screenshot-thumbnails,final-screenshot'])
form_factor_command = '--form-factor' if lighthouse_version >= 7 else '--emulated-form-factor'
form_factor_command = '--form-factor'
if self.options.android:
command.extend([form_factor_command, 'mobile'])
if lighthouse_version >= 7:
command.extend(['--screenEmulation.disabled'])
command.extend(['--screenEmulation.disabled'])
elif 'mobile' not in self.job or not self.job['mobile']:
command.extend([form_factor_command, 'desktop'])
if lighthouse_version >= 7:
command.extend(['--screenEmulation.disabled'])
command.extend(['--screenEmulation.disabled'])
if 'user_agent_string' in self.job:
sanitized_user_agent = re.sub(r'[^a-zA-Z0-9_\-.;:/()\[\] ]+', '', self.job['user_agent_string'])
command.append('--chrome-flags="--user-agent=\'{0}\'"'.format(sanitized_user_agent))
Expand Down

0 comments on commit b45f054

Please sign in to comment.