From 75c28f1a623243e17d7ae477aa34bfabb09543c3 Mon Sep 17 00:00:00 2001 From: Patrick Hulce Date: Tue, 17 Nov 2020 16:39:51 -0600 Subject: [PATCH] update all snapshots --- .../audits/__snapshots__/metrics-test.js.snap | 4 +- .../render-blocking-resources-test.js | 8 +- .../audits/dobetterweb/uses-http2-test.js | 8 +- .../test/audits/timing-budget-test.js | 8 +- .../estimated-input-latency-test.js.snap | 4 +- ...ntern-estimated-input-latency-test.js.snap | 4 +- .../computed/metrics/timing-summary-test.js | 4 +- .../metrics/total-blocking-time-test.js | 84 +++++++++++-------- lighthouse-core/test/results/sample_v2.json | 6 +- 9 files changed, 70 insertions(+), 60 deletions(-) diff --git a/lighthouse-core/test/audits/__snapshots__/metrics-test.js.snap b/lighthouse-core/test/audits/__snapshots__/metrics-test.js.snap index 67d3c4d9cc8b..2d896d79f314 100644 --- a/lighthouse-core/test/audits/__snapshots__/metrics-test.js.snap +++ b/lighthouse-core/test/audits/__snapshots__/metrics-test.js.snap @@ -97,7 +97,7 @@ Object { exports[`Performance: metrics evaluates valid input correctly 1`] = ` Object { "cumulativeLayoutShift": 0, - "estimatedInputLatency": 78, + "estimatedInputLatency": 81, "estimatedInputLatencyTs": undefined, "firstCPUIdle": 3351, "firstCPUIdleTs": undefined, @@ -137,6 +137,6 @@ Object { "observedTraceEndTs": 225426711887, "speedIndex": 1676, "speedIndexTs": undefined, - "totalBlockingTime": 726, + "totalBlockingTime": 777, } `; diff --git a/lighthouse-core/test/audits/byte-efficiency/render-blocking-resources-test.js b/lighthouse-core/test/audits/byte-efficiency/render-blocking-resources-test.js index b8ae82627100..62eddeff953a 100644 --- a/lighthouse-core/test/audits/byte-efficiency/render-blocking-resources-test.js +++ b/lighthouse-core/test/audits/byte-efficiency/render-blocking-resources-test.js @@ -80,11 +80,9 @@ describe('Render blocking resources audit', () => { 'url': 'https://fonts.googleapis.com/css?family=Fira+Sans+Condensed%3A400%2C400i%2C600%2C600i&subset=latin%2Clatin-ext&display=swap', 'wastedMs': 440, }, - { - 'totalBytes': 621, - 'url': 'https://fonts.googleapis.com/css?family=Montserrat', - 'wastedMs': 440, - }, + // Due to internal H2 simulation details, parallel HTTP/2 requests are pipelined which makes + // it look like Montserrat starts after Fira Sans finishes. It would be preferred + // if eventual simulation improvements list Montserrat here as well. ]); }); diff --git a/lighthouse-core/test/audits/dobetterweb/uses-http2-test.js b/lighthouse-core/test/audits/dobetterweb/uses-http2-test.js index 7ee463cbb6da..8ac0b08e9d75 100644 --- a/lighthouse-core/test/audits/dobetterweb/uses-http2-test.js +++ b/lighthouse-core/test/audits/dobetterweb/uses-http2-test.js @@ -44,8 +44,8 @@ describe('Resources are fetched over http/2', () => { // make sure we flag all the rest expect(result.details.items).toHaveLength(60); // make sure we report savings - expect(result.numericValue).toMatchInlineSnapshot(`1030`); - expect(result.details.overallSavingsMs).toMatchInlineSnapshot(`1030`); + expect(result.numericValue).toMatchInlineSnapshot(`1310`); + expect(result.details.overallSavingsMs).toMatchInlineSnapshot(`1310`); // make sure we have a failing score expect(result.score).toBeLessThan(0.5); }); @@ -70,7 +70,7 @@ describe('Resources are fetched over http/2', () => { expect(urls).not.toContain(records[30].url); expect(result.details.items).toHaveLength(30); // make sure we report less savings - expect(result.numericValue).toMatchInlineSnapshot(`250`); - expect(result.details.overallSavingsMs).toMatchInlineSnapshot(`250`); + expect(result.numericValue).toMatchInlineSnapshot(`850`); + expect(result.details.overallSavingsMs).toMatchInlineSnapshot(`850`); }); }); diff --git a/lighthouse-core/test/audits/timing-budget-test.js b/lighthouse-core/test/audits/timing-budget-test.js index 2445e4bd2b70..7c33ab34f869 100644 --- a/lighthouse-core/test/audits/timing-budget-test.js +++ b/lighthouse-core/test/audits/timing-budget-test.js @@ -28,7 +28,7 @@ describe('Performance: Timing budget audit', () => { context = { computedCache: new Map(), settings: { - throttlingMethod: 'simulate', + throttlingMethod: 'devtools', }, }; }); @@ -63,15 +63,15 @@ describe('Performance: Timing budget audit', () => { const items = result.details.items; // Failing Budget expect(items[0].label).toBeDisplayString('Estimated Input Latency'); - expect(items[0].measurement).toBeCloseTo(77.8); - expect(items[0].overBudget).toBeCloseTo(67.8); + expect(items[0].measurement).toBeCloseTo(17.07); + expect(items[0].overBudget).toBeCloseTo(7.07); }); it('calculates the "overBudget" column correctly', async () => { const result = await TimingBudgetAudit.audit(artifacts, context); // Failing Budget - expect(result.details.items[0].overBudget).toBeCloseTo(67.8); + expect(result.details.items[0].overBudget).toBeCloseTo(7.07); // Passing Budget expect(result.details.items[1].overBudget).toBeUndefined(); diff --git a/lighthouse-core/test/computed/metrics/__snapshots__/estimated-input-latency-test.js.snap b/lighthouse-core/test/computed/metrics/__snapshots__/estimated-input-latency-test.js.snap index d0fbfa56638c..a78306bf3e4a 100644 --- a/lighthouse-core/test/computed/metrics/__snapshots__/estimated-input-latency-test.js.snap +++ b/lighthouse-core/test/computed/metrics/__snapshots__/estimated-input-latency-test.js.snap @@ -2,8 +2,8 @@ exports[`Metrics: EIL should compute a simulated value 1`] = ` Object { - "optimistic": 93, + "optimistic": 101, "pessimistic": 101, - "timing": 78, + "timing": 81, } `; diff --git a/lighthouse-core/test/computed/metrics/__snapshots__/lantern-estimated-input-latency-test.js.snap b/lighthouse-core/test/computed/metrics/__snapshots__/lantern-estimated-input-latency-test.js.snap index 39ee26a0e277..9e2101d7cac3 100644 --- a/lighthouse-core/test/computed/metrics/__snapshots__/lantern-estimated-input-latency-test.js.snap +++ b/lighthouse-core/test/computed/metrics/__snapshots__/lantern-estimated-input-latency-test.js.snap @@ -2,8 +2,8 @@ exports[`Metrics: Lantern EIL should compute a simulated value 1`] = ` Object { - "optimistic": 93, + "optimistic": 101, "pessimistic": 101, - "timing": 78, + "timing": 81, } `; diff --git a/lighthouse-core/test/computed/metrics/timing-summary-test.js b/lighthouse-core/test/computed/metrics/timing-summary-test.js index 6f8155de2539..ca0353967a50 100644 --- a/lighthouse-core/test/computed/metrics/timing-summary-test.js +++ b/lighthouse-core/test/computed/metrics/timing-summary-test.js @@ -19,7 +19,7 @@ describe('Timing summary', () => { expect(result.metrics).toMatchInlineSnapshot(` Object { "cumulativeLayoutShift": 0, - "estimatedInputLatency": 77.79999999999995, + "estimatedInputLatency": 80.93333333333328, "estimatedInputLatencyTs": undefined, "firstCPUIdle": 3351.3320000492963, "firstCPUIdleTs": undefined, @@ -59,7 +59,7 @@ describe('Timing summary', () => { "observedTraceEndTs": 225426711887, "speedIndex": 1676.1335047609864, "speedIndexTs": undefined, - "totalBlockingTime": 726.4774999940994, + "totalBlockingTime": 776.9999999999995, } `); // Includes performance metrics diff --git a/lighthouse-core/test/computed/metrics/total-blocking-time-test.js b/lighthouse-core/test/computed/metrics/total-blocking-time-test.js index 5d14464827f3..851eb677fc03 100644 --- a/lighthouse-core/test/computed/metrics/total-blocking-time-test.js +++ b/lighthouse-core/test/computed/metrics/total-blocking-time-test.js @@ -22,12 +22,12 @@ describe('Metrics: TotalBlockingTime', () => { optimistic: Math.round(result.optimisticEstimate.timeInMs), pessimistic: Math.round(result.pessimisticEstimate.timeInMs), }).toMatchInlineSnapshot(` -Object { - "optimistic": 676, - "pessimistic": 777, - "timing": 726, -} -`); + Object { + "optimistic": 777, + "pessimistic": 777, + "timing": 777, + } + `); }); it('should compute an observed value', async () => { @@ -94,42 +94,54 @@ Object { const fcpTimeMs = 1000; const interactiveTimeMs = 2000; - expect(TotalBlockingTime.calculateSumOfBlockingTime( - [{start: 1951, end: 2100, duration: 149}], - fcpTimeMs, - interactiveTimeMs - )).toBe(0); // Duration after clipping is 49, which is < 50. - expect(TotalBlockingTime.calculateSumOfBlockingTime( - [{start: 1950, end: 2100, duration: 150}], - fcpTimeMs, - interactiveTimeMs - )).toBe(0); // Duration after clipping is 50, so time after 50ms is 0ms. - expect(TotalBlockingTime.calculateSumOfBlockingTime( - [{start: 1949, end: 2100, duration: 151}], - fcpTimeMs, - interactiveTimeMs - )).toBe(1); // Duration after clipping is 51, so time after 50ms is 1ms. + expect( + TotalBlockingTime.calculateSumOfBlockingTime( + [{start: 1951, end: 2100, duration: 149}], + fcpTimeMs, + interactiveTimeMs + ) + ).toBe(0); // Duration after clipping is 49, which is < 50. + expect( + TotalBlockingTime.calculateSumOfBlockingTime( + [{start: 1950, end: 2100, duration: 150}], + fcpTimeMs, + interactiveTimeMs + ) + ).toBe(0); // Duration after clipping is 50, so time after 50ms is 0ms. + expect( + TotalBlockingTime.calculateSumOfBlockingTime( + [{start: 1949, end: 2100, duration: 151}], + fcpTimeMs, + interactiveTimeMs + ) + ).toBe(1); // Duration after clipping is 51, so time after 50ms is 1ms. }); it('clips properly if FCP falls in the middle of a task', () => { const fcpTimeMs = 1000; const interactiveTimeMs = 2000; - expect(TotalBlockingTime.calculateSumOfBlockingTime( - [{start: 900, end: 1049, duration: 149}], - fcpTimeMs, - interactiveTimeMs - )).toBe(0); // Duration after clipping is 49, which is < 50. - expect(TotalBlockingTime.calculateSumOfBlockingTime( - [{start: 900, end: 1050, duration: 150}], - fcpTimeMs, - interactiveTimeMs - )).toBe(0); // Duration after clipping is 50, so time after 50ms is 0ms. - expect(TotalBlockingTime.calculateSumOfBlockingTime( - [{start: 900, end: 1051, duration: 151}], - fcpTimeMs, - interactiveTimeMs - )).toBe(1); // Duration after clipping is 51, so time after 50ms is 1ms. + expect( + TotalBlockingTime.calculateSumOfBlockingTime( + [{start: 900, end: 1049, duration: 149}], + fcpTimeMs, + interactiveTimeMs + ) + ).toBe(0); // Duration after clipping is 49, which is < 50. + expect( + TotalBlockingTime.calculateSumOfBlockingTime( + [{start: 900, end: 1050, duration: 150}], + fcpTimeMs, + interactiveTimeMs + ) + ).toBe(0); // Duration after clipping is 50, so time after 50ms is 0ms. + expect( + TotalBlockingTime.calculateSumOfBlockingTime( + [{start: 900, end: 1051, duration: 151}], + fcpTimeMs, + interactiveTimeMs + ) + ).toBe(1); // Duration after clipping is 51, so time after 50ms is 1ms. }); // This can happen in the lantern metric case, where we use the optimistic diff --git a/lighthouse-core/test/results/sample_v2.json b/lighthouse-core/test/results/sample_v2.json index d1a78fb291fb..ed17ea15ff15 100644 --- a/lighthouse-core/test/results/sample_v2.json +++ b/lighthouse-core/test/results/sample_v2.json @@ -3945,9 +3945,9 @@ "id": "uses-http2", "title": "Use HTTP/2", "description": "HTTP/2 offers many benefits over HTTP/1.1, including binary headers, multiplexing, and server push. [Learn more](https://web.dev/uses-http2/).", - "score": 0.41, + "score": 0.34, "scoreDisplayMode": "binary", - "numericValue": 1550, + "numericValue": 2130, "numericUnit": "millisecond", "displayValue": "15 requests not served via HTTP/2", "details": { @@ -4026,7 +4026,7 @@ "url": "http://localhost:10200/favicon.ico" } ], - "overallSavingsMs": 1550 + "overallSavingsMs": 2130 } }, "uses-passive-event-listeners": {