-
Notifications
You must be signed in to change notification settings - Fork 72
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
RFC 90: [testdriver] Primitives for cross-context messaging #90
Conversation
Add send()/poll()/recv() functions that can be used to pass arbitary messages to other testdriver contexts, to help with test scenarios requiring multiple origins
solved by the COOP tests with | ||
[dispatcher.js](https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/html/cross-origin-opener-policy/resources/dispatcher.js). This | ||
provides functions `send(uuid, message)` and `receive(uuid, | ||
maybe_timeout)` which are used to send and recieve messages between |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "receive"
(×2)
test_driver.poll(); | ||
test_driver.recv(timeout=null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't those specify the uuid of the queue your are receiving messages?
It is highly important to be able to listen to different queues. You might want to control multiple context or run multiple subtest in parallel. Having multiple queues is very important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way it's set up at the moment, you can only listen for messages sent to your queue. But each message has a src
property that tells you where it came from. So you don't supply a UUID here because it's implied that it's the one for the current context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can this be used to run several subtest in parallel?
Having a single queue per context is a strong limitation. As is, I don't believe this solution could replace code from:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably you could have some code like:
let awatingContexts = new Map();
fn messageFromContext(uuid) {
new Promise(resolve => awaitingContexts.set(uuid, resolve));
};
async function dispatchMessages() {
while (true) {
let msg = await test_driver.recv();
let waiter = waitingContexts.get(msg.src);
if (waiter) {
waiter(msg.data)
}
}
};
dispatchMessages();
And then a test would do something like
// Assume ctx is a uuid
await test_driver.send(msg , ctx);
let response = await messageFromContext(ctx);
So I don't think it's impossible, but I agree there's some additional overhead from the fact that the message queues are per context. But it feels like the per-context model is closer to the model for other testdriver commands. Do you think that adding some additional built-in API surface for this kind of message dispatch would be enough to make the solution work for you, or do you have another suggested approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it has to belong to testdriver? I am not sure to understand the benefits. Maybe if I knew, they could potentially offset the drawback mentioned above?
I liked a lot hiroshige@ patches. Keep the message queue API very simple. Every context can pop/push to any arbitrary queue. Messages are simple string.
Then, once you have the capability to communicate, you can build second layers object like the Executor/ExecutorTarget, providing remote code execution, and returning result or errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot... Most COEP:credentials are built this way:
- Setup: Create multiple context with different policies.
- Subtest in parallel: execute/test code in the contexts from (1).
So there are multiple message queues to communicate in each pair (driver, helper) contexts.
With the current solution, it is limited to one queue per receiver context. As you said, we can simulate more by dispatching per sender context. So at most we have one queue per (receiver, sender) pair, but this is not enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't have to of course. But the reason for proposing this is to end up with a unified way of working with remote contexts, rather than having the concept of a remote context with a bunch of functionality like invoking user gestures, or running script, and a semi-decoupled model of messaging where the message queue ids are kind of coupled to context ids (because we give contexts an id through the URL), but anyone with the id has full read/write access. The model here seems closer to other things like postMessage
where anyone (more or less) can write but only the target can read.
I suppose another solution to the multi-test problem above would be introducing the ability to create non-context-bound message queues like the MessagePort
DOM API. Then a test would create a context, and send a message to it containing the channel id to reply on. The test could await a message on that specific channel rather than doing dispatch on the src on the context-global channel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am thinking, what about:
- Make the UUID of "receive" optional. By default it will listen to the current context predefined UUID.
- For other use case, like all mine, we can specify an arbitrary UUID.
test_driver.recv(timeout=null) | ||
``` | ||
|
||
`test_driver.send(mesage, context)` Sends `message` to the context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "message"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: I like specifying the target context/uuid before the messages.:
test_driver.send(context, `
Hello from a different context
`);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the other testdriver commands take the context as the final argument, which is why I went with that order, even though I agree that this is more natural.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK. That's unfortunate, but not a big deal.
be overridden with a different transport if required, but there is no | ||
downstream work required for implementors as part of this feature. | ||
|
||
The use of the stash does present some promises; to avoid races if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Promises? Or challenges?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It promises some challenges :p (but yes, good catch).
Co-authored-by: Ms2ger <[email protected]>
browsing contexts other than the test context. This problem has been | ||
solved by the COOP tests with | ||
[dispatcher.js](https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/html/cross-origin-opener-policy/resources/dispatcher.js). This | ||
provides functions `send(uuid, message)` and `receive(uuid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does the UUID come from?
You said we can't generate them at will, but there will be instead one per context predefined.
Do we have an UUID for every type of context? (document, sharedworker, dedicatedworker, serviceworker).
How do you convey the uuid from one context to the other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess they come from the uuid params of the URL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #88
So, to be clear I'm not wedded to the proposed setup. But I'm also skeptical of making the API surface a multi-producer, multi-consumer queue in which we expose a way for anyone with the token to both read and write. The problem with that design is that I fear it will lead to hard-to-debug flakiness where for timing reasons one context reads something that was supposed to be read by a different context, and the whole implicit protocol breaks down. Constraining who can read from a queue, even if multiple people can write to it, seems to encourage more robust designs. That said, I agree that the proposal doesn't address the use case of multiple tests running concurrently, and all wanting to communicate back to the test context without needing complex dispatch. One way to extend the proposal to support that might be to allow something like let uuid = "{{uuid}}"';
window.open(`child.html?uuid=${uuid}`, "_blank", "noopener");
let remote = new test_driver.RemoteContext(uuid); // This only implements send()
let [receiver, sender] = new test_driver.Channel()
await remote.send(sender);
// Listen for a message from the remote end
await reciever.recv() and in child.html: let test_channel = test_driver.recv();
try {
let result = await do_test();
test_channel.send({status: OK, result: result});
} catch(e) {
test_channel.send({status: "ERROR", message: e.toString()});
} So One thing that might be useful here is to look at use cases. For example:
And maybe some higher level ones:
Does that sound like a reasonable start? What am I missing? |
I think we both understand each other. The additional Alternatively, you can also make COOP/COEP tests not to use this proposal, that's also a possibility. This proposal is good on its own, even if we don't manage to use it for the existing tests.
I would argue that with multiple queues, this precisely avoid having multiple readers reading the same queue. |
OK, so I'm approximately ready to replace this PR with one that proposes a channel-based model. I've updated the branch at web-platform-tests/wpt#29803 with a WebSockets-backed channel-based proposal and converted a bfcache test and a COOP test to the new model. The COOP test in particular is very similar in the new model, but I think there are a few quality of life improvements:
The bfcache test required some additional work, mostly because haing ongoing requests / open sockets prevents pages being added to the bfcache. This required a mechanism to stop new messages being read on the channels before navigation (so that the client websocket doesn't buffer a message, only for it to be lost after navigation). Obviously this is easier with a polling approach since the user code is in control of when we poll for new messages. If it turns out that this finegrained control is necessary, we could use the same server-side message storage approach but add a client API in which the client has to explictly If people think this is a good option to pursue I'll write up a full RFC for the new proposal, but some more technical details to help evaluate what's going on:
Anyway the general pattern is that in the main test file you have something like <title>Demo of executeScript</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/channel.sub.js"></script>
<script>
promise_test(async t => {
let page = new TestDriverRemoteContext();
window.open(`child.html?uuid=${page.uuid}`, "_blank", "noopener");
assert_equals(await page.executeScript(() => document.body.textContent), "PASS");
})
</script> And in <!-- This is currently needed for reading the uuid, but could maybe be removed -->
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/channel.sub.js"></script>
<p>PASS</p>
<script>
// Listen for messages
ctx_channel();
</script> |
I took a quick look. I like the API a lot and how it looks on the existing COOP test above. I would be curious to see how |
…e tests + helpers This PR adds `RemoteContext.execute_script()` and its documentation in `/common/dispatcher/`. This is based on with `execute_script()`-related parts of RFCs 88/89/91: - web-platform-tests/rfcs#88 - web-platform-tests/rfcs#89 - web-platform-tests/rfcs#91 and addresses comments: - web-platform-tests/rfcs#86 (comment) - #28950 (comment) plus additional clarifications around navigation, minus `testdriver` integration (so this PR is implemented using `send()`/`receive()` in `/common/dispatcher/`), minus web-platform-tests/rfcs#90 (so this PR leaves `send()`/`receive()` as-is). This PR also adds back-forward cache WPTs (basic event firing tests), as well as BFCache-specific helpers, based on `RemoteContext.execute_script()`. Design doc: https://docs.google.com/document/d/1p3G-qNYMTHf5LU9hykaXcYtJ0k3wYOwcdVKGeps6EkU/edit?usp=sharing Bug: 1107415 Change-Id: I034f9f5376dc3f9f32ca0b936dbd06e458c9160b
…e tests + helpers This PR adds `RemoteContext.execute_script()` and its documentation in `/common/dispatcher/`. This is based on with `execute_script()`-related parts of RFCs 88/89/91: - web-platform-tests/rfcs#88 - web-platform-tests/rfcs#89 - web-platform-tests/rfcs#91 and addresses comments: - web-platform-tests/rfcs#86 (comment) - #28950 (comment) plus additional clarifications around navigation, minus `testdriver` integration (so this PR is implemented using `send()`/`receive()` in `/common/dispatcher/`), minus web-platform-tests/rfcs#90 (so this PR leaves `send()`/`receive()` as-is). This PR also adds back-forward cache WPTs (basic event firing tests), as well as BFCache-specific helpers, based on `RemoteContext.execute_script()`. Design doc: https://docs.google.com/document/d/1p3G-qNYMTHf5LU9hykaXcYtJ0k3wYOwcdVKGeps6EkU/edit?usp=sharing Bug: 1107415 Change-Id: I034f9f5376dc3f9f32ca0b936dbd06e458c9160b
I'm withdrawing this in favour of #98 which has an alternate approach to the same problem, not based on polling. |
…e tests + helpers This PR adds `RemoteContext.execute_script()` and its documentation in `/common/dispatcher/`. This is based on with `execute_script()`-related parts of RFCs 88/89/91: - web-platform-tests/rfcs#88 - web-platform-tests/rfcs#89 - web-platform-tests/rfcs#91 and addresses comments: - web-platform-tests/rfcs#86 (comment) - #28950 (comment) plus additional clarifications around navigation, minus `testdriver` integration (so this PR is implemented using `send()`/`receive()` in `/common/dispatcher/`), minus web-platform-tests/rfcs#90 (so this PR leaves `send()`/`receive()` as-is). This PR also adds back-forward cache WPTs (basic event firing tests), as well as BFCache-specific helpers, based on `RemoteContext.execute_script()`. Design doc: https://docs.google.com/document/d/1p3G-qNYMTHf5LU9hykaXcYtJ0k3wYOwcdVKGeps6EkU/edit?usp=sharing Bug: 1107415 Change-Id: I034f9f5376dc3f9f32ca0b936dbd06e458c9160b
…e tests + helpers This PR adds `RemoteContext.execute_script()` and its documentation in `/common/dispatcher/`. This is based on with `execute_script()`-related parts of RFCs 88/89/91: - web-platform-tests/rfcs#88 - web-platform-tests/rfcs#89 - web-platform-tests/rfcs#91 and addresses comments: - web-platform-tests/rfcs#86 (comment) - #28950 (comment) plus additional clarifications around navigation, minus `testdriver` integration (so this PR is implemented using `send()`/`receive()` in `/common/dispatcher/`), minus web-platform-tests/rfcs#90 (so this PR leaves `send()`/`receive()` as-is). This PR also adds back-forward cache WPTs (basic event firing tests), as well as BFCache-specific helpers, based on `RemoteContext.execute_script()`. Design doc: https://docs.google.com/document/d/1p3G-qNYMTHf5LU9hykaXcYtJ0k3wYOwcdVKGeps6EkU/edit?usp=sharing Bug: 1107415 Change-Id: I034f9f5376dc3f9f32ca0b936dbd06e458c9160b
…e tests + helpers This PR adds `RemoteContext.execute_script()` and its documentation in `/common/dispatcher/`. This is based on with `execute_script()`-related parts of RFCs 88/89/91: - web-platform-tests/rfcs#88 - web-platform-tests/rfcs#89 - web-platform-tests/rfcs#91 and addresses comments: - web-platform-tests/rfcs#86 (comment) - #28950 (comment) plus additional clarifications around navigation, minus `testdriver` integration (so this PR is implemented using `send()`/`receive()` in `/common/dispatcher/`), minus web-platform-tests/rfcs#90 (so this PR leaves `send()`/`receive()` as-is). This PR also adds back-forward cache WPTs (basic event firing tests), as well as BFCache-specific helpers, based on `RemoteContext.execute_script()`. Design doc: https://docs.google.com/document/d/1p3G-qNYMTHf5LU9hykaXcYtJ0k3wYOwcdVKGeps6EkU/edit?usp=sharing Bug: 1107415 Change-Id: I034f9f5376dc3f9f32ca0b936dbd06e458c9160b
…e tests + helpers This PR adds `RemoteContext.execute_script()` and its documentation in `/common/dispatcher/`. This is based on with `execute_script()`-related parts of RFCs 88/89/91: - web-platform-tests/rfcs#88 - web-platform-tests/rfcs#89 - web-platform-tests/rfcs#91 and addresses comments: - web-platform-tests/rfcs#86 (comment) - #28950 (comment) plus additional clarifications around navigation, minus `testdriver` integration (so this PR is implemented using `send()`/`receive()` in `/common/dispatcher/`), minus web-platform-tests/rfcs#90 (so this PR leaves `send()`/`receive()` as-is). This PR also adds back-forward cache WPTs (basic event firing tests), as well as BFCache-specific helpers, based on `RemoteContext.execute_script()`. Design doc: https://docs.google.com/document/d/1p3G-qNYMTHf5LU9hykaXcYtJ0k3wYOwcdVKGeps6EkU/edit?usp=sharing Bug: 1107415 Change-Id: I034f9f5376dc3f9f32ca0b936dbd06e458c9160b
…e tests + helpers This PR adds `RemoteContext.execute_script()` and its documentation in `/common/dispatcher/`. This is based on with `execute_script()`-related parts of RFCs 88/89/91: - web-platform-tests/rfcs#88 - web-platform-tests/rfcs#89 - web-platform-tests/rfcs#91 and addresses comments: - web-platform-tests/rfcs#86 (comment) - #28950 (comment) plus additional clarifications around navigation, minus `testdriver` integration (so this PR is implemented using `send()`/`receive()` in `/common/dispatcher/`), minus web-platform-tests/rfcs#90 (so this PR leaves `send()`/`receive()` as-is). This PR also adds back-forward cache WPTs (basic event firing tests), as well as BFCache-specific helpers, based on `RemoteContext.execute_script()`. Design doc: https://docs.google.com/document/d/1p3G-qNYMTHf5LU9hykaXcYtJ0k3wYOwcdVKGeps6EkU/edit?usp=sharing Bug: 1107415 Change-Id: I034f9f5376dc3f9f32ca0b936dbd06e458c9160b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2885636 Reviewed-by: Rakina Zata Amni <[email protected]> Reviewed-by: Arthur Sonzogni <[email protected]> Commit-Queue: Hiroshige Hayashizaki <[email protected]> Cr-Commit-Position: refs/heads/main@{#927566}
…e tests + helpers This PR adds `RemoteContext.execute_script()` and its documentation in `/common/dispatcher/`. This is based on with `execute_script()`-related parts of RFCs 88/89/91: - web-platform-tests/rfcs#88 - web-platform-tests/rfcs#89 - web-platform-tests/rfcs#91 and addresses comments: - web-platform-tests/rfcs#86 (comment) - web-platform-tests/wpt#28950 (comment) plus additional clarifications around navigation, minus `testdriver` integration (so this PR is implemented using `send()`/`receive()` in `/common/dispatcher/`), minus web-platform-tests/rfcs#90 (so this PR leaves `send()`/`receive()` as-is). This PR also adds back-forward cache WPTs (basic event firing tests), as well as BFCache-specific helpers, based on `RemoteContext.execute_script()`. Design doc: https://docs.google.com/document/d/1p3G-qNYMTHf5LU9hykaXcYtJ0k3wYOwcdVKGeps6EkU/edit?usp=sharing Bug: 1107415 Change-Id: I034f9f5376dc3f9f32ca0b936dbd06e458c9160b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2885636 Reviewed-by: Rakina Zata Amni <[email protected]> Reviewed-by: Arthur Sonzogni <[email protected]> Commit-Queue: Hiroshige Hayashizaki <[email protected]> Cr-Commit-Position: refs/heads/main@{#927566}
…e tests + helpers (#28950) This PR adds `RemoteContext.execute_script()` and its documentation in `/common/dispatcher/`. This is based on with `execute_script()`-related parts of RFCs 88/89/91: - web-platform-tests/rfcs#88 - web-platform-tests/rfcs#89 - web-platform-tests/rfcs#91 and addresses comments: - web-platform-tests/rfcs#86 (comment) - #28950 (comment) plus additional clarifications around navigation, minus `testdriver` integration (so this PR is implemented using `send()`/`receive()` in `/common/dispatcher/`), minus web-platform-tests/rfcs#90 (so this PR leaves `send()`/`receive()` as-is). This PR also adds back-forward cache WPTs (basic event firing tests), as well as BFCache-specific helpers, based on `RemoteContext.execute_script()`. Design doc: https://docs.google.com/document/d/1p3G-qNYMTHf5LU9hykaXcYtJ0k3wYOwcdVKGeps6EkU/edit?usp=sharing Bug: 1107415 Change-Id: I034f9f5376dc3f9f32ca0b936dbd06e458c9160b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2885636 Reviewed-by: Rakina Zata Amni <[email protected]> Reviewed-by: Arthur Sonzogni <[email protected]> Commit-Queue: Hiroshige Hayashizaki <[email protected]> Cr-Commit-Position: refs/heads/main@{#927566} Co-authored-by: Hiroshige Hayashizaki <[email protected]>
…cript()` and add basic BFCache tests + helpers, a=testonly Automatic update from web-platform-tests [WPT] Introduce `RemoteContext.execute_script()` and add basic BFCache tests + helpers (#28950) This PR adds `RemoteContext.execute_script()` and its documentation in `/common/dispatcher/`. This is based on with `execute_script()`-related parts of RFCs 88/89/91: - web-platform-tests/rfcs#88 - web-platform-tests/rfcs#89 - web-platform-tests/rfcs#91 and addresses comments: - web-platform-tests/rfcs#86 (comment) - web-platform-tests/wpt#28950 (comment) plus additional clarifications around navigation, minus `testdriver` integration (so this PR is implemented using `send()`/`receive()` in `/common/dispatcher/`), minus web-platform-tests/rfcs#90 (so this PR leaves `send()`/`receive()` as-is). This PR also adds back-forward cache WPTs (basic event firing tests), as well as BFCache-specific helpers, based on `RemoteContext.execute_script()`. Design doc: https://docs.google.com/document/d/1p3G-qNYMTHf5LU9hykaXcYtJ0k3wYOwcdVKGeps6EkU/edit?usp=sharing Bug: 1107415 Change-Id: I034f9f5376dc3f9f32ca0b936dbd06e458c9160b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2885636 Reviewed-by: Rakina Zata Amni <[email protected]> Reviewed-by: Arthur Sonzogni <[email protected]> Commit-Queue: Hiroshige Hayashizaki <[email protected]> Cr-Commit-Position: refs/heads/main@{#927566} Co-authored-by: Hiroshige Hayashizaki <[email protected]> -- wpt-commits: 2947a57c382cd0886906a8cbb6bad702d70a7976 wpt-pr: 28950
…cript()` and add basic BFCache tests + helpers, a=testonly Automatic update from web-platform-tests [WPT] Introduce `RemoteContext.execute_script()` and add basic BFCache tests + helpers (#28950) This PR adds `RemoteContext.execute_script()` and its documentation in `/common/dispatcher/`. This is based on with `execute_script()`-related parts of RFCs 88/89/91: - web-platform-tests/rfcs#88 - web-platform-tests/rfcs#89 - web-platform-tests/rfcs#91 and addresses comments: - web-platform-tests/rfcs#86 (comment) - web-platform-tests/wpt#28950 (comment) plus additional clarifications around navigation, minus `testdriver` integration (so this PR is implemented using `send()`/`receive()` in `/common/dispatcher/`), minus web-platform-tests/rfcs#90 (so this PR leaves `send()`/`receive()` as-is). This PR also adds back-forward cache WPTs (basic event firing tests), as well as BFCache-specific helpers, based on `RemoteContext.execute_script()`. Design doc: https://docs.google.com/document/d/1p3G-qNYMTHf5LU9hykaXcYtJ0k3wYOwcdVKGeps6EkU/edit?usp=sharing Bug: 1107415 Change-Id: I034f9f5376dc3f9f32ca0b936dbd06e458c9160b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2885636 Reviewed-by: Rakina Zata Amni <[email protected]> Reviewed-by: Arthur Sonzogni <[email protected]> Commit-Queue: Hiroshige Hayashizaki <[email protected]> Cr-Commit-Position: refs/heads/main@{#927566} Co-authored-by: Hiroshige Hayashizaki <[email protected]> -- wpt-commits: 2947a57c382cd0886906a8cbb6bad702d70a7976 wpt-pr: 28950
…e tests + helpers (web-platform-tests#28950) This PR adds `RemoteContext.execute_script()` and its documentation in `/common/dispatcher/`. This is based on with `execute_script()`-related parts of RFCs 88/89/91: - web-platform-tests/rfcs#88 - web-platform-tests/rfcs#89 - web-platform-tests/rfcs#91 and addresses comments: - web-platform-tests/rfcs#86 (comment) - web-platform-tests#28950 (comment) plus additional clarifications around navigation, minus `testdriver` integration (so this PR is implemented using `send()`/`receive()` in `/common/dispatcher/`), minus web-platform-tests/rfcs#90 (so this PR leaves `send()`/`receive()` as-is). This PR also adds back-forward cache WPTs (basic event firing tests), as well as BFCache-specific helpers, based on `RemoteContext.execute_script()`. Design doc: https://docs.google.com/document/d/1p3G-qNYMTHf5LU9hykaXcYtJ0k3wYOwcdVKGeps6EkU/edit?usp=sharing Bug: 1107415 Change-Id: I034f9f5376dc3f9f32ca0b936dbd06e458c9160b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2885636 Reviewed-by: Rakina Zata Amni <[email protected]> Reviewed-by: Arthur Sonzogni <[email protected]> Commit-Queue: Hiroshige Hayashizaki <[email protected]> Cr-Commit-Position: refs/heads/main@{#927566} Co-authored-by: Hiroshige Hayashizaki <[email protected]>
…e tests + helpers This PR adds `RemoteContext.execute_script()` and its documentation in `/common/dispatcher/`. This is based on with `execute_script()`-related parts of RFCs 88/89/91: - web-platform-tests/rfcs#88 - web-platform-tests/rfcs#89 - web-platform-tests/rfcs#91 and addresses comments: - web-platform-tests/rfcs#86 (comment) - web-platform-tests/wpt#28950 (comment) plus additional clarifications around navigation, minus `testdriver` integration (so this PR is implemented using `send()`/`receive()` in `/common/dispatcher/`), minus web-platform-tests/rfcs#90 (so this PR leaves `send()`/`receive()` as-is). This PR also adds back-forward cache WPTs (basic event firing tests), as well as BFCache-specific helpers, based on `RemoteContext.execute_script()`. Design doc: https://docs.google.com/document/d/1p3G-qNYMTHf5LU9hykaXcYtJ0k3wYOwcdVKGeps6EkU/edit?usp=sharing Bug: 1107415 Change-Id: I034f9f5376dc3f9f32ca0b936dbd06e458c9160b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2885636 Reviewed-by: Rakina Zata Amni <[email protected]> Reviewed-by: Arthur Sonzogni <[email protected]> Commit-Queue: Hiroshige Hayashizaki <[email protected]> Cr-Commit-Position: refs/heads/main@{#927566} NOKEYCHECK=True GitOrigin-RevId: 66dbd4c686fec8d07c493c6283ab906c57752e39
Add send()/poll()/recv() functions that can be used to pass arbitary messages to
other testdriver contexts, to help with test scenarios requiring multiple origins