summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/wpt.ts26
-rw-r--r--tools/wpt/expectation.json60
2 files changed, 81 insertions, 5 deletions
diff --git a/tools/wpt.ts b/tools/wpt.ts
index e7da43e64..13f8b6467 100755
--- a/tools/wpt.ts
+++ b/tools/wpt.ts
@@ -34,6 +34,10 @@ import {
red,
yellow,
} from "https://deno.land/std@0.84.0/fmt/colors.ts";
+import {
+ writeAll,
+ writeAllSync,
+} from "https://deno.land/std@0.95.0/io/util.ts";
import { saveExpectation } from "./wpt/utils.ts";
const command = Deno.args[0];
@@ -104,7 +108,7 @@ async function setup() {
throw err;
}
});
- await Deno.writeAll(
+ await writeAll(
file,
new TextEncoder().encode(
"\n\n# Configured for Web Platform Tests (Deno)\n" + entries,
@@ -150,7 +154,7 @@ async function run() {
rest.length == 0 ? undefined : rest,
expectation,
);
- assertAllExpectationsHaveTests(expectation, tests);
+ assertAllExpectationsHaveTests(expectation, tests, rest);
console.log(`Going to run ${tests.length} test files.`);
const results = await runWithTestUtil(false, async () => {
@@ -182,6 +186,7 @@ async function run() {
function assertAllExpectationsHaveTests(
expectation: Expectation,
testsToRun: TestToRun[],
+ filter?: string[],
): void {
const tests = new Set(testsToRun.map((t) => t.path));
const missingTests: string[] = [];
@@ -189,6 +194,12 @@ function assertAllExpectationsHaveTests(
function walk(parentExpectation: Expectation, parent: string) {
for (const key in parentExpectation) {
const path = `${parent}/${key}`;
+ if (
+ filter &&
+ !filter.find((filter) => path.substring(1).startsWith(filter))
+ ) {
+ continue;
+ }
const expectation = parentExpectation[key];
if (typeof expectation == "boolean" || Array.isArray(expectation)) {
if (!tests.has(path)) {
@@ -422,7 +433,7 @@ function analyzeTestResult(
function reportVariation(result: TestResult, expectation: boolean | string[]) {
if (result.status !== 0) {
console.log(`test stderr:`);
- Deno.writeAllSync(Deno.stdout, new TextEncoder().encode(result.stderr));
+ writeAllSync(Deno.stdout, new TextEncoder().encode(result.stderr));
const expectFail = expectation === false;
console.log(
@@ -508,7 +519,7 @@ function createReportTestCase(expectation: boolean | string[]) {
break;
}
- console.log(simpleMessage);
+ writeAllSync(Deno.stdout, new TextEncoder().encode(simpleMessage + "\n"));
};
}
@@ -536,7 +547,12 @@ function discoverTestsToRun(
) {
if (!path) continue;
const url = new URL(path, "http://web-platform.test:8000");
- if (!url.pathname.endsWith(".any.html")) continue;
+ if (
+ !url.pathname.endsWith(".any.html") &&
+ !url.pathname.endsWith(".window.html")
+ ) {
+ continue;
+ }
const finalPath = url.pathname + url.search;
const split = finalPath.split("/");
diff --git a/tools/wpt/expectation.json b/tools/wpt/expectation.json
index 983f73e53..afdc0cb1f 100644
--- a/tools/wpt/expectation.json
+++ b/tools/wpt/expectation.json
@@ -1064,6 +1064,66 @@
}
}
},
+ "webstorage": {
+ "defineProperty.window.html": true,
+ "set.window.html": true,
+ "storage_enumerate.window.html": true,
+ "storage_in.window.html": true,
+ "event_constructor.window.html": false,
+ "event_initstorageevent.window.html": false,
+ "missing_arguments.window.html": true,
+ "storage_builtins.window.html": true,
+ "storage_clear.window.html": true,
+ "storage_functions_not_overwritten.window.html": true,
+ "storage_getitem.window.html": true,
+ "storage_indexing.window.html": true,
+ "storage_key.window.html": true,
+ "storage_key_empty_string.window.html": true,
+ "storage_length.window.html": true,
+ "storage_local_setitem_quotaexceedederr.window.html": true,
+ "storage_local_window_open.window.html": false,
+ "storage_removeitem.window.html": true,
+ "storage_session_setitem_quotaexceedederr.window.html": true,
+ "storage_session_window_noopener.window.html": false,
+ "storage_session_window_open.window.html": false,
+ "storage_set_value_enumerate.window.html": true,
+ "storage_setitem.window.html": [
+ "localStorage[\"\ud800\"]",
+ "localStorage[] = \"\ud800\"",
+ "localStorage[\"\udbff\"]",
+ "localStorage[] = \"\udbff\"",
+ "localStorage[\"\udc00\"]",
+ "localStorage[] = \"\udc00\"",
+ "localStorage[\"\udfff\"]",
+ "localStorage[] = \"\udfff\"",
+ "localStorage[\"\\ufffd\"]",
+ "localStorage[] = \"\\ufffd\"",
+ "localStorage[\"\ud83ca\"]",
+ "localStorage[] = \"\ud83ca\"",
+ "localStorage[\"a\udf4d\"]",
+ "localStorage[] = \"a\udf4d\"",
+ "sessionStorage[\"\ud800\"]",
+ "sessionStorage[] = \"\ud800\"",
+ "sessionStorage[\"\udbff\"]",
+ "sessionStorage[] = \"\udbff\"",
+ "sessionStorage[\"\udc00\"]",
+ "sessionStorage[] = \"\udc00\"",
+ "sessionStorage[\"\udfff\"]",
+ "sessionStorage[] = \"\udfff\"",
+ "sessionStorage[\"\\ufffd\"]",
+ "sessionStorage[] = \"\\ufffd\"",
+ "sessionStorage[\"\ud83ca\"]",
+ "sessionStorage[] = \"\ud83ca\"",
+ "sessionStorage[\"a\udf4d\"]",
+ "sessionStorage[] = \"a\udf4d\""
+ ],
+ "storage_string_conversion.window.html": true,
+ "storage_supported_property_names.window.html": true,
+ "symbol-props.window.html": [
+ "localStorage: defineProperty not configurable",
+ "sessionStorage: defineProperty not configurable"
+ ]
+ },
"xhr": {
"formdata": {
"append.any.html": true,