-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[testdriver.js] Internal testdriver messages exposed to onmessage
handlers
#48326
Comments
Fix two issues causing the test to fail spuriously upstream when run with WebDriver [0]: a. testdriver.js uses regular `postMessage()`/`onmessage` to communicate testdriver commands between the parent and child frames. Unfortunately, until [1] is resolved, tests that use `onmessage` need to be aware of this implementation detail and ignore the internal messages. b. The parent needs `testdriver(-vendor).js` too so that testdriver commands from the child frame are correctly pumped out [2] to the harness, which will send the WebDriver command. Content shell currently passes the test because its testdriver is backed by internal JS bindings that directly hook into the browser. [0]: https://wpt.fyi/results/serial/requestPort/sandboxed_iframe.https.window.html?run_id=5088854063448064 [1]: web-platform-tests/wpt#48326 [2]: https://github.com/web-platform-tests/wpt/blob/8ae822f0/tools/wptrunner/wptrunner/testdriver-extra.js#L22 Bug: None Change-Id: Iddb130f92c1877e389a46cb89a35c21bbfd1b625 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5888384 Reviewed-by: Jack Hsieh <chengweih@chromium.org> Commit-Queue: Jonathan Lee <jonathanjlee@google.com> Cr-Commit-Position: refs/heads/main@{#1359563}
Fix two issues causing the test to fail spuriously upstream when run with WebDriver [0]: a. testdriver.js uses regular `postMessage()`/`onmessage` to communicate testdriver commands between the parent and child frames. Unfortunately, until [1] is resolved, tests that use `onmessage` need to be aware of this implementation detail and ignore the internal messages. b. The parent needs `testdriver(-vendor).js` too so that testdriver commands from the child frame are correctly pumped out [2] to the harness, which will send the WebDriver command. Content shell currently passes the test because its testdriver is backed by internal JS bindings that directly hook into the browser. [0]: https://wpt.fyi/results/serial/requestPort/sandboxed_iframe.https.window.html?run_id=5088854063448064 [1]: #48326 [2]: https://github.com/web-platform-tests/wpt/blob/8ae822f0/tools/wptrunner/wptrunner/testdriver-extra.js#L22 Bug: None Change-Id: Iddb130f92c1877e389a46cb89a35c21bbfd1b625 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5888384 Reviewed-by: Jack Hsieh <chengweih@chromium.org> Commit-Queue: Jonathan Lee <jonathanjlee@google.com> Cr-Commit-Position: refs/heads/main@{#1359563}
Fix two issues causing the test to fail spuriously upstream when run with WebDriver [0]: a. testdriver.js uses regular `postMessage()`/`onmessage` to communicate testdriver commands between the parent and child frames. Unfortunately, until [1] is resolved, tests that use `onmessage` need to be aware of this implementation detail and ignore the internal messages. b. The parent needs `testdriver(-vendor).js` too so that testdriver commands from the child frame are correctly pumped out [2] to the harness, which will send the WebDriver command. Content shell currently passes the test because its testdriver is backed by internal JS bindings that directly hook into the browser. [0]: https://wpt.fyi/results/serial/requestPort/sandboxed_iframe.https.window.html?run_id=5088854063448064 [1]: #48326 [2]: https://github.com/web-platform-tests/wpt/blob/8ae822f0/tools/wptrunner/wptrunner/testdriver-extra.js#L22 Bug: None Change-Id: Iddb130f92c1877e389a46cb89a35c21bbfd1b625 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5888384 Reviewed-by: Jack Hsieh <chengweih@chromium.org> Commit-Queue: Jonathan Lee <jonathanjlee@google.com> Cr-Commit-Position: refs/heads/main@{#1359563}
…dboxed_iframe.https.window.js`, a=testonly Automatic update from web-platform-tests [wpt] Ignore testdriver messages in `sandboxed_iframe.https.window.js` Fix two issues causing the test to fail spuriously upstream when run with WebDriver [0]: a. testdriver.js uses regular `postMessage()`/`onmessage` to communicate testdriver commands between the parent and child frames. Unfortunately, until [1] is resolved, tests that use `onmessage` need to be aware of this implementation detail and ignore the internal messages. b. The parent needs `testdriver(-vendor).js` too so that testdriver commands from the child frame are correctly pumped out [2] to the harness, which will send the WebDriver command. Content shell currently passes the test because its testdriver is backed by internal JS bindings that directly hook into the browser. [0]: https://wpt.fyi/results/serial/requestPort/sandboxed_iframe.https.window.html?run_id=5088854063448064 [1]: web-platform-tests/wpt#48326 [2]: https://github.com/web-platform-tests/wpt/blob/8ae822f0/tools/wptrunner/wptrunner/testdriver-extra.js#L22 Bug: None Change-Id: Iddb130f92c1877e389a46cb89a35c21bbfd1b625 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5888384 Reviewed-by: Jack Hsieh <chengweih@chromium.org> Commit-Queue: Jonathan Lee <jonathanjlee@google.com> Cr-Commit-Position: refs/heads/main@{#1359563} -- wpt-commits: 50433bccd99443bf1c59165a0c9a5b88a3c5c3ae wpt-pr: 48328
…dboxed_iframe.https.window.js`, a=testonly Automatic update from web-platform-tests [wpt] Ignore testdriver messages in `sandboxed_iframe.https.window.js` Fix two issues causing the test to fail spuriously upstream when run with WebDriver [0]: a. testdriver.js uses regular `postMessage()`/`onmessage` to communicate testdriver commands between the parent and child frames. Unfortunately, until [1] is resolved, tests that use `onmessage` need to be aware of this implementation detail and ignore the internal messages. b. The parent needs `testdriver(-vendor).js` too so that testdriver commands from the child frame are correctly pumped out [2] to the harness, which will send the WebDriver command. Content shell currently passes the test because its testdriver is backed by internal JS bindings that directly hook into the browser. [0]: https://wpt.fyi/results/serial/requestPort/sandboxed_iframe.https.window.html?run_id=5088854063448064 [1]: web-platform-tests/wpt#48326 [2]: https://github.com/web-platform-tests/wpt/blob/8ae822f0/tools/wptrunner/wptrunner/testdriver-extra.js#L22 Bug: None Change-Id: Iddb130f92c1877e389a46cb89a35c21bbfd1b625 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5888384 Reviewed-by: Jack Hsieh <chengweih@chromium.org> Commit-Queue: Jonathan Lee <jonathanjlee@google.com> Cr-Commit-Position: refs/heads/main@{#1359563} -- wpt-commits: 50433bccd99443bf1c59165a0c9a5b88a3c5c3ae wpt-pr: 48328
…dboxed_iframe.https.window.js`, a=testonly Automatic update from web-platform-tests [wpt] Ignore testdriver messages in `sandboxed_iframe.https.window.js` Fix two issues causing the test to fail spuriously upstream when run with WebDriver [0]: a. testdriver.js uses regular `postMessage()`/`onmessage` to communicate testdriver commands between the parent and child frames. Unfortunately, until [1] is resolved, tests that use `onmessage` need to be aware of this implementation detail and ignore the internal messages. b. The parent needs `testdriver(-vendor).js` too so that testdriver commands from the child frame are correctly pumped out [2] to the harness, which will send the WebDriver command. Content shell currently passes the test because its testdriver is backed by internal JS bindings that directly hook into the browser. [0]: https://wpt.fyi/results/serial/requestPort/sandboxed_iframe.https.window.html?run_id=5088854063448064 [1]: web-platform-tests/wpt#48326 [2]: https://github.com/web-platform-tests/wpt/blob/8ae822f0/tools/wptrunner/wptrunner/testdriver-extra.js#L22 Bug: None Change-Id: Iddb130f92c1877e389a46cb89a35c21bbfd1b625 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5888384 Reviewed-by: Jack Hsieh <chengweihchromium.org> Commit-Queue: Jonathan Lee <jonathanjleegoogle.com> Cr-Commit-Position: refs/heads/main{#1359563} -- wpt-commits: 50433bccd99443bf1c59165a0c9a5b88a3c5c3ae wpt-pr: 48328 UltraBlame original commit: cd1e3e547399549474aa7278bee1e2065b165d43
…dboxed_iframe.https.window.js`, a=testonly Automatic update from web-platform-tests [wpt] Ignore testdriver messages in `sandboxed_iframe.https.window.js` Fix two issues causing the test to fail spuriously upstream when run with WebDriver [0]: a. testdriver.js uses regular `postMessage()`/`onmessage` to communicate testdriver commands between the parent and child frames. Unfortunately, until [1] is resolved, tests that use `onmessage` need to be aware of this implementation detail and ignore the internal messages. b. The parent needs `testdriver(-vendor).js` too so that testdriver commands from the child frame are correctly pumped out [2] to the harness, which will send the WebDriver command. Content shell currently passes the test because its testdriver is backed by internal JS bindings that directly hook into the browser. [0]: https://wpt.fyi/results/serial/requestPort/sandboxed_iframe.https.window.html?run_id=5088854063448064 [1]: web-platform-tests/wpt#48326 [2]: https://github.com/web-platform-tests/wpt/blob/8ae822f0/tools/wptrunner/wptrunner/testdriver-extra.js#L22 Bug: None Change-Id: Iddb130f92c1877e389a46cb89a35c21bbfd1b625 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5888384 Reviewed-by: Jack Hsieh <chengweihchromium.org> Commit-Queue: Jonathan Lee <jonathanjleegoogle.com> Cr-Commit-Position: refs/heads/main{#1359563} -- wpt-commits: 50433bccd99443bf1c59165a0c9a5b88a3c5c3ae wpt-pr: 48328 UltraBlame original commit: cd1e3e547399549474aa7278bee1e2065b165d43
…dboxed_iframe.https.window.js`, a=testonly Automatic update from web-platform-tests [wpt] Ignore testdriver messages in `sandboxed_iframe.https.window.js` Fix two issues causing the test to fail spuriously upstream when run with WebDriver [0]: a. testdriver.js uses regular `postMessage()`/`onmessage` to communicate testdriver commands between the parent and child frames. Unfortunately, until [1] is resolved, tests that use `onmessage` need to be aware of this implementation detail and ignore the internal messages. b. The parent needs `testdriver(-vendor).js` too so that testdriver commands from the child frame are correctly pumped out [2] to the harness, which will send the WebDriver command. Content shell currently passes the test because its testdriver is backed by internal JS bindings that directly hook into the browser. [0]: https://wpt.fyi/results/serial/requestPort/sandboxed_iframe.https.window.html?run_id=5088854063448064 [1]: web-platform-tests/wpt#48326 [2]: https://github.com/web-platform-tests/wpt/blob/8ae822f0/tools/wptrunner/wptrunner/testdriver-extra.js#L22 Bug: None Change-Id: Iddb130f92c1877e389a46cb89a35c21bbfd1b625 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5888384 Reviewed-by: Jack Hsieh <chengweihchromium.org> Commit-Queue: Jonathan Lee <jonathanjleegoogle.com> Cr-Commit-Position: refs/heads/main{#1359563} -- wpt-commits: 50433bccd99443bf1c59165a0c9a5b88a3c5c3ae wpt-pr: 48328 UltraBlame original commit: cd1e3e547399549474aa7278bee1e2065b165d43
Looks like this also affects
Edit: Never mind, looks like an easy fix with |
…dboxed_iframe.https.window.js`, a=testonly Automatic update from web-platform-tests [wpt] Ignore testdriver messages in `sandboxed_iframe.https.window.js` Fix two issues causing the test to fail spuriously upstream when run with WebDriver [0]: a. testdriver.js uses regular `postMessage()`/`onmessage` to communicate testdriver commands between the parent and child frames. Unfortunately, until [1] is resolved, tests that use `onmessage` need to be aware of this implementation detail and ignore the internal messages. b. The parent needs `testdriver(-vendor).js` too so that testdriver commands from the child frame are correctly pumped out [2] to the harness, which will send the WebDriver command. Content shell currently passes the test because its testdriver is backed by internal JS bindings that directly hook into the browser. [0]: https://wpt.fyi/results/serial/requestPort/sandboxed_iframe.https.window.html?run_id=5088854063448064 [1]: web-platform-tests/wpt#48326 [2]: https://github.com/web-platform-tests/wpt/blob/8ae822f0/tools/wptrunner/wptrunner/testdriver-extra.js#L22 Bug: None Change-Id: Iddb130f92c1877e389a46cb89a35c21bbfd1b625 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5888384 Reviewed-by: Jack Hsieh <chengweih@chromium.org> Commit-Queue: Jonathan Lee <jonathanjlee@google.com> Cr-Commit-Position: refs/heads/main@{#1359563} -- wpt-commits: 50433bccd99443bf1c59165a0c9a5b88a3c5c3ae wpt-pr: 48328
No longer necessary after fixing web-platform-tests#48326.
No longer necessary after fixing #48326.
In cross-origin cases, the WebDriver-based testdriver.js implementation uses
postMessage({type: "testdriver-{command,complete}", ...})
to communicate with the wptrunner harness. However, these internal messages are exposed to allmessage
event handlers on the receiving end. This can trip up test-registered handlers that don't expect extra incoming messages, such as:wpt/serial/requestPort/sandboxed_iframe.https.window.js
Lines 14 to 17 in 8ae822f
... which fails because the handler only expects strings
postMessage()
ed from its child frame.Maybe these messages should be filtered out in a high-level
step_func
-like API, so that every test doesn't need its own ad-hoc check (which also leaks testdriver implementation details)?CC @jgraham @WeizhongX @cbiesinger (who fixed many such cases for
fedcm/
)The text was updated successfully, but these errors were encountered: