mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Update web-platform-tests to revision 6c2d23b1b5e4dc00c944eedd16a11850e74a2d11
This commit is contained in:
parent
ad83faa745
commit
0114122fe0
140 changed files with 4328 additions and 1419 deletions
|
@ -0,0 +1,65 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>Async local storage API surface</title>
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<script type="module">
|
||||
import { storage, StorageArea } from "std:async-local-storage";
|
||||
import * as classAssert from "./helpers/class-assert.js";
|
||||
import { testWithArea } from "./helpers/als-tests.js";
|
||||
|
||||
test(() => {
|
||||
classAssert.isConstructor(StorageArea);
|
||||
classAssert.functionName(StorageArea, "StorageArea");
|
||||
classAssert.functionLength(StorageArea, 1);
|
||||
classAssert.hasClassPrototype(StorageArea);
|
||||
classAssert.hasPrototypeConstructorLink(StorageArea);
|
||||
classAssert.propertyKeys(StorageArea, ["length", "prototype", "name"], []);
|
||||
}, "StorageArea constructor");
|
||||
|
||||
test(() => {
|
||||
classAssert.propertyKeys(StorageArea.prototype, [
|
||||
"constructor", "set", "get", "has", "delete", "clear",
|
||||
"keys", "values", "entries", "backingStore"
|
||||
], []);
|
||||
|
||||
classAssert.methods(StorageArea.prototype, {
|
||||
set: 2,
|
||||
get: 1,
|
||||
has: 1,
|
||||
delete: 1,
|
||||
clear: 0,
|
||||
keys: 0,
|
||||
values: 0,
|
||||
entries: 0
|
||||
});
|
||||
|
||||
classAssert.accessors(StorageArea.prototype, {
|
||||
backingStore: ["get"]
|
||||
});
|
||||
}, "StorageArea.prototype methods and properties");
|
||||
|
||||
testWithArea(async area => {
|
||||
classAssert.propertyKeys(area, [], []);
|
||||
}, "Instances don't have any properties")
|
||||
|
||||
test(() => {
|
||||
assert_equals(storage instanceof StorageArea, true, "instanceof");
|
||||
assert_equals(storage.constructor, StorageArea, ".constructor property");
|
||||
assert_equals(Object.getPrototypeOf(storage), StorageArea.prototype, "[[Prototype]]");
|
||||
}, "Built-in storage export is a StorageArea");
|
||||
|
||||
testWithArea(async area => {
|
||||
assert_false(Symbol.toStringTag in StorageArea.prototype,
|
||||
"Symbol.toStringTag must not be in the prototype");
|
||||
assert_equals(Object.prototype.toString.call(StorageArea.prototype), "[object Object]",
|
||||
"The prototype must not be customized");
|
||||
|
||||
assert_equals(Object.prototype.toString.call(area), "[object Object]",
|
||||
"A constructed StorageArea must not be customized");
|
||||
assert_equals(Object.prototype.toString.call(storage), "[object Object]",
|
||||
"The default storage area must not be customized");
|
||||
}, "No custom toStringTag");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue