Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preloading WPT: run invalid-rules for prerender too #40667

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

The purpose of this CL is to create a common/ directory, alongside prefetch/ and prerender/, and do the work necessary to support writing tests that cover both technologies at once.

The script-supports-speculationrules.html test moves there, as it's trivial. The more interesting one is invalid-rules.https.html.

To move that and generalize it to run for both prefetch and prerender, we need a framework that allows us to test either technology. I built one on top of RemoteContextHelper, generalizing some of the utilities that were already in prerender/resources/utils.js. Note that I had several choices:

  • RemoteContextHelper
  • RemoteContext, like PrefetchAgent does
  • RemoteContext, like create_prerendered_page does
  • BroadcastChannel, like PrerenderChannel does
  • Server-side value storage, like prerender's readValueFromServer and friends
  • Server-side value storage, like prefetch's getPrefetchUrl and friends

We'll see how well my choice works in future CLs. In any case, to avoid adding yet another communications framework, I migrated prerender's RemoteContextHelper usage to this newer more-general framework (called "PreloadingRemoteContextHelper"), with minor specializations (in a "PrerenderingRemoteContextHelper" class). So at least the number of choices hasn't increased.

Bug: 1456579
Change-Id: Ibe90101faf351db7c787799d1583906c72ba9491
Reviewed-on: https://chromium-review.googlesource.com/4630875
WPT-Export-Revision: 2a3e270e8bf75b3b3cb471023d62abfc6932efae

The purpose of this CL is to create a common/ directory, alongside prefetch/ and prerender/, and do the work necessary to support writing tests that cover both technologies at once.

The script-supports-speculationrules.html test moves there, as it's trivial. The more interesting one is invalid-rules.https.html.

To move that and generalize it to run for both prefetch and prerender, we need a framework that allows us to test either technology. I built one on top of RemoteContextHelper, generalizing some of the utilities that were already in prerender/resources/utils.js. Note that I had several choices:

* RemoteContextHelper
* RemoteContext, like PrefetchAgent does
* RemoteContext, like create_prerendered_page does
* BroadcastChannel, like PrerenderChannel does
* Server-side value storage, like prerender's readValueFromServer and friends
* Server-side value storage, like prefetch's getPrefetchUrl and friends

We'll see how well my choice works in future CLs. In any case, to avoid adding yet another communications framework, I migrated prerender's RemoteContextHelper usage to this newer more-general framework (called "PreloadingRemoteContextHelper"), with minor specializations (in a "PrerenderingRemoteContextHelper" class). So at least the number of choices hasn't increased.

Bug: 1456579
Change-Id: Ibe90101faf351db7c787799d1583906c72ba9491
Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants