Tests: Import some structuredClone-related WPT tests

This commit is contained in:
Kenneth Myhra
2025-05-04 13:33:31 +02:00
committed by Shannon Booth
parent 5eb4c3dc2f
commit 306c7b8211
Notes: github-actions[bot] 2025-05-08 14:13:16 +00:00
3 changed files with 189 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
<!doctype html>
<meta charset=utf-8>
<title>structuredClone() tests</title>
<script>
self.GLOBAL = {
isWindow: function() { return true; },
isWorker: function() { return false; },
isShadowRealm: function() { return false; },
};
</script>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../../common/sab.js"></script>
<script src="../../../html/webappapis/structured-clone/structured-clone-battery-of-tests.js"></script>
<script src="../../../html/webappapis/structured-clone/structured-clone-battery-of-tests-with-transferables.js"></script>
<script src="../../../html/webappapis/structured-clone/structured-clone-battery-of-tests-harness.js"></script>
<div id=log></div>
<script src="../../../html/webappapis/structured-clone/structured-clone.any.js"></script>

View File

@@ -0,0 +1,14 @@
// META: title=structuredClone() tests
// META: script=/common/sab.js
// META: script=/html/webappapis/structured-clone/structured-clone-battery-of-tests.js
// META: script=/html/webappapis/structured-clone/structured-clone-battery-of-tests-with-transferables.js
// META: script=/html/webappapis/structured-clone/structured-clone-battery-of-tests-harness.js
runStructuredCloneBatteryOfTests({
structuredClone: (obj, transfer) => {
return new Promise(resolve => {
resolve(self.structuredClone(obj, { transfer }));
});
},
hasDocument: typeof document !== "undefined",
});