Skip to content

Conversation

srwei
Copy link
Contributor

@srwei srwei commented Oct 7, 2025

Spec: https://wicg.github.io/nav-speculation/prefetch.html#automated-testing
chromium-bidi implementation: GoogleChromeLabs/chromium-bidi@66d3585

Adding testdriver extension for the speculation module that is mainly to add the prefetch_status_updated event. No commands.

This event will replace the current timeout mechanism for speculation rules prefetch in the wpt prefetch corpus: https://github.com/web-platform-tests/wpt/tree/master/speculation-rules/prefetch

Follow up CLs will be raised to update the above tests to use the new event handling.

@sadym-chromium would you be able to help with rollover for chromium-bidi implementation?

@sadym-chromium
Copy link
Contributor

Please add wdspec tests as well. Actually, I'd prefer to have wdspec tests first in a separate PR, but it's up to you.

@srwei
Copy link
Contributor Author

srwei commented Oct 7, 2025

Please add wdspec tests as well. Actually, I'd prefer to have wdspec tests first in a separate PR, but it's up to you.

Oh I thought webdriver/tests/bidi/external/speculation/prefetch_status_updated/ tests were the wdpsec tests

@sadym-chromium
Copy link
Contributor

Please add wdspec tests as well. Actually, I'd prefer to have wdspec tests first in a separate PR, but it's up to you.

Oh I thought webdriver/tests/bidi/external/speculation/prefetch_status_updated/ tests were the wdpsec tests

My bad, I missed it. Sure.

@srwei srwei requested a review from sadym-chromium October 8, 2025 06:53
@srwei srwei requested a review from sadym-chromium October 8, 2025 19:28
Comment on lines 668 to 672
window.test_driver_internal.bidi.speculation.prefetch_status_updated.subscribe =
function(params) {
return subscribe(
{...params, events: ['speculation.prefetchStatusUpdated'], contexts: null});
};
Copy link
Contributor

Choose a reason for hiding this comment

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

hm. BTW why do you need the global subscription? The events are emitted to the specific browsing context, so you could safely target them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Initially was seeing how it would fit with the existing speculation rules prefetch wpt tests, but I was able to confirm we can utilize the new spawned window when subscribing to the event. I have changed it back to the normal browsing context subscription.

@srwei srwei requested a review from sadym-chromium October 10, 2025 17:59
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.

5 participants