diff --git a/cli/test/smokehouse/test-definitions/oopif-requests.js b/cli/test/smokehouse/test-definitions/oopif-requests.js index 3520581dcd22..f875d6696541 100644 --- a/cli/test/smokehouse/test-definitions/oopif-requests.js +++ b/cli/test/smokehouse/test-definitions/oopif-requests.js @@ -64,8 +64,6 @@ const expectations = { // Disqus iframe (OOPIF) {url: /^https:\/\/disqus\.com\/embed\/comments\//, finished: true, statusCode: 200, resourceType: 'Document'}, - // Disqus subframe (that's a new OOPIF) - {url: 'https://accounts.google.com/o/oauth2/iframe', finished: true, statusCode: 200, resourceType: 'Document'}, ], }, }, diff --git a/core/test/computed/tbt-impact-tasks-test.js b/core/test/computed/tbt-impact-tasks-test.js index 9bc1b5bc2354..107da36d9706 100644 --- a/core/test/computed/tbt-impact-tasks-test.js +++ b/core/test/computed/tbt-impact-tasks-test.js @@ -11,6 +11,7 @@ import {getURLArtifactFromDevtoolsLog, readJson} from '../test-utils.js'; import {createTestTrace, rootFrame} from '../create-test-trace.js'; import {networkRecordsToDevtoolsLog} from '../network-records-to-devtools-log.js'; import {MainThreadTasks} from '../../computed/main-thread-tasks.js'; +import {NetworkRequest} from '../../lib/network-request.js'; const trace = readJson('../fixtures/artifacts/cnn/trace.json.gz', import.meta); const devtoolsLog = readJson('../fixtures/artifacts/cnn/devtoolslog.json.gz', import.meta); @@ -32,25 +33,28 @@ describe('TBTImpactTasks', () => { let metricComputationData; beforeEach(() => { + /** @type {Partial} */ + const mainDocumentRequest = { + requestId: '1', + priority: 'High', + networkRequestTime: 0, + networkEndTime: 500, + transferSize: 400, + url: mainDocumentUrl, + frameId: rootFrame, + }; metricComputationData = { trace: createTestTrace({ largestContentfulPaint: 15, traceEnd: 10_000, frameUrl: mainDocumentUrl, + networkRecords: [Object.assign(new NetworkRequest(), mainDocumentRequest)], topLevelTasks: [ // Add long task to defer TTI {ts: 1000, duration: 1000}, ], }), - devtoolsLog: networkRecordsToDevtoolsLog([{ - requestId: '1', - priority: 'High', - networkRequestTime: 0, - networkEndTime: 500, - transferSize: 400, - url: mainDocumentUrl, - frameId: rootFrame, - }]), + devtoolsLog: networkRecordsToDevtoolsLog([mainDocumentRequest]), URL: { requestedUrl: mainDocumentUrl, mainDocumentUrl, @@ -266,7 +270,7 @@ describe('TBTImpactTasks', () => { expect(tasksWithNoChildren).toEqual(tasksWithAllSelfImpact); const totalSelfImpact = tasksImpactingTbt.reduce((sum, t) => sum += t.selfTbtImpact, 0); - expect(totalSelfImpact).toMatchInlineSnapshot(`2819.9999999999545`); + expect(totalSelfImpact).toBeCloseTo(2820, 6); // Total self blocking time is just the total self impact without factoring in the TBT // bounds, so it should always be greater than or equal to the total TBT self impact.