Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed May 14, 2024
1 parent 12096d5 commit fd768bb
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 43 deletions.
32 changes: 16 additions & 16 deletions core/test/audits/__snapshots__/predictive-perf-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

exports[`Performance: predictive performance audit should compute the predicted values 1`] = `
Object {
"optimisticFCP": 2294,
"optimisticFMP": 2294,
"optimisticLCP": 2294,
"optimisticSI": 1393,
"optimisticTTI": 3795,
"pessimisticFCP": 2294,
"pessimisticFMP": 3233,
"pessimisticLCP": 3233,
"pessimisticSI": 3052,
"pessimisticTTI": 5272,
"roughEstimateOfFCP": 2294,
"roughEstimateOfFMP": 2764,
"roughEstimateOfLCP": 2764,
"optimisticFCP": 1059,
"optimisticFMP": 1059,
"optimisticLCP": 1445,
"optimisticSI": 261,
"optimisticTTI": 2132,
"pessimisticFCP": 1059,
"pessimisticFMP": 1059,
"pessimisticLCP": 1603,
"pessimisticSI": 1109,
"pessimisticTTI": 3981,
"roughEstimateOfFCP": 1059,
"roughEstimateOfFMP": 1059,
"roughEstimateOfLCP": 1524,
"roughEstimateOfLCPLoadEnd": undefined,
"roughEstimateOfLCPLoadStart": undefined,
"roughEstimateOfSI": 3172,
"roughEstimateOfTTFB": 611,
"roughEstimateOfTTI": 4607,
"roughEstimateOfSI": 1059,
"roughEstimateOfTTFB": 638,
"roughEstimateOfTTI": 3149,
}
`;
10 changes: 5 additions & 5 deletions core/test/audits/byte-efficiency/byte-efficiency-audit-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ describe('Byte efficiency base audit', () => {
{computedCache: new Map()}
);

assert.equal(result.numericValue, 0);
assert.equal(result.numericValue, 160);
});

