-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prerender: Expose activation result to DevTools
This CL introduces activated status in PrerenderHost to DevTools, and adds a related inspector protocol test. Bug: 1249776 Change-Id: Iaa9eebc1d107271e53194d1fc49033a5b858bfe3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3479000 Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org> Reviewed-by: Andrey Kosyakov <caseq@chromium.org> Commit-Queue: Huanpo Lin <robertlin@chromium.org> Cr-Commit-Position: refs/heads/main@{#987333}
- Loading branch information
Robert Lin
authored and
Chromium LUCI CQ
committed
Mar 31, 2022
1 parent
4d11843
commit 034eff3
Showing
11 changed files
with
78 additions
and
1 deletion.
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
11 changes: 11 additions & 0 deletions
11
..._tests/http/tests/inspector-protocol/prerender/report-prerender-final-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 : Activated | ||
initiatingFrameId : <string> | ||
prerenderingUrl : http://127.0.0.1:8000/inspector-protocol/prerender/resources/empty.html | ||
} | ||
sessionId : <string> | ||
} | ||
|
13 changes: 13 additions & 0 deletions
13
.../blink/web_tests/http/tests/inspector-protocol/prerender/report-prerender-final-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,13 @@ | ||
(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'); | ||
session.evaluate(`document.getElementById('link').click()`); | ||
const statusReport = await dp.Page.oncePrerenderAttemptCompleted(); | ||
testRunner.log(statusReport, '', ['initiatingFrameId', 'sessionId']); | ||
|
||
testRunner.completeTest(); | ||
}); |
Empty file.
17 changes: 17 additions & 0 deletions
17
...y/blink/web_tests/http/tests/inspector-protocol/prerender/resources/simple-prerender.html
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,17 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script type="speculationrules"> | ||
{ | ||
"prerender":[ | ||
{"source": "list", | ||
"urls": ["empty.html"]} | ||
] | ||
} | ||
</script> | ||
<title>Prerender Test</title> | ||
<!-- Make sure there is no zoom so that simulated clicks hit the right spot --> | ||
<meta name="viewport" content="width=device-width,minimum-scale=1"> | ||
</head> | ||
<body><a href="empty.html" id="link">link</a></body> | ||
</html> |