Automatic update from web-platform-tests
Export made from a WebKit repository (#45950)

Co-authored-by: Ziran Sun <zsun@igalia.com>
--

wpt-commits: 07358b5e59c46e0c60b6629c23d811f88738b993
wpt-pr: 45950
This commit is contained in:
ziransun 2024-04-30 16:05:19 +00:00 коммит произвёл moz-wptsync-bot
Родитель 05fe9c0ab6
Коммит 1c2029c1e6
2 изменённых файлов: 0 добавлений и 39 удалений

Просмотреть файл

@ -19,11 +19,6 @@
assert_equals(trustedTypes.getAttributeType("img", "madeup"), null);
}, "sanity check trustedTypes.getAttributeType.");
test(t => {
assert_true(!!trustedTypes.getTypeMapping());
}, "sanity check trustedTypes.getTypeMapping");
// getPropertyType tests adapted from w3c/trusted-types polyfill:
test(t => {
// returns the proper type for attribute-related properties
@ -71,24 +66,6 @@
assert_equals(trustedTypes.getAttributeType('img', 'bar'), null);
}, "getAttributeType tests adapted from w3c/trusted-types polyfill");
test(t=> {
const map = trustedTypes.getTypeMapping();
// Spot testing some values.
assert_equals(map["script"].attributes.src, "TrustedScriptURL");
assert_equals(map["*"].properties.innerHTML, "TrustedHTML");
assert_equals(map["foo"], undefined);
// getTypeMapping returns a 'clean' object, in case the return value has
// been modified.
map["*"].attributes["foo"] = "bar";
assert_equals(trustedTypes.getTypeMapping()["*"].attributes["foo"], undefined);
;
// Unknown namespaces:
assert_equals(trustedTypes.getTypeMapping("http://foo/bar"), null);
}, "getTypeMapping tests adapted from w3c/trusted-types polyfill");
// Test case handling for both attributes and properties.
for (let attr of ["srcDoc", "SRCDOC", "srcdoc"]) {
for (let elem of ["iframe", "IFRAME", "iFrAmE"]) {

Просмотреть файл

@ -33,22 +33,6 @@
let properties = ['madeup', 'id', "onerror", "onclick"];
const types = [null, "TrustedHTML", "TrustedScript", "TrustedScriptURL"];
// We'll wrap construction of the elements/properties list in a test, mainly
// so we'll get decent error messages when it might fail.
test(t => {
// Collect all element and property names from getTypeMapping().
const map = trustedTypes.getTypeMapping();
for (let elem in map) {
elements.push(elem);
properties = properties.concat(Object.keys(map[elem].properties));
}
// Remove "*" entries and de-duplicate properties.
elements = elements.filter(s => !s.includes("*"));
properties = properties.filter(s => !s.includes("*"));
properties = Array.from(new Set(properties));
}, "Prepare parameters for generic test series below.");
// Iterate one test for each combination of element, property, and sink type.
const target = document.getElementById("target");
for (elem of elements) {