Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: add new base artifact, HostFormFactor #9923

Merged
merged 10 commits into from
Nov 9, 2019
Merged

Conversation

connorjclark
Copy link
Collaborator

Extracted from #9911.

Needed for #9713

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests? :)

LGTM otherwise

lighthouse-core/gather/gather-runner.js Show resolved Hide resolved
@@ -456,14 +456,15 @@ class GatherRunner {

const {emulatedFormFactor} = options.settings;
// Whether Lighthouse was run on a mobile device (i.e. not on a desktop machine).
const IsMobileHost = hostUserAgent.includes('Android') || hostUserAgent.includes('Mobile');
const HostFormFactor = /android|mobile/i.test(hostUserAgent) ? 'mobile' : 'desktop';
Copy link
Collaborator Author

@connorjclark connorjclark Nov 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

paul called me names (not out loud, but in his head) for wanting to use a regex here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -29,6 +29,8 @@ declare global {
LighthouseRunWarnings: string[];
/** Whether the page was loaded on either a real or emulated mobile device. */
TestedAsMobileDevice: boolean;
/** Device which Chrome is running on. */
HostFormFactor: 'desktop'|'mobile';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestedAsMobileDevice
HostUserAgent
NetworkUserAgent
HostFormFactor
emulatedFormFactor
deviceScreenEmulationMethod

https://www.theonion.com/taco-bells-five-ingredients-combined-in-totally-new-way-1819564909

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are starting to feel more like util functions than artifacts, but the suggestion was popular so LGTM :)

@paulirish paulirish merged commit 16cbb9e into master Nov 9, 2019
@paulirish paulirish deleted the hostformfactor branch November 9, 2019 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants