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(emulation): use Moto G4 for mobile emulation #10191

Merged
merged 6 commits into from
Jan 22, 2020
Merged

core(emulation): use Moto G4 for mobile emulation #10191

merged 6 commits into from
Jan 22, 2020

Conversation

connorjclark
Copy link
Collaborator

part of #9876

positionX: 0,
positionY: 0,
scale: 1,
deviceScaleFactor: 2.625,
deviceScaleFactor: 2.625, // ??
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

what the heck is this @paulirish

Copy link
Collaborator

@patrickhulce patrickhulce Jan 8, 2020

Choose a reason for hiding this comment

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

that should be the device DPR

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

math checks out too 640 * 3 = 1920, 360 * 3 = 1080

screenHeight: 660,
width: 412,
height: 660,
screenWidth: 360,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need to look at an actual device and see what a browser reports this as.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@@ -161,6 +160,6 @@ module.exports = {
enableCPUThrottling,
disableCPUThrottling,
goOffline,
MOBILE_USERAGENT: NEXUS5X_USERAGENT,
MOBILE_USERAGENT: MOTOG4_USERAGENT,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nice thinking here on the export

assert.ok(/RTT/.test(descriptionsTxt), 'should have added network');
assert.ok(/\dx/.test(descriptionsTxt), 'should have added CPU');
assert.ok(descriptionsTxt.includes(sampleResults.userAgent), 'user agent populated');
expect(descriptionsTxt).toContain('Moto G4');
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

asserts are bad.

@@ -169,12 +169,12 @@ const expectations = [
},
},
'uses-responsive-images': {
displayValue: 'Potential savings of 69\xa0KB',
displayValue: 'Potential savings of 53\xa0KB',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

these values are calculated based on DPR. They are proportional to DPR^2.

3^2 / 2.625^2 = ~1.3, so I divided each expectation by 1.3

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.

LGTM

@patrickhulce patrickhulce merged commit 46ce3a4 into master Jan 22, 2020
@patrickhulce patrickhulce deleted the motog4 branch January 22, 2020 18:37
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.

3 participants