diff options
author | Andreu Botella <abb@randomunok.com> | 2021-08-16 14:29:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-16 14:29:54 +0200 |
commit | ddbb7b83f2c483e354f425dfb70dbab494b05ea5 (patch) | |
tree | fa84f5607395773284e331fe32f2b86b59f02a5d /tools | |
parent | d1d2388d7f1a09fd2469b356f00b6b361269a0b7 (diff) |
feat(runtime): support classic workers for internal testing (#11338)
This commit implements classic workers, but only when the `--enable-testing-features-do-not-use` flag is provided. This change is not user facing. Classic workers are used extensively in WPT tests. The classic workers do not support loading from disk, and do not support TypeScript.
Co-authored-by: Luca Casonato <hello@lcas.dev>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/wpt.ts | 3 | ||||
-rw-r--r-- | tools/wpt/expectation.json | 197 | ||||
-rw-r--r-- | tools/wpt/runner.ts | 1 |
3 files changed, 199 insertions, 2 deletions
diff --git a/tools/wpt.ts b/tools/wpt.ts index a3999a425..4ebe875c9 100755 --- a/tools/wpt.ts +++ b/tools/wpt.ts @@ -647,7 +647,8 @@ function discoverTestsToRun( const url = new URL(path, "http://web-platform.test:8000"); if ( !url.pathname.endsWith(".any.html") && - !url.pathname.endsWith(".window.html") + !url.pathname.endsWith(".window.html") && + !url.pathname.endsWith(".worker.html") ) { continue; } diff --git a/tools/wpt/expectation.json b/tools/wpt/expectation.json index 0618d6a39..c38b1ad3e 100644 --- a/tools/wpt/expectation.json +++ b/tools/wpt/expectation.json @@ -16611,5 +16611,200 @@ "constructor.any.html?wss": true } } + }, + "workers": { + "Worker-base64.any.worker.html": true, + "Worker-call.worker.html": true, + "Worker-constructor-proto.any.worker.html": true, + "Worker-custom-event.any.worker.html": true, + "Worker-formdata.any.worker.html": [ + "Test FormData interface object" + ], + "Worker-location.sub.any.worker.html": [ + "Test WorkerLocation properties." + ], + "Worker-replace-event-handler.any.worker.html": true, + "Worker-replace-global-constructor.any.worker.html": true, + "Worker-replace-self.any.worker.html": true, + "WorkerGlobalScope_requestAnimationFrame.tentative.worker.html": [ + "WorkerGlobalScope_requestAnimationFrame" + ], + "WorkerLocation-origin.sub.window.html": [ + "workerLocation.origin must use ASCII code points" + ], + "WorkerNavigator-hardware-concurrency.any.worker.html": [ + "Test worker navigator hardware concurrency." + ], + "WorkerNavigator.any.worker.html": [ + "Testing Navigator properties on workers." + ], + "constructors": { + "Worker": { + "DedicatedWorkerGlobalScope-members.worker.html": [ + "existence of onoffline", + "existence of ononline" + ], + "expected-self-properties.worker.html": [ + "existence of XMLHttpRequest", + "existence of EventSource", + "existence of SharedWorker" + ], + "unexpected-self-properties.worker.html": true + } + }, + "dedicated-worker-from-blob-url.window.html": [ + "Creating a dedicated worker from a blob URL works immediately before revoking." + ], + "dedicated-worker-in-data-url-context.window.html": [ + "Create a dedicated worker in a data url frame", + "Create a dedicated worker in a data url dedicated worker", + "Create a data url dedicated worker in a data url frame" + ], + "examples": { + "general.any.worker.html": true, + "general.worker.html": true + }, + "importscripts_mime.any.worker.html": [ + "importScripts() requires scripty MIME types: text/ecmascript is allowed." + ], + "interfaces": { + "DedicatedWorkerGlobalScope": { + "EventTarget.worker.html": true, + "onmessage.worker.html": [ + "Setting onmessage to 1", + "Setting onmessage to 1 (again)" + ], + "postMessage": { + "return-value.worker.html": true + } + }, + "WorkerGlobalScope": { + "location": { + "returns-same-object.any.worker.html": true + }, + "self.any.worker.html": true + }, + "WorkerUtils": { + "importScripts": { + "001.worker.html": true, + "002.worker.html": true, + "catch.sub.any.worker.html": [ + "Cross-origin syntax error", + "Cross-origin throw", + "Redirect-to-cross-origin syntax error", + "Redirect-to-Cross-origin throw" + ], + "report-error-cross-origin.sub.any.worker.html": false, + "report-error-redirect-to-cross-origin.sub.any.worker.html": false, + "report-error-same-origin.sub.any.worker.html": false, + "report-error-setTimeout-cross-origin.sub.any.worker.html": false, + "report-error-setTimeout-redirect-to-cross-origin.sub.any.worker.html": false, + "report-error-setTimeout-same-origin.sub.any.worker.html": false + } + } + }, + "modules": { + "dedicated-worker-import-blob-url.any.html": true, + "dedicated-worker-import-blob-url.any.worker.html": true, + "dedicated-worker-import-data-url.any.html": true, + "dedicated-worker-import-data-url.any.worker.html": true, + "dedicated-worker-import.any.html": true, + "dedicated-worker-import.any.worker.html": true, + "shared-worker-import-blob-url.window.html": [ + "Static import.", + "Static import (cross-origin).", + "Static import (redirect).", + "Nested static import.", + "Static import and then dynamic import.", + "Dynamic import.", + "Nested dynamic import.", + "Dynamic import and then static import.", + "eval(import())." + ], + "shared-worker-import-data-url.window.html": [ + "Static import.", + "Static import (cross-origin).", + "Static import (redirect).", + "Nested static import.", + "Static import and then dynamic import.", + "Dynamic import.", + "Nested dynamic import.", + "Dynamic import and then static import.", + "eval(import())." + ], + "shared-worker-import.window.html": [ + "Static import.", + "Static import (cross-origin).", + "Static import (redirect).", + "Nested static import.", + "Static import and then dynamic import.", + "Dynamic import.", + "Nested dynamic import.", + "Dynamic import and then static import.", + "eval(import())." + ] + }, + "nested_worker.worker.html": true, + "nested_worker_close_self.worker.html": true, + "nested_worker_importScripts.worker.html": true, + "nested_worker_sync_xhr.worker.html": [ + "Nested worker that issues a sync XHR" + ], + "semantics": { + "encodings": { + "004.worker.html": true + }, + "interface-objects": { + "001.worker.html": [ + "The SharedWorker interface object should be exposed.", + "The ImageData interface object should be exposed.", + "The ImageBitmap interface object should be exposed.", + "The CanvasGradient interface object should be exposed.", + "The CanvasPattern interface object should be exposed.", + "The CanvasPath interface object should be exposed.", + "The TextMetrics interface object should be exposed.", + "The Path2D interface object should be exposed.", + "The PromiseRejectionEvent interface object should be exposed.", + "The EventSource interface object should be exposed.", + "The XMLHttpRequestEventTarget interface object should be exposed.", + "The XMLHttpRequestUpload interface object should be exposed.", + "The XMLHttpRequest interface object should be exposed.", + "The FileList interface object should be exposed.", + "The FileReaderSync interface object should be exposed.", + "The IDBRequest interface object should be exposed.", + "The IDBOpenDBRequest interface object should be exposed.", + "The IDBVersionChangeEvent interface object should be exposed.", + "The IDBFactory interface object should be exposed.", + "The IDBDatabase interface object should be exposed.", + "The IDBObjectStore interface object should be exposed.", + "The IDBIndex interface object should be exposed.", + "The IDBKeyRange interface object should be exposed.", + "The IDBCursor interface object should be exposed.", + "The IDBCursorWithValue interface object should be exposed.", + "The IDBTransaction interface object should be exposed." + ], + "002.worker.html": true + }, + "multiple-workers": { + "exposure.any.html": [ + "SharedWorker exposure" + ], + "exposure.any.worker.html": true + } + }, + "shared-worker-from-blob-url.window.html": [ + "Creating a shared worker from a blob URL works.", + "Creating a shared worker from a blob URL works immediately before revoking.", + "Connecting to a shared worker on a revoked blob URL works." + ], + "shared-worker-in-data-url-context.window.html": [ + "Create a shared worker in a data url frame", + "Create a data url shared worker in a data url frame" + ], + "worker-performance.worker.html": [ + "Resource timing seems to work in workers", + "performance.clearResourceTimings in workers", + "performance.setResourceTimingBufferSize in workers" + ] } -}
\ No newline at end of file +} diff --git a/tools/wpt/runner.ts b/tools/wpt/runner.ts index 07edcec68..27b94da1f 100644 --- a/tools/wpt/runner.ts +++ b/tools/wpt/runner.ts @@ -94,6 +94,7 @@ export async function runSingleTest( "run", "-A", "--unstable", + "--enable-testing-features-do-not-use", "--location", url.toString(), "--cert", |