Skip to content

Commit

Permalink
discard -> restore
Browse files Browse the repository at this point in the history
  • Loading branch information
tunetheweb committed Nov 15, 2022
1 parent 2704ae1 commit 656ff00
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -701,9 +701,9 @@ interface Metric {
* For pages that are restored from the bfcache, this value will
* be 'back-forward-cache'.
* For pages that are restored after being discarded, this value will
* be 'discarded'.
* be 'restore'.
*/
navigationType: 'navigate' | 'reload' | 'back-forward' | 'back-forward-cache' | 'prerender' | 'discarded';
navigationType: 'navigate' | 'reload' | 'back-forward' | 'back-forward-cache' | 'prerender' | 'restore';
}
```

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/onCLS-test.js
Expand Up @@ -632,7 +632,7 @@ describe('onCLS()', async function() {
assert.strictEqual(cls.navigationType, 'back-forward-cache');
});

it('reports discarded as nav type for wasDiscarded', async function() {
it('reports restore as nav type for wasDiscarded', async function() {
if (!browserSupportsCLS) this.skip();

await browser.url('/test/cls?wasDiscarded=1');
Expand All @@ -650,7 +650,7 @@ describe('onCLS()', async function() {
assert.strictEqual(cls.value, cls.delta);
assert.strictEqual(cls.rating, 'good');
assert.strictEqual(cls.entries.length, 2);
assert.strictEqual(cls.navigationType, 'discarded');
assert.strictEqual(cls.navigationType, 'restore');
});

describe('attribution', function() {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/onFCP-test.js
Expand Up @@ -235,7 +235,7 @@ describe('onFCP()', async function() {
assert.strictEqual(fcp2.navigationType, 'back-forward-cache');
});

it('reports discarded as nav type for wasDiscarded', async function() {
it('reports restore as nav type for wasDiscarded', async function() {
if (!browserSupportsFCP) this.skip();

await browser.url('/test/fcp?wasDiscarded=1');
Expand All @@ -249,7 +249,7 @@ describe('onFCP()', async function() {
assert.strictEqual(fcp.value, fcp.delta);
assert.strictEqual(fcp.rating, 'good');
assert.strictEqual(fcp.entries.length, 1);
assert.strictEqual(fcp.navigationType, 'discarded');
assert.strictEqual(fcp.navigationType, 'restore');
});

describe('attribution', function() {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/onFID-test.js
Expand Up @@ -194,7 +194,7 @@ describe('onFID()', async function() {
assert.match(fid2.entries[0].name, /(mouse|pointer)down/);
});

it('reports discarded as nav type for wasDiscarded', async function() {
it('reports restore as nav type for wasDiscarded', async function() {
if (!browserSupportsFID) this.skip();

await browser.url('/test/fid?wasDiscarded=1');
Expand All @@ -211,7 +211,7 @@ describe('onFID()', async function() {
assert.strictEqual(fid.name, 'FID');
assert.strictEqual(fid.value, fid.delta);
assert.strictEqual(fid.rating, 'good');
assert.strictEqual(fid.navigationType, 'discarded');
assert.strictEqual(fid.navigationType, 'restore');
assert.match(fid.entries[0].name, /(mouse|pointer)down/);
});

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/onINP-test.js
Expand Up @@ -316,7 +316,7 @@ describe('onINP()', async function() {
assert.strictEqual(beacons.length, 0);
});

it('reports discarded as nav type for wasDiscarded', async function() {
it('reports restore as nav type for wasDiscarded', async function() {
if (!browserSupportsINP) this.skip();

await browser.url('/test/inp?click=100&wasDiscarded=1');
Expand All @@ -337,7 +337,7 @@ describe('onINP()', async function() {
assert(containsEntry(inp.entries, 'click', 'h1'));
assert(interactionIDsMatch(inp.entries));
assert(inp.entries[0].interactionId > 0);
assert.strictEqual(inp.navigationType, 'discarded');
assert.strictEqual(inp.navigationType, 'restore');
});

describe('attribution', function() {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/onLCP-test.js
Expand Up @@ -373,7 +373,7 @@ describe('onLCP()', async function() {
assert.strictEqual(lcp2.navigationType, 'back-forward-cache');
});

it('reports discarded as nav type for wasDiscarded', async function() {
it('reports restore as nav type for wasDiscarded', async function() {
if (!browserSupportsLCP) this.skip();

await browser.url('/test/lcp?wasDiscarded=1');
Expand All @@ -394,7 +394,7 @@ describe('onLCP()', async function() {
assert.strictEqual(lcp.value, lcp.delta);
assert.strictEqual(lcp.rating, 'good');
assert.strictEqual(lcp.entries.length, 1);
assert.strictEqual(lcp.navigationType, 'discarded');
assert.strictEqual(lcp.navigationType, 'restore');
});

describe('attribution', function() {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/onTTFB-test.js
Expand Up @@ -209,7 +209,7 @@ describe('onTTFB()', async function() {
}
});

it('reports discarded as nav type for wasDiscarded', async function() {
it('reports restore as nav type for wasDiscarded', async function() {
await browser.url('/test/ttfb?wasDiscarded=1');

const ttfb = await getTTFBBeacon();
Expand All @@ -221,7 +221,7 @@ describe('onTTFB()', async function() {
assert.strictEqual(ttfb.name, 'TTFB');
assert.strictEqual(ttfb.value, ttfb.delta);
assert.strictEqual(ttfb.rating, 'good');
assert.strictEqual(ttfb.navigationType, 'discarded');
assert.strictEqual(ttfb.navigationType, 'restore');
assert.strictEqual(ttfb.entries.length, 1);

assertValidEntry(ttfb.entries[0]);
Expand Down

0 comments on commit 656ff00

Please sign in to comment.