Skip to content

Commit

Permalink
[bfcache]Update report strings for not restored reasons
Browse files Browse the repository at this point in the history
This CL does the following:
1) Update the report strings for NotRestoredReasons API to be
more concise. Mostly masking the reasons that are not actionable for
web developers. This includes updating the test expectations
accordingly.
2) Remove the unused reasons (NotMostRecentNavigationEntry and
FencedFramesEmbedder)

Bug: 1472637
Change-Id: I9b77bcdd3556cf6589dc422ed41ba6f9369ba129
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5248405
Reviewed-by: Yuzu Saijo <[email protected]>
Reviewed-by: Rakina Zata Amni <[email protected]>
Reviewed-by: Kouhei Ueno <[email protected]>
Commit-Queue: Yuzu Saijo <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1261697}
  • Loading branch information
rubberyuzu authored and chromium-wpt-export-bot committed Feb 16, 2024
1 parent e3b3857 commit 553ce34
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions IndexedDB/back-forward-cache-open-connection.window.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ promise_test(async t => {
await rc2.historyBack();
// The previous page receiving versionchange event should be evicted with the
// correct reason.
// `kIgnoreEventAndEvict` will be reported as "internal-error".
// `kIgnoreEventAndEvict` will be reported as "masked".
// See `NotRestoredReasonToReportString()`.
await assertNotRestoredFromBFCache(rc1, ['internal-error']);
await assertNotRestoredFromBFCache(rc1, ['masked']);
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ async_test(t => {
window.stop();
} else {
const nrr = performance.getEntriesByType('navigation')[0].notRestoredReasons;
assert_equals(nrr.reasons[0].reason, "parser-aborted");
assert_equals(nrr.reasons.length, 1);
assert_equals(nrr.reasons[0], "parser-aborted");
t.done();
}
}, "aborting a parser should block bfcache.");
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ promise_test(async t => {

// Check the BFCache result and the reported reasons.
await assertBFCacheEligibility(rc1, /*shouldRestoreFromBFCache=*/ false);
await assertNotRestoredFromBFCache(rc1, ['error-document']);
await assertNotRestoredFromBFCache(rc1, ['navigation-failure']);
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ promise_test(async t => {
await openWebRTC(rc1);
// The page should not be eligible for BFCache because of open WebRTC connection and live MediaStreamTrack.
await assertBFCacheEligibility(rc1, /*shouldRestoreFromBFCache=*/ false);
await assertNotRestoredFromBFCache(rc1, ['WebRTC', 'LiveMediaStreamTrack']);
await assertNotRestoredFromBFCache(rc1, ['webrtc', 'media-stream']);
});

0 comments on commit 553ce34

Please sign in to comment.