it('should create load simulator with the specified settings', async () => {
Expand All @@ -255,13 +255,13 @@ describe('Byte efficiency base audit', () => {
let result = await MockAudit.audit(artifacts, {settings, computedCache});
// expect modest savings
expect(result.numericValue).toBeLessThan(5000);
expect(result.numericValue).toMatchInlineSnapshot(`440`);
expect(result.numericValue).toMatchInlineSnapshot(`1220`);

settings = {throttlingMethod: 'simulate', throttling: ultraSlowThrottling};
result = await MockAudit.audit(artifacts, {settings, computedCache});
// expect lots of savings
expect(result.numericValue).not.toBeLessThan(5000);
expect(result.numericValue).toMatchInlineSnapshot(`5790`);
expect(result.numericValue).toMatchInlineSnapshot(`13580`);
});

it('should compute savings with throughput in timespan mode', async () => {
Expand All @@ -285,7 +285,7 @@ describe('Byte efficiency base audit', () => {
const modestThrottling = {rttMs: 150, throughputKbps: 1000, cpuSlowdownMultiplier: 2};
const settings = {throttlingMethod: 'simulate', throttling: modestThrottling};
const result = await MockAudit.audit(artifacts, {settings, computedCache});
expect(result.details.overallSavingsMs).toEqual(2120);
expect(result.details.overallSavingsMs).toEqual(1400);
});

it('should return n/a if no network records in timespan mode', async () => {
Expand Down Expand Up @@ -342,7 +342,7 @@ describe('Byte efficiency base audit', () => {
};
const settings = {throttlingMethod: 'devtools', throttling: modestThrottling};
const result = await MockAudit.audit(artifacts, {settings, computedCache});
expect(result.details.overallSavingsMs).toEqual(30);
expect(result.details.overallSavingsMs).toEqual(40);
});

describe('#scoreForWastedMs', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
readJson,
} from '../../test-utils.js';

const trace = readJson('../../fixtures/artifacts/paul/trace.json', import.meta);
const devtoolsLog = readJson('../../fixtures/artifacts/paul/devtoolslog.json', import.meta);
const trace = readJson('../../fixtures/traces/lcp-m78.json', import.meta);
const devtoolsLog = readJson('../../fixtures/traces/lcp-m78.devtools.log.json', import.meta);

describe('DuplicatedJavascript computed artifact', () => {
it('works (simple)', async () => {
Expand Down
2 changes: 1 addition & 1 deletion core/test/audits/predictive-perf-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Performance: predictive performance audit', () => {
const context = {computedCache: new Map(), settings: {locale: 'en'}};

const output = await PredictivePerf.audit(artifacts, context);
expect(output.displayValue).toBeDisplayString('4,610 ms');
expect(output.displayValue).toBeDisplayString('3,150 ms');
const metrics = output.details.items[0];
for (const [key, value] of Object.entries(metrics)) {
metrics[key] = value === undefined ? value : Math.round(value);
Expand Down
4 changes: 2 additions & 2 deletions core/test/computed/tbt-impact-tasks-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ 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';

const trace = readJson('../fixtures/artifacts/paul/trace.json', import.meta);
const devtoolsLog = readJson('../fixtures/artifacts/paul/devtoolslog.json', import.meta);
const trace = readJson('../fixtures/traces/lcp-m78.json', import.meta);
const devtoolsLog = readJson('../fixtures/traces/lcp-m78.devtools.log.json', import.meta);

describe('TBTImpactTasks', () => {
const mainDocumentUrl = 'https://example.com';
Expand Down
34 changes: 17 additions & 17 deletions core/test/lib/tracehouse/trace-processor-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -591,24 +591,24 @@ describe('TraceProcessor', () => {
const trace = TraceProcessor.processTrace(lcpTrace);
const navigation = TraceProcessor.processNavigation(trace);
expect({
'firstContentfulPaintEvt.ts': navigation.firstContentfulPaintEvt.ts,
'largestContentfulPaintEvt.ts': navigation.largestContentfulPaintEvt.ts,
'mainFrameInfo.frameId': trace.mainFrameInfo.frameId,
'timeOriginEvt.ts': trace.timeOriginEvt.ts,
'timestamps.firstContentfulPaint': navigation.timestamps.firstContentfulPaint,
'timestamps.largestContentfulPaint': navigation.timestamps.largestContentfulPaint,
'timings.firstContentfulPaint': navigation.timings.firstContentfulPaint,
'timings.largestContentfulPaint': navigation.timings.largestContentfulPaint,
}).toMatchInlineSnapshot(`
'firstContentfulPaintEvt.ts': navigation.firstContentfulPaintEvt.ts,
'largestContentfulPaintEvt.ts': navigation.largestContentfulPaintEvt.ts,
'mainFrameInfo.frameId': trace.mainFrameInfo.frameId,
'timeOriginEvt.ts': trace.timeOriginEvt.ts,
'timestamps.firstContentfulPaint': navigation.timestamps.firstContentfulPaint,
'timestamps.largestContentfulPaint': navigation.timestamps.largestContentfulPaint,
'timings.firstContentfulPaint': navigation.timings.firstContentfulPaint,
'timings.largestContentfulPaint': navigation.timings.largestContentfulPaint }).
toMatchInlineSnapshot(`
Object {
"firstContentfulPaintEvt.ts": 713038144775,
"largestContentfulPaintEvt.ts": 713038144775,
"mainFrameInfo.frameId": "70B6647836A0A07265E532B094184D2A",
"timeOriginEvt.ts": 713037023064,
"timestamps.firstContentfulPaint": 713038144775,
"timestamps.largestContentfulPaint": 713038144775,
"timings.firstContentfulPaint": 1121.711,
"timings.largestContentfulPaint": 1121.711,
"firstContentfulPaintEvt.ts": 343577475882,
"largestContentfulPaintEvt.ts": 343577475882,
"mainFrameInfo.frameId": "C0BCFDE8809D44AE98B51BD8568EB184",
"timeOriginEvt.ts": 343577184048,
"timestamps.firstContentfulPaint": 343577475882,
"timestamps.largestContentfulPaint": 343577475882,
"timings.firstContentfulPaint": 291.834,
"timings.largestContentfulPaint": 291.834,
}
`);
assert.ok(!navigation.lcpInvalidated);
Expand Down

0 comments on commit fd768bb

Please sign in to comment.