-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bfcache] Add notRestoredReasons field in PerformanceNavigationTiming
This CL adds back/forward cache not restored reasons in Performance NavigationTiming API. It's proposed here: w3c/navigation-timing#171 Explainer: https://github.com/rubberyuzu/bfcache-not-retored-reason/blob/main/NotRestoredReason.md This CL does two things: - exposes not restored reasons to PerformanceNavigationTiming API - adds WPT The WPT have to run on all platforms because this API is intended to collect bfcache metrics from the wild, regardless of the platforms. LOW_COVERAGE_REASON=Adding coverage for new field. Just missing the tests for the existing fields Bug: 1349228 Change-Id: I8dd96a60188bdff94a21c4e4e34cacf181a823db Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3835534 Reviewed-by: Daniel Cheng <[email protected]> Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Weizhong Xia <[email protected]> Commit-Queue: Yuzu Saijo <[email protected]> Cr-Commit-Position: refs/heads/main@{#1054800} NOKEYCHECK=True GitOrigin-RevId: e1af9facf232a11871b0c668b90ec17c5a5d5e16
- Loading branch information
1 parent
86f433d
commit 2c85499
Showing
18 changed files
with
446 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...performance-timeline/not-restored-reasons/performance-navigation-timing-bfcache.window.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// META: title=RemoteContextHelper navigation using BFCache | ||
// META: script=/common/dispatcher/dispatcher.js | ||
// META: script=/common/get-host-info.sub.js | ||
// META: script=/common/utils.js | ||
// META: script=/resources/testharness.js | ||
// META: script=/resources/testharnessreport.js | ||
// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js | ||
// META: script=/html/browsers/browsing-the-web/remote-context-helper-tests/resources/test-helper.js | ||
|
||
'use strict'; | ||
|
||
// Ensure that notRestoredReasons is empty for successful BFCache restore. | ||
promise_test(async t => { | ||
const rcHelper = new RemoteContextHelper(); | ||
|
||
// Open a window with noopener so that BFCache will work. | ||
const rc1 = await rcHelper.addWindow( | ||
/*config=*/ null, /*options=*/ {features: 'noopener'}); | ||
|
||
// Navigate away. | ||
const rc2 = await rc1.navigateToNew(); | ||
|
||
// Navigate back. | ||
await rc2.historyBack(); | ||
|
||
// Verify that no reasons are recorded for successful restore. | ||
assert_true(await rc1.executeScript(() => { | ||
let reasons = performance.getEntriesByType('navigation')[0].notRestoredReasons; | ||
return reasons == null; | ||
})); | ||
}); |
Oops, something went wrong.