Skip to content

Commit

Permalink
core(render-blocking-resources): add FCP and LCP savings (#15238)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianaixba authored Jul 11, 2023
1 parent 2bd5e7e commit 4ce741a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/audits/byte-efficiency/render-blocking-resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ class RenderBlockingResources extends Audit {
numericValue: wastedMs,
numericUnit: 'millisecond',
details,
metricSavings: {FCP: wastedMs, LCP: wastedMs},
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ describe('Render blocking resources audit', () => {
const result = await RenderBlockingResourcesAudit.audit(artifacts, {settings, computedCache});
assert.equal(result.score, 1);
assert.equal(result.numericValue, 0);
assert.deepStrictEqual(result.metricSavings, {FCP: 0, LCP: 0});
});

it('evaluates amp page correctly', async () => {
Expand Down Expand Up @@ -87,6 +88,7 @@ describe('Render blocking resources audit', () => {
// it look like Montserrat starts after Fira Sans finishes. It would be preferred
// if eventual simulation improvements list Montserrat here as well.
]);
expect(result.metricSavings).toEqual({FCP: 450, LCP: 450});
});

describe('#estimateSavingsWithGraphs', () => {
Expand Down

0 comments on commit 4ce741a

Please sign in to comment.