diff --git a/lighthouse-cli/test/smokehouse/test-definitions/byte-efficiency/expectations.js b/lighthouse-cli/test/smokehouse/test-definitions/byte-efficiency/expectations.js index d9bd8b3c914b..c9558654fd49 100644 --- a/lighthouse-cli/test/smokehouse/test-definitions/byte-efficiency/expectations.js +++ b/lighthouse-cli/test/smokehouse/test-definitions/byte-efficiency/expectations.js @@ -169,12 +169,12 @@ const expectations = [ }, }, 'uses-responsive-images': { - displayValue: 'Potential savings of 69\xa0KB', + displayValue: 'Potential savings of 53\xa0KB', details: { - overallSavingsBytes: '>65000', + overallSavingsBytes: '>50000', items: { - 0: {wastedPercent: '<60'}, - 1: {wastedPercent: '<60'}, + 0: {wastedPercent: '<46'}, + 1: {wastedPercent: '<46'}, length: 2, }, }, diff --git a/lighthouse-core/lib/emulation.js b/lighthouse-core/lib/emulation.js index f0daa724e224..37569eb22f1e 100644 --- a/lighthouse-core/lib/emulation.js +++ b/lighthouse-core/lib/emulation.js @@ -8,19 +8,18 @@ /** @typedef {import('../gather/driver.js')} Driver */ /** - * Nexus 5X metrics adapted from emulated_devices/module.json * @type {LH.Crdp.Emulation.SetDeviceMetricsOverrideRequest} */ -const NEXUS5X_EMULATION_METRICS = { +const MOTOG4_EMULATION_METRICS = { mobile: true, - screenWidth: 412, - screenHeight: 660, - width: 412, - height: 660, + screenWidth: 360, + screenHeight: 640, + width: 360, + height: 640, positionX: 0, positionY: 0, scale: 1, - deviceScaleFactor: 2.625, + deviceScaleFactor: 3, screenOrientation: { angle: 0, type: 'portraitPrimary', @@ -39,7 +38,7 @@ const DESKTOP_EMULATION_METRICS = { }; // eslint-disable-next-line max-len -const NEXUS5X_USERAGENT = 'Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3963.0 Mobile Safari/537.36 Chrome-Lighthouse'; +const MOTOG4_USERAGENT = 'Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3963.0 Mobile Safari/537.36 Chrome-Lighthouse'; // eslint-disable-next-line max-len const DESKTOP_USERAGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3963.0 Safari/537.36 Chrome-Lighthouse'; @@ -64,8 +63,8 @@ const NO_CPU_THROTTLE_METRICS = { const emulationParams = { mobile: { - userAgent: NEXUS5X_USERAGENT, - metrics: NEXUS5X_EMULATION_METRICS, + userAgent: MOTOG4_USERAGENT, + metrics: MOTOG4_EMULATION_METRICS, touchEnabled: true, }, desktop: { @@ -161,6 +160,6 @@ module.exports = { enableCPUThrottling, disableCPUThrottling, goOffline, - MOBILE_USERAGENT: NEXUS5X_USERAGENT, + MOBILE_USERAGENT: MOTOG4_USERAGENT, DESKTOP_USERAGENT, }; diff --git a/lighthouse-core/lib/i18n/locales/en-US.json b/lighthouse-core/lib/i18n/locales/en-US.json index 02d004d0208d..372022147836 100644 --- a/lighthouse-core/lib/i18n/locales/en-US.json +++ b/lighthouse-core/lib/i18n/locales/en-US.json @@ -1590,7 +1590,7 @@ "message": "Emulated Desktop" }, "lighthouse-core/report/html/renderer/util.js | runtimeMobileEmulation": { - "message": "Emulated Nexus 5X" + "message": "Emulated Moto G4" }, "lighthouse-core/report/html/renderer/util.js | runtimeNoEmulation": { "message": "No emulation" diff --git a/lighthouse-core/lib/i18n/locales/en-XL.json b/lighthouse-core/lib/i18n/locales/en-XL.json index 2c72b9db353a..a7dac92be83c 100644 --- a/lighthouse-core/lib/i18n/locales/en-XL.json +++ b/lighthouse-core/lib/i18n/locales/en-XL.json @@ -1590,7 +1590,7 @@ "message": "Êḿûĺât́êd́ D̂éŝḱt̂óp̂" }, "lighthouse-core/report/html/renderer/util.js | runtimeMobileEmulation": { - "message": "Êḿûĺât́êd́ N̂éx̂úŝ 5X́" + "message": "Êḿûĺât́êd́ M̂ót̂ó Ĝ4" }, "lighthouse-core/report/html/renderer/util.js | runtimeNoEmulation": { "message": "N̂ó êḿûĺât́îón̂" diff --git a/lighthouse-core/report/html/renderer/util.js b/lighthouse-core/report/html/renderer/util.js index fc4fb3804877..dfe005412ef8 100644 --- a/lighthouse-core/report/html/renderer/util.js +++ b/lighthouse-core/report/html/renderer/util.js @@ -579,8 +579,8 @@ Util.UIStrings = { /** Descriptive explanation for emulation setting when no device emulation is set. */ runtimeNoEmulation: 'No emulation', - /** Descriptive explanation for emulation setting when emulating a Nexus 5X mobile device. */ - runtimeMobileEmulation: 'Emulated Nexus 5X', + /** Descriptive explanation for emulation setting when emulating a Moto G4 mobile device. */ + runtimeMobileEmulation: 'Emulated Moto G4', /** Descriptive explanation for emulation setting when emulating a generic desktop form factor, as opposed to a mobile-device like form factor. */ runtimeDesktopEmulation: 'Emulated Desktop', /** Descriptive explanation for a runtime setting that is set to an unknown value. */ diff --git a/lighthouse-core/test/report/html/renderer/report-renderer-test.js b/lighthouse-core/test/report/html/renderer/report-renderer-test.js index fb0646c45ed4..6449a79d207e 100644 --- a/lighthouse-core/test/report/html/renderer/report-renderer-test.js +++ b/lighthouse-core/test/report/html/renderer/report-renderer-test.js @@ -197,10 +197,10 @@ describe('ReportRenderer', () => { assert.ok(descriptions.length >= 3); const descriptionsTxt = descriptions.map(el => el.textContent).join('\n'); - assert.ok(/Nexus/.test(descriptionsTxt), 'should have added device emulation'); - 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'); + expect(descriptionsTxt).toContain('RTT'); + expect(descriptionsTxt).toMatch(/\dx/); + expect(descriptionsTxt).toContain(sampleResults.userAgent); }); }); diff --git a/lighthouse-core/test/report/html/renderer/util-test.js b/lighthouse-core/test/report/html/renderer/util-test.js index e0a3931de5a9..2f49a218cb55 100644 --- a/lighthouse-core/test/report/html/renderer/util-test.js +++ b/lighthouse-core/test/report/html/renderer/util-test.js @@ -36,7 +36,7 @@ describe('util helpers', () => { it('builds device emulation string', () => { const get = opts => Util.getEmulationDescriptions(opts).deviceEmulation; assert.equal(get({emulatedFormFactor: 'none'}), 'No emulation'); - assert.equal(get({emulatedFormFactor: 'mobile'}), 'Emulated Nexus 5X'); + assert.equal(get({emulatedFormFactor: 'mobile'}), 'Emulated Moto G4'); assert.equal(get({emulatedFormFactor: 'desktop'}), 'Emulated Desktop'); }); diff --git a/lighthouse-core/test/results/sample_v2.json b/lighthouse-core/test/results/sample_v2.json index 63dfd7dd807e..80f1a79751c8 100644 --- a/lighthouse-core/test/results/sample_v2.json +++ b/lighthouse-core/test/results/sample_v2.json @@ -5352,7 +5352,7 @@ "opportunitySavingsColumnLabel": "Estimated Savings", "passedAuditsGroupTitle": "Passed audits", "runtimeDesktopEmulation": "Emulated Desktop", - "runtimeMobileEmulation": "Emulated Nexus 5X", + "runtimeMobileEmulation": "Emulated Moto G4", "runtimeNoEmulation": "No emulation", "runtimeSettingsBenchmark": "CPU/Memory Power", "runtimeSettingsCPUThrottling": "CPU throttling", diff --git a/proto/sample_v2_round_trip.json b/proto/sample_v2_round_trip.json index f652a58a7b9b..b05ea053e6cf 100644 --- a/proto/sample_v2_round_trip.json +++ b/proto/sample_v2_round_trip.json @@ -4154,7 +4154,7 @@ "opportunitySavingsColumnLabel": "Estimated Savings", "passedAuditsGroupTitle": "Passed audits", "runtimeDesktopEmulation": "Emulated Desktop", - "runtimeMobileEmulation": "Emulated Nexus 5X", + "runtimeMobileEmulation": "Emulated Moto G4", "runtimeNoEmulation": "No emulation", "runtimeSettingsBenchmark": "CPU/Memory Power", "runtimeSettingsCPUThrottling": "CPU throttling",