Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: update interactive test trace #16001

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

exports[`Metrics: FCP should compute a simulated value 1`] = `
Object {
"optimistic": 1033,
"optimistic": 1107,
"optimisticNodeTimings": 4,
"pessimistic": 1033,
"pessimistic": 1107,
"pessimisticNodeTimings": 4,
"timing": 1033,
"timing": 1107,
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

exports[`Metrics: FMP should compute a simulated value 1`] = `
Object {
"optimistic": 1033,
"optimistic": 1107,
"optimisticNodeTimings": 4,
"pessimistic": 1069,
"pessimistic": 1134,
"pessimisticNodeTimings": 5,
"timing": 1051,
"timing": 1120,
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

exports[`Metrics: TTI should compute a simulated value 1`] = `
Object {
"optimistic": 4178,
"pessimistic": 3773,
"timing": 3955,
"optimistic": 1107,
"optimisticNodeTimings": 14,
"pessimistic": 1134,
"pessimisticNodeTimings": 31,
"timing": 1122,
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

exports[`Metrics: Max Potential FID should compute a simulated value 1`] = `
Object {
"optimistic": 48,
"pessimistic": 48,
"timing": 48,
"optimistic": 50,
"pessimistic": 50,
"timing": 50,
}
`;
8 changes: 4 additions & 4 deletions core/test/computed/metrics/first-contentful-paint-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ describe('Metrics: FCP', () => {

await expect(result).toMatchInlineSnapshot(`
Object {
"timestamp": 350560322851,
"timing": 167.323,
"timestamp": 376406173872,
"timing": 192.308,
}
`);
});
Expand All @@ -57,8 +57,8 @@ Object {

await expect(result).toMatchInlineSnapshot(`
Object {
"timestamp": 350560322851,
"timing": 167.323,
"timestamp": 376406173872,
"timing": 192.308,
}
`);
});
Expand Down
8 changes: 4 additions & 4 deletions core/test/computed/metrics/first-meaningful-paint-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ describe('Metrics: FMP', () => {

await expect(result).toMatchInlineSnapshot(`
Object {
"timestamp": 350560359679,
"timing": 204.151,
"timestamp": 376406210378,
"timing": 228.814,
}
`);
});
Expand All @@ -80,8 +80,8 @@ Object {

await expect(result).toMatchInlineSnapshot(`
Object {
"timestamp": 350560359679,
"timing": 204.151,
"timestamp": 376406210378,
"timing": 228.814,
}
`);
});
Expand Down
14 changes: 7 additions & 7 deletions core/test/computed/metrics/interactive-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import assert from 'assert/strict';
import {Interactive} from '../../../computed/metrics/interactive.js';
import {getURLArtifactFromDevtoolsLog, loadTraceFixture} from '../../test-utils.js';

const {trace, devtoolsLog} = loadTraceFixture('progressive-app-m60');
const {trace, devtoolsLog} = loadTraceFixture('progressive-app');
const URL = getURLArtifactFromDevtoolsLog(devtoolsLog);

/**
Expand Down Expand Up @@ -59,9 +59,9 @@ describe('Metrics: TTI', () => {
timing: Math.round(result.timing),
optimistic: Math.round(result.optimisticEstimate.timeInMs),
pessimistic: Math.round(result.pessimisticEstimate.timeInMs),
optimisticNodeTimings: result.optimisticEstimate.nodeTimings.size,
pessimisticNodeTimings: result.pessimisticEstimate.nodeTimings.size,
}).toMatchSnapshot();
assert.equal(result.optimisticEstimate.nodeTimings.size, 20);
assert.equal(result.pessimisticEstimate.nodeTimings.size, 80);
assert.ok(result.optimisticGraph, 'should have created optimistic graph');
assert.ok(result.pessimisticGraph, 'should have created pessimistic graph');
});
Expand All @@ -74,8 +74,8 @@ describe('Metrics: TTI', () => {
const result = await getResult({trace, devtoolsLog, gatherContext, settings, URL},
context);

assert.equal(Math.round(result.timing), 1582);
assert.equal(result.timestamp, 225415754204);
assert.equal(Math.round(result.timing), 224);
assert.equal(result.timestamp, 376406205074);
});

it('should compute an observed value (mobile)', async () => {
Expand All @@ -86,8 +86,8 @@ describe('Metrics: TTI', () => {
const result = await getResult({trace, devtoolsLog, gatherContext, settings, URL},
context);

assert.equal(Math.round(result.timing), 1582);
assert.equal(result.timestamp, 225415754204);
assert.equal(Math.round(result.timing), 224);
assert.equal(result.timestamp, 376406205074);
});

describe('#findOverlappingQuietPeriods', () => {
Expand Down
2 changes: 1 addition & 1 deletion core/test/computed/metrics/max-potential-fid-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('Metrics: Max Potential FID', () => {

await expect(result).toMatchInlineSnapshot(`
Object {
"timing": 18.22,
"timing": 16,
}
`);
});
Expand Down
14 changes: 7 additions & 7 deletions core/test/computed/metrics/speed-index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ describe('Metrics: Speed Index', () => {
optimistic: Math.round(result.optimisticEstimate.timeInMs),
pessimistic: Math.round(result.pessimisticEstimate.timeInMs)}).toMatchInlineSnapshot(`
Object {
"optimistic": 307,
"pessimistic": 1076,
"timing": 1033,
"optimistic": 379,
"pessimistic": 1122,
"timing": 1107,
}
`);
});
Expand Down Expand Up @@ -79,8 +79,8 @@ Object {

await expect(result).toMatchInlineSnapshot(`
Object {
"timestamp": 350560462528,
"timing": 307,
"timestamp": 376406360564,
"timing": 379,
}
`);
});
Expand All @@ -94,8 +94,8 @@ Object {

await expect(result).toMatchInlineSnapshot(`
Object {
"timestamp": 350560462528,
"timing": 307,
"timestamp": 376406360564,
"timing": 379,
}
`);
});
Expand Down
24 changes: 12 additions & 12 deletions core/test/computed/processed-trace-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ describe('ProcessedTrace', () => {
const context = {computedCache: new Map()};
const processedTrace = await ProcessedTrace.request(pwaTrace, context);

expect(processedTrace.processEvents.length).toEqual(30050);
expect(processedTrace.mainThreadEvents.length).toEqual(14970);
expect(processedTrace.processEvents.length).toEqual(118854);
expect(processedTrace.mainThreadEvents.length).toEqual(55691);

delete processedTrace.processEvents;
delete processedTrace.mainThreadEvents;
Expand All @@ -25,32 +25,32 @@ describe('ProcessedTrace', () => {

expect(processedTrace).toMatchObject({
mainFrameInfo: {
frameId: 'B252105E12E98AFD5BC5DCC4D6F4813F',
startingPid: 13956,
frameId: '4445FED303BABCB702B8DAAA715B1202',
startingPid: 87728,
},
timeOriginEvt: {
args: {
frame: 'B252105E12E98AFD5BC5DCC4D6F4813F',
frame: '4445FED303BABCB702B8DAAA715B1202',
},
cat: 'blink.user_timing',
name: 'navigationStart',
ph: 'R',
pid: 13958,
pid: 87730,
tid: 259,
ts: 350560155528,
tts: 34613,
ts: 376405981564,
tts: 36028,
},
frames: [{
id: 'B252105E12E98AFD5BC5DCC4D6F4813F',
id: '4445FED303BABCB702B8DAAA715B1202',
url: 'https://squoosh.app/',
}],
timestamps: {
timeOrigin: 350560155528,
traceEnd: 350562869197,
timeOrigin: 376405981564,
traceEnd: 376417286238,
},
timings: {
timeOrigin: 0,
traceEnd: 2713.669,
traceEnd: 11304.674,
},
});
});
Expand Down
Loading
Loading