summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/workers/semantics/interface-objects
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/workers/semantics/interface-objects')
-rw-r--r--testing/web-platform/tests/workers/semantics/interface-objects/001.worker.js83
-rw-r--r--testing/web-platform/tests/workers/semantics/interface-objects/002.worker.js43
-rw-r--r--testing/web-platform/tests/workers/semantics/interface-objects/003.any.js84
-rw-r--r--testing/web-platform/tests/workers/semantics/interface-objects/004.any.js38
4 files changed, 248 insertions, 0 deletions
diff --git a/testing/web-platform/tests/workers/semantics/interface-objects/001.worker.js b/testing/web-platform/tests/workers/semantics/interface-objects/001.worker.js
new file mode 100644
index 0000000000..80fc597380
--- /dev/null
+++ b/testing/web-platform/tests/workers/semantics/interface-objects/001.worker.js
@@ -0,0 +1,83 @@
+importScripts("/resources/testharness.js");
+var expected = [
+ // https://html.spec.whatwg.org/
+ "WorkerGlobalScope",
+ "DedicatedWorkerGlobalScope",
+ "Worker",
+ "SharedWorker",
+ "MessagePort",
+ "MessageEvent",
+ "WorkerNavigator",
+ "MessageChannel",
+ "WorkerLocation",
+ "ImageData",
+ "ImageBitmap",
+ "CanvasGradient",
+ "CanvasPattern",
+ "CanvasPath",
+ "TextMetrics",
+ "Path2D",
+ "PromiseRejectionEvent",
+ "EventSource",
+ "BroadcastChannel",
+ // https://websockets.spec.whatwg.org/
+ "WebSocket",
+ "CloseEvent",
+ // https://tc39.github.io/ecma262/
+ "ArrayBuffer",
+ "Int8Array",
+ "Uint8Array",
+ "Uint8ClampedArray",
+ "Int16Array",
+ "Uint16Array",
+ "Int32Array",
+ "Uint32Array",
+ "Float32Array",
+ "Float64Array",
+ "DataView",
+ // https://xhr.spec.whatwg.org/
+ "XMLHttpRequestEventTarget",
+ "XMLHttpRequestUpload",
+ "XMLHttpRequest",
+ "ProgressEvent",
+ "FormData",
+ // https://url.spec.whatwg.org/
+ "URL",
+ "URLSearchParams",
+ // https://w3c.github.io/FileAPI/
+ "File",
+ "Blob",
+ "FileList",
+ "FileReader",
+ "FileReaderSync",
+ // https://dom.spec.whatwg.org/
+ "EventTarget",
+ "ErrorEvent",
+ "Event",
+ "CustomEvent",
+ // https://webidl.spec.whatwg.org/
+ "DOMException",
+ // https://streams.spec.whatwg.org/
+ "ReadableStream",
+ "WritableStream",
+ "ByteLengthQueuingStrategy",
+ "CountQueuingStrategy",
+ // http://w3c.github.io/IndexedDB/
+ "IDBRequest",
+ "IDBOpenDBRequest",
+ "IDBVersionChangeEvent",
+ "IDBFactory",
+ "IDBDatabase",
+ "IDBObjectStore",
+ "IDBIndex",
+ "IDBKeyRange",
+ "IDBCursor",
+ "IDBCursorWithValue",
+ "IDBTransaction",
+];
+for (var i = 0; i < expected.length; ++i) {
+ test(function () {
+ assert_own_property(self, expected[i]);
+ }, "The " + expected[i] + " interface object should be exposed.");
+}
+done();
diff --git a/testing/web-platform/tests/workers/semantics/interface-objects/002.worker.js b/testing/web-platform/tests/workers/semantics/interface-objects/002.worker.js
new file mode 100644
index 0000000000..d4f48354ed
--- /dev/null
+++ b/testing/web-platform/tests/workers/semantics/interface-objects/002.worker.js
@@ -0,0 +1,43 @@
+importScripts("/resources/testharness.js");
+var unexpected = [
+ // https://html.spec.whatwg.org/
+ "SharedWorkerGlobalScope",
+ "AbstractView",
+ "AbstractWorker",
+ "ApplicationCache",
+ "Location",
+ "Navigator",
+ "Audio",
+ "HTMLCanvasElement",
+ "Path",
+ "CanvasProxy",
+ "CanvasRenderingContext2D",
+ "DrawingStyle",
+ "BeforeUnloadEvent",
+ "PopStateEvent",
+ "HashChangeEvent",
+ "PageTransitionEvent",
+ // https://dom.spec.whatwg.org/
+ "DOMImplementation",
+ // http://w3c.github.io/IndexedDB/
+ "IDBEnvironment",
+ // https://www.w3.org/TR/2010/NOTE-webdatabase-20101118/
+ "Database",
+ // https://w3c.github.io/uievents/
+ "UIEvent",
+ "FocusEvent",
+ "MouseEvent",
+ "WheelEvent",
+ "InputEvent",
+ "KeyboardEvent",
+ "CompositionEvent",
+ // https://w3c.github.io/webvtt/
+ "VTTCue",
+ "VTTRegion",
+];
+for (var i = 0; i < unexpected.length; ++i) {
+ test(function () {
+ assert_false(unexpected[i] in self);
+ }, "The " + unexpected[i] + " interface object should not be exposed.");
+}
+done();
diff --git a/testing/web-platform/tests/workers/semantics/interface-objects/003.any.js b/testing/web-platform/tests/workers/semantics/interface-objects/003.any.js
new file mode 100644
index 0000000000..4d595bccce
--- /dev/null
+++ b/testing/web-platform/tests/workers/semantics/interface-objects/003.any.js
@@ -0,0 +1,84 @@
+// META: global=sharedworker
+
+var expected = [
+ // https://html.spec.whatwg.org/
+ "ApplicationCache",
+ "WorkerGlobalScope",
+ "SharedWorkerGlobalScope",
+ "Worker",
+ "SharedWorker",
+ "MessagePort",
+ "MessageEvent",
+ "WorkerNavigator",
+ "MessageChannel",
+ "WorkerLocation",
+ "ImageData",
+ "ImageBitmap",
+ "CanvasGradient",
+ "CanvasPattern",
+ "CanvasPath",
+ "Path2D",
+ "PromiseRejectionEvent",
+ "EventSource",
+ "BroadcastChannel",
+ // https://websockets.spec.whatwg.org/
+ "WebSocket",
+ "CloseEvent",
+ // https://tc39.github.io/ecma262/
+ "ArrayBuffer",
+ "Int8Array",
+ "Uint8Array",
+ "Uint8ClampedArray",
+ "Int16Array",
+ "Uint16Array",
+ "Int32Array",
+ "Uint32Array",
+ "Float32Array",
+ "Float64Array",
+ "DataView",
+ // https://xhr.spec.whatwg.org/
+ "XMLHttpRequestEventTarget",
+ "XMLHttpRequestUpload",
+ "XMLHttpRequest",
+ "ProgressEvent",
+ "FormData",
+ // https://url.spec.whatwg.org/
+ "URL",
+ "URLSearchParams",
+ // https://w3c.github.io/FileAPI/
+ "File",
+ "Blob",
+ "FileList",
+ "FileReader",
+ "FileReaderSync",
+ // https://dom.spec.whatwg.org/
+ "EventTarget",
+ "ErrorEvent",
+ "Event",
+ "CustomEvent",
+ // https://webidl.spec.whatwg.org/
+ "DOMException",
+ // https://streams.spec.whatwg.org/
+ "ReadableStream",
+ "WritableStream",
+ "ByteLengthQueuingStrategy",
+ "CountQueuingStrategy",
+ // http://w3c.github.io/IndexedDB/
+ "IDBRequest",
+ "IDBOpenDBRequest",
+ "IDBVersionChangeEvent",
+ "IDBFactory",
+ "IDBDatabase",
+ "IDBObjectStore",
+ "IDBIndex",
+ "IDBKeyRange",
+ "IDBCursor",
+ "IDBCursorWithValue",
+ "IDBTransaction",
+];
+
+for (var i = 0; i < expected.length; ++i) {
+ test(function() {
+ assert_true(expected[i] in self);
+ }, "The " + expected[i] + " interface object should be exposed");
+}
diff --git a/testing/web-platform/tests/workers/semantics/interface-objects/004.any.js b/testing/web-platform/tests/workers/semantics/interface-objects/004.any.js
new file mode 100644
index 0000000000..822379e2c9
--- /dev/null
+++ b/testing/web-platform/tests/workers/semantics/interface-objects/004.any.js
@@ -0,0 +1,38 @@
+// META: global=sharedworker
+
+var unexpected = [
+ // https://html.spec.whatwg.org/
+ "DedicatedWorkerGlobalScope",
+ "AbstractView",
+ "AbstractWorker",
+ "Location",
+ "Navigator",
+ "DOMImplementation",
+ "Audio",
+ "HTMLCanvasElement",
+ "Path",
+ "CanvasProxy",
+ "CanvasRenderingContext2D",
+ "DrawingStyle",
+ "PopStateEvent",
+ "HashChangeEvent",
+ "PageTransitionEvent",
+ // http://w3c.github.io/IndexedDB/
+ "IDBEnvironment",
+ // https://www.w3.org/TR/2010/NOTE-webdatabase-20101118/
+ "Database",
+ // https://w3c.github.io/uievents/
+ "UIEvent",
+ "FocusEvent",
+ "MouseEvent",
+ "WheelEvent",
+ "InputEvent",
+ "KeyboardEvent",
+ "CompositionEvent",
+];
+
+for (var i = 0; i < unexpected.length; ++i) {
+ test(function() {
+ assert_false(unexpected[i] in self);
+ }, "The " + unexpected[i] + " interface object should not be exposed");
+}