diff --git a/core/gather/gatherers/dobetterweb/response-compression.js b/core/gather/gatherers/dobetterweb/response-compression.js index 1a9a58938fde..83b2d35f84a2 100644 --- a/core/gather/gatherers/dobetterweb/response-compression.js +++ b/core/gather/gatherers/dobetterweb/response-compression.js @@ -95,7 +95,7 @@ class ResponseCompression extends FRGatherer { * @param {LH.Artifacts.NetworkRequest[]} networkRecords * @return {Promise} */ - async _getArtifact(context, networkRecords) { + async getCompressibleRecords(context, networkRecords) { const session = context.driver.defaultSession; const textRecords = ResponseCompression.filterUnoptimizedResponses(networkRecords); @@ -138,7 +138,7 @@ class ResponseCompression extends FRGatherer { async getArtifact(context) { const devtoolsLog = context.dependencies.DevtoolsLog; const networkRecords = await NetworkRecords.request(devtoolsLog, context); - return this._getArtifact(context, networkRecords); + return this.getCompressibleRecords(context, networkRecords); } } diff --git a/core/test/gather/gatherers/dobetterweb/response-compression-test.js b/core/test/gather/gatherers/dobetterweb/response-compression-test.js index 5d6dfd5908be..24bfb08b25aa 100644 --- a/core/test/gather/gatherers/dobetterweb/response-compression-test.js +++ b/core/test/gather/gatherers/dobetterweb/response-compression-test.js @@ -132,14 +132,14 @@ describe('Optimized responses', () => { }); it('returns only text and non encoded responses', async () => { - const artifact = await gatherer._getArtifact(context, networkRecords); + const artifact = await gatherer.getCompressibleRecords(context, networkRecords); expect(artifact).toHaveLength(2); expect(artifact[0].url).toMatch(/index\.css$/); expect(artifact[1].url).toMatch(/index\.json$/); }); it('computes sizes', async () => { - const artifact = await gatherer._getArtifact(context, networkRecords); + const artifact = await gatherer.getCompressibleRecords(context, networkRecords); expect(artifact).toHaveLength(2); expect(artifact[0].resourceSize).toEqual(6); expect(artifact[0].gzipSize).toEqual(26); @@ -147,7 +147,7 @@ describe('Optimized responses', () => { it('recovers from driver errors', async () => { mocks.networkMock.fetchResponseBodyFromCache.mockRejectedValue(new Error('Failed')); - const artifact = await gatherer._getArtifact(context, networkRecords); + const artifact = await gatherer.getCompressibleRecords(context, networkRecords); expect(artifact).toHaveLength(2); expect(artifact[0].resourceSize).toEqual(6); expect(artifact[0].gzipSize).toBeUndefined(); @@ -179,7 +179,7 @@ describe('Optimized responses', () => { }, ]; - const artifact = await gatherer._getArtifact(context, networkRecords); + const artifact = await gatherer.getCompressibleRecords(context, networkRecords); expect(artifact).toHaveLength(1); expect(artifact[0].resourceSize).toEqual(123); });