Commit d077f984 authored by Chromium WPT Sync's avatar Chromium WPT Sync Committed by Commit Bot

Import wpt@e7b232f535cf1ebd0026bd66d1ff3bf096744862

Using wpt-import in Chromium bb12635c.
With Chromium commits locally applied on WPT:
d4ca0e6e "Add missing worklet referrer tests"


Note to sheriffs: This CL imports external tests and adds
expectations for those tests; if this CL is large and causes
a few new failures, please fix the failures by adding new
lines to TestExpectations rather than reverting. See:
https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md

NOAUTOREVERT=true
TBR=robertma

No-Export: true
Change-Id: I39145b8ae93db46efcd2c36be7455c21bf2e047f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1823623Reviewed-by: default avatarWPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: WPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#699593}
parent 6d7fbe33
......@@ -561,6 +561,32 @@ addPromiseTest(function() {
});
}, "Resolving a promise with a cross-origin location should work (cross-site).");
addTest(function(win) {
var desc = Object.getOwnPropertyDescriptor(window, "onmouseenter");
var f = () => {};
// Check that it has [LenientThis] behavior
assert_equals(desc.get.call({}), undefined, "getter should return undefined");
desc.set.call({}, f); // Should not throw.
// Check that we can apply it to a same-origin window.
assert_equals(desc.get.call(B), null, "Should be able to read the value");
desc.set.call(B, f);
assert_equals(desc.get.call(B), f, "Value should have updated");
// And reset it for our next test
desc.set.call(B, null);
assert_equals(desc.get.call(B), null, "Should have been reset");
// Check that applying it to a cross-origin window throws instead of doing
// the [LenientThis] behavior.
assert_throws("SecurityError", () => {
desc.get.call(win);
}, "Should throw when getting cross-origin");
assert_throws("SecurityError", () => {
desc.set.call(win, f);
}, "Should throw when setting cross-origin");
}, "LenientThis behavior");
// We do a fresh load of the subframes for each test to minimize side-effects.
// It would be nice to reload ourselves as well, but we can't do that without
// disrupting the test harness.
......
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