зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1608974 [wpt PR 21150] - Ignore unexpected MessageEvents, a=testonly
Automatic update from web-platform-tests Ignore unexpected MessageEvents (#21150) -- wpt-commits: 2aad06617dd072cca5a1bcc6d0fc624934c689a4 wpt-pr: 21150
This commit is contained in:
Родитель
67bca1df50
Коммит
bb52d2d7eb
|
@ -27,6 +27,9 @@ async_test((t) => {
|
|||
});
|
||||
|
||||
window.onmessage = t.step_func((e) => {
|
||||
// Ignore messages that are not part of the test.
|
||||
if (e.source != iframe.contentWindow) return;
|
||||
|
||||
i++;
|
||||
if (i === 1) {
|
||||
// 5. This is the first message we receive, from the first load.
|
||||
|
|
|
@ -22,11 +22,15 @@ async_test((t) => {
|
|||
iframe.contentWindow.postMessage('What is the result of new PaymentRequest(...)?', '*');
|
||||
});
|
||||
|
||||
window.onmessage = t.step_func_done((e) => {
|
||||
window.onmessage = t.step_func((e) => {
|
||||
// Ignore messages that are not part of the test.
|
||||
if (e.source != iframe.contentWindow) return;
|
||||
|
||||
assert_equals(e.data.message, 'Exception');
|
||||
assert_equals(4, e.data.details.length);
|
||||
// The last entry is the error stacktrace. Ignore it in comparison.
|
||||
assert_array_equals(e.data.details.slice(0, 3), [true /* ex instanceof DOMException */, DOMException.SECURITY_ERR, 'SecurityError']);
|
||||
t.done();
|
||||
});
|
||||
|
||||
document.body.appendChild(iframe);
|
||||
|
|
|
@ -20,6 +20,9 @@ async_test((t) => {
|
|||
});
|
||||
|
||||
window.onmessage = t.step_func((e) => {
|
||||
// Ignore messages that are not part of the test.
|
||||
if (e.source != iframe.contentWindow) return;
|
||||
|
||||
i++;
|
||||
if (i === 1) {
|
||||
assert_equals(e.data.message, 'Exception', 'before navigation');
|
||||
|
|
Загрузка…
Ссылка в новой задаче