mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Update web-platform-tests to revision d4f8820261cce3f9ee37353b6d76d247cb12a972
This commit is contained in:
parent
793b41299b
commit
7cb8ac2fe2
36 changed files with 278 additions and 279 deletions
|
@ -1,52 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>import() doesn't have any integrity metadata when initiated by compiled strings inside a classic script</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<meta http-equiv="Content-Security-Policy" content="require-sri-for script">
|
||||
|
||||
<script src="/resources/testharness.js" integrity="sha384-{{file_hash(sha384, resources/testharness.js)}}"></script>
|
||||
<script src="/resources/testharnessreport.js" integrity="sha384-{{file_hash(sha384, resources/testharnessreport.js)}}"></script>
|
||||
|
||||
<div id="dummy"></div>
|
||||
|
||||
<script>
|
||||
function createTestPromise() {
|
||||
return new Promise((resolve, reject) => {
|
||||
window.continueTest = resolve;
|
||||
window.errorTest = reject;
|
||||
});
|
||||
}
|
||||
|
||||
const dummyDiv = document.querySelector("#dummy");
|
||||
|
||||
const evaluators = {
|
||||
eval,
|
||||
setTimeout,
|
||||
"the Function constructor"(x) {
|
||||
Function(x)();
|
||||
},
|
||||
"reflected inline event handlers"(x) {
|
||||
dummyDiv.setAttribute("onclick", x);
|
||||
dummyDiv.onclick();
|
||||
},
|
||||
"inline event handlers triggered via UA code"(x) {
|
||||
dummyDiv.setAttribute("onclick", x);
|
||||
dummyDiv.click(); // different from .**on**click()
|
||||
}
|
||||
};
|
||||
|
||||
for (const [label, evaluator] of Object.entries(evaluators)) {
|
||||
promise_test(t => {
|
||||
t.add_cleanup(() => {
|
||||
dummyDiv.removeAttribute("onclick");
|
||||
delete window.evaluated_imports_a;
|
||||
});
|
||||
|
||||
const promise = createTestPromise();
|
||||
|
||||
evaluator(`import('../imports-a.js?label=${label}').then(window.continueTest, window.errorTest);`);
|
||||
|
||||
return promise_rejects(t, new TypeError(), promise);
|
||||
}, label + " should fail to import");
|
||||
};
|
||||
</script>
|
|
@ -1,52 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>import() doesn't have any integrity metadata when initiated by compiled strings inside a module script</title>
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<meta http-equiv="Content-Security-Policy" content="require-sri-for script">
|
||||
|
||||
<script src="/resources/testharness.js" integrity="sha384-{{file_hash(sha384, resources/testharness.js)}}"></script>
|
||||
<script src="/resources/testharnessreport.js" integrity="sha384-{{file_hash(sha384, resources/testharnessreport.js)}}"></script>
|
||||
|
||||
<div id="dummy"></div>
|
||||
|
||||
<script type="module">
|
||||
function createTestPromise() {
|
||||
return new Promise((resolve, reject) => {
|
||||
window.continueTest = resolve;
|
||||
window.errorTest = reject;
|
||||
});
|
||||
}
|
||||
|
||||
const dummyDiv = document.querySelector("#dummy");
|
||||
|
||||
const evaluators = {
|
||||
eval,
|
||||
setTimeout,
|
||||
"the Function constructor"(x) {
|
||||
Function(x)();
|
||||
},
|
||||
"reflected inline event handlers"(x) {
|
||||
dummyDiv.setAttribute("onclick", x);
|
||||
dummyDiv.onclick();
|
||||
},
|
||||
"inline event handlers triggered via UA code"(x) {
|
||||
dummyDiv.setAttribute("onclick", x);
|
||||
dummyDiv.click(); // different from .**on**click()
|
||||
}
|
||||
};
|
||||
|
||||
for (const [label, evaluator] of Object.entries(evaluators)) {
|
||||
promise_test(t => {
|
||||
t.add_cleanup(() => {
|
||||
dummyDiv.removeAttribute("onclick");
|
||||
delete window.evaluated_imports_a;
|
||||
});
|
||||
|
||||
const promise = createTestPromise();
|
||||
|
||||
evaluator(`import('../imports-a.js?label=${label}').then(window.continueTest, window.errorTest);`);
|
||||
|
||||
return promise_rejects(t, new TypeError(), promise);
|
||||
}, label + " should fail to import");
|
||||
};
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue