Commit fff55603 authored by Yuki Shiino's avatar Yuki Shiino Committed by Commit Bot

wpt: Create EventListener-addEventListener test.

This is a follow-up of https://crrev.com/c/1226893 and moves
eventlistener-with-remote-context.html to WPT.

The test content is conceptually the same.

Bug: 883643, 886588
Change-Id: I7c941e162a076d9cbb7abc1d259ff98742a14517
Reviewed-on: https://chromium-review.googlesource.com/1235774Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592756}
parent 30be226c
async_test(function(t) {
let crossOriginFrame = document.createElement('iframe');
crossOriginFrame.src = 'https://{{hosts[alt][]}}/common/blank.html';
document.body.appendChild(crossOriginFrame);
crossOriginFrame.addEventListener('load', t.step_func_done(function() {
let crossOriginWindow = crossOriginFrame.contentWindow;
window.addEventListener('click', crossOriginWindow);
}));
}, "EventListener.addEventListener doesn't throw when a cross origin object is passed in.");
This is a testharness.js-based test.
FAIL EventListener.addEventListener doesn't throw when a cross origin object is passed in. Failed to execute 'addEventListener' on 'EventTarget': The callback provided as parameter 2 is a cross origin object.
Harness: the test ran to completion.
<!doctype html>
<meta charset="utf-8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<iframe src="http://localhost:8080/resources/dummy.html" id="likely_remote_frame"></iframe>
<script>
let likelyRemoteFrame = document.getElementById('likely_remote_frame');
likelyRemoteFrame.onload = function() {
test(function() {
let likelyRemoteWindow = likelyRemoteFrame.contentWindow;
try {
// |likelyRemoteWindow| is likely to be a remote window and to not have
// an associated v8::Context. The code below must not crash even in such
// a case. Site-per-process makes this test easier to fail.
window.addEventListener('click', likelyRemoteWindow);
} catch (e) {}
}, "EventListener doesn't crash with a remote object.");
}; // likelyRemoteFrame.onload = function()
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment