-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prerender: Expose PrerenderHost::FinalStatus to DevTools
This CL introduces cancellation FinalStatus in PrerenderHost to DevTools , and adds related inspector protocol tests. Bug: 1249776 Change-Id: I7b6f4ca2c7ebc57f60638e6e7edbb02a4fed63e9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3573829 Reviewed-by: Asami Doi <asamidoi@chromium.org> Reviewed-by: Alex Moshchuk <alexmos@chromium.org> Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org> Commit-Queue: Huanpo Lin <robertlin@chromium.org> Reviewed-by: Andrey Kosyakov <caseq@chromium.org> Cr-Commit-Position: refs/heads/main@{#1001800}
- Loading branch information
Robert Lin
authored and
Chromium LUCI CQ
committed
May 10, 2022
1 parent
365a7d7
commit 286e2eb
Showing
16 changed files
with
193 additions
and
6 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
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
16 changes: 16 additions & 0 deletions
16
...web_tests/http/tests/inspector-protocol/prerender/report-prerender-cancellation-status.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,16 @@ | ||
// This test makes sure that the inspector is notified of the final status when | ||
// prerendering is cancelled for some reasons. To emulate the cancellation, | ||
// this test navigates the prerender trigger page to an unrelated page so that | ||
// prerendering is cancelled with the `Destroyed` final status. | ||
(async function(testRunner) { | ||
const {page, session, dp} = await testRunner.startBlank( | ||
`Test that prerender navigations report the final status`); | ||
await dp.Page.enable(); | ||
|
||
// Navigate to speculation rules Prerender Page. | ||
await page.navigate('resources/simple-prerender.html'); | ||
page.navigate('resources/empty.html?navigateaway'); | ||
const statusReport = await dp.Page.oncePrerenderAttemptCompleted(); | ||
testRunner.log(statusReport, '', ['initiatingFrameId', 'sessionId']); | ||
testRunner.completeTest(); | ||
}); |
11 changes: 11 additions & 0 deletions
11
...http/tests/inspector-protocol/prerender/report-prerender-cancellation-status-expected.txt
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,11 @@ | ||
Test that prerender navigations report the final status | ||
{ | ||
method : Page.prerenderAttemptCompleted | ||
params : { | ||
finalStatus : TriggerDestroyed | ||
initiatingFrameId : <string> | ||
prerenderingUrl : http://127.0.0.1:8000/inspector-protocol/prerender/resources/empty.html | ||
} | ||
sessionId : <string> | ||
} | ||
|