Tests various ways to call cancelWatchAvailability()
-
-
-
-
+
+
+
+ Promise.all([
+ v.remote.watchAvailability(() => {}),
+ v.remote.watchAvailability(() => {}),
+ ]).then(
+ t.step_func((ids) =>
+ v.remote.cancelWatchAvailability().then(
+ t.step_func(() =>
+ v.remote.cancelWatchAvailability(ids[0]).then(
+ t.unreached_func(),
+ t.step_func((e) => {
+ assert_equals(e.name, "NotFoundError");
+ v.remote.cancelWatchAvailability(ids[1]).then(
+ t.unreached_func(),
+ t.step_func_done((e) =>
+ assert_equals(e.name, "NotFoundError")
+ )
+ );
+ })
+ )
+ ),
+ t.unreached_func()
+ )
+ ),
+ t.unreached_func()
+ );
+ }, "Test that calling cancelWatchAvailability() without an id removes all the callbacks.");
+
diff --git a/remote-playback/disable-remote-playback-cancel-watch-availability-throws.html b/remote-playback/disable-remote-playback-cancel-watch-availability-throws.html
index bdd35d8101bdf0..4783f64504ac84 100644
--- a/remote-playback/disable-remote-playback-cancel-watch-availability-throws.html
+++ b/remote-playback/disable-remote-playback-cancel-watch-availability-throws.html
@@ -1,29 +1,34 @@
-Test that calling cancelWatchAvailability() when disableRemotePlayback attribute is set throws an exception
-
-
-
-
+
+
+
+ }, t.unreached_func());
+ }, "Test that calling cancelWatchAvailability() when disableRemotePlayback attribute is set throws an exception.");
+
diff --git a/remote-playback/disable-remote-playback-prompt-throws.html b/remote-playback/disable-remote-playback-prompt-throws.html
index 18333842b6a180..cd44045eb9343d 100644
--- a/remote-playback/disable-remote-playback-prompt-throws.html
+++ b/remote-playback/disable-remote-playback-prompt-throws.html
@@ -1,16 +1,19 @@
-Test that calling prompt() when disableRemotePlayback attribute is set throws an exception
-
-
-
-
+
+
+
+ return promise_rejects_dom(t, "InvalidStateError", v.remote.prompt());
+ }, "Test that calling prompt() when disableRemotePlayback attribute is set throws an exception.");
+
diff --git a/remote-playback/disable-remote-playback-watch-availability-throws.html b/remote-playback/disable-remote-playback-watch-availability-throws.html
index b671d9f944da47..e594a49ef2a5eb 100644
--- a/remote-playback/disable-remote-playback-watch-availability-throws.html
+++ b/remote-playback/disable-remote-playback-watch-availability-throws.html
@@ -1,17 +1,23 @@
-Test that calling watchAvailability() when disableRemotePlayback attribute is set throws an exception
-
-
-
-
+
+
+
+ return promise_rejects_dom(
+ t,
+ "InvalidStateError",
+ v.remote.watchAvailability(() => {})
+ );
+ }, "Test that calling watchAvailability() when disableRemotePlayback attribute is set throws an exception.");
+
diff --git a/remote-playback/event-handlers-manual.html b/remote-playback/event-handlers-manual.html
new file mode 100644
index 00000000000000..b7c32db88eebe6
--- /dev/null
+++ b/remote-playback/event-handlers-manual.html
@@ -0,0 +1,60 @@
+
+
+ Test that all event handlers are called.
+
+
+
+
+
+
+
Please make sure a device for remote playback is available.
+
+
+
+
+
+ Click the button below to prompt for a remote playback device and select
+ one! After connecting to the device, please click again and disconnect
+ from device.
+
+
+
+
+
+
+
+
diff --git a/remote-playback/prepare-device.js b/remote-playback/prepare-device.js
new file mode 100644
index 00000000000000..825768f2db62b9
--- /dev/null
+++ b/remote-playback/prepare-device.js
@@ -0,0 +1,12 @@
+var startButton = document.getElementById("start-button");
+startButton.onclick = function () {
+ document.getElementById("prep").style.display = "none";
+ document.getElementById("pick-device").style.display = "block";
+};
+var promptPrepButton = document.getElementById("prompt-button-prep");
+promptPrepButton.onclick = function () {
+ v.remote
+ .prompt()
+ .then(() => {})
+ .catch(() => {});
+};
diff --git a/remote-playback/prompt-and-cancel-selection-manual.html b/remote-playback/prompt-and-cancel-selection-manual.html
new file mode 100644
index 00000000000000..eb93df83abfbfb
--- /dev/null
+++ b/remote-playback/prompt-and-cancel-selection-manual.html
@@ -0,0 +1,37 @@
+
+
+
+ Test that promise is rejected when user cancels device selection.
+
+
+
+
+
+
+
+ Click the button below to prompt for a remote playback device and
+ cancel the selection of a device!
+
+
+
+
+
diff --git a/remote-playback/prompt-and-select-device-manual.html b/remote-playback/prompt-and-select-device-manual.html
new file mode 100644
index 00000000000000..0038c0f2dc7617
--- /dev/null
+++ b/remote-playback/prompt-and-select-device-manual.html
@@ -0,0 +1,38 @@
+
+
+ Test that promise is resolved when user selects a device.
+
+
+
+
+
+
+
Please make sure a device for remote playback is available.
+
+
+
+
+
+ Click the button below to prompt for a remote playback device and select
+ one!
+
+
+
+
+
+
+
diff --git a/remote-playback/prompt-and-watch-availability-no-device-manual.html b/remote-playback/prompt-and-watch-availability-no-device-manual.html
new file mode 100644
index 00000000000000..59f6d52bb14016
--- /dev/null
+++ b/remote-playback/prompt-and-watch-availability-no-device-manual.html
@@ -0,0 +1,48 @@
+
+
+
+ Test that watchAvailability returned false when there is no device for the
+ user to select.
+
+
+
+
+
+
+
+
Please make sure no device is available for remote playback.
+
+
+
+
+
+ Click the button below to prompt for a remote playback device and
+ cancel!
+
+
+
+
+
+
+
diff --git a/remote-playback/prompt-and-watch-availability-with-device-manual.html b/remote-playback/prompt-and-watch-availability-with-device-manual.html
new file mode 100644
index 00000000000000..fff8a38dad6191
--- /dev/null
+++ b/remote-playback/prompt-and-watch-availability-with-device-manual.html
@@ -0,0 +1,56 @@
+
+
+
+ Test that watchAvailability returned true when user selects device.
+
+
+
+
+
+
+
+
Please make sure a device for remote playback is available.
+
+
+
+
+
+ Click the button below to prompt for a remote playback device and select
+ one!
+
+
+
+
+
+
+
diff --git a/remote-playback/remote-video-control-pausing-manual.html b/remote-playback/remote-video-control-pausing-manual.html
new file mode 100644
index 00000000000000..21e8f9f12bcb4b
--- /dev/null
+++ b/remote-playback/remote-video-control-pausing-manual.html
@@ -0,0 +1,72 @@
+
+
+
+ Test that pause() on the local video is reflected on the remote device.
+
+
+
+
+
+
+
+ Click the button below to prompt for a remote playback device and select
+ one!
+
+
+
+
+
+
+
+
+ Did the playback on the remote device pause and show the following
+ timestamp? (can vary by some frames)
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/remote-playback/remote-video-control-seek-manual.html b/remote-playback/remote-video-control-seek-manual.html
new file mode 100644
index 00000000000000..5dc32667ae5269
--- /dev/null
+++ b/remote-playback/remote-video-control-seek-manual.html
@@ -0,0 +1,78 @@
+
+
+
+ Test that seek() on the local video is reflected on the remote device.
+
+
+
+
+
+
+
+ Click the button below to prompt for a remote playback device and select
+ one!
+
+
+ Wait a few seconds for the video to initialize, play and seek.
+
+
+
+
+
+
+
+
+ Did the playback on the remote device pause and show the following
+ timestamp? (can vary by some frames)
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/remote-playback/remote-video-playback-manual.html b/remote-playback/remote-video-playback-manual.html
new file mode 100644
index 00000000000000..fb51c48a6c3966
--- /dev/null
+++ b/remote-playback/remote-video-playback-manual.html
@@ -0,0 +1,61 @@
+
+
+ Test if video is playing on remote device.
+
+
+
+
+
+
+
+
+ Click the button below to prompt for a remote playback device and select
+ one!
+
+
+
+
+
+
+
+
Does the video play back on the remote device?
+
+
+
+
+
+
+
+
+
+
diff --git a/remote-playback/state-attribute-changes-when-selecting-device-manual.html b/remote-playback/state-attribute-changes-when-selecting-device-manual.html
new file mode 100644
index 00000000000000..10a048d3d03c37
--- /dev/null
+++ b/remote-playback/state-attribute-changes-when-selecting-device-manual.html
@@ -0,0 +1,53 @@
+
+
+
+ Test that the remote playback state changes when selecting a device.
+
+
+
+
+
+
+
+
Please make sure a device for remote playback is available.
+
+
+
+
+
+ Click the button below to prompt for a remote playback device and select
+ one!
+
+
+
+
+
+
+
diff --git a/remote-playback/state-attribute-changes-with-event-handlers-manual.html b/remote-playback/state-attribute-changes-with-event-handlers-manual.html
new file mode 100644
index 00000000000000..e0e849a17f30e7
--- /dev/null
+++ b/remote-playback/state-attribute-changes-with-event-handlers-manual.html
@@ -0,0 +1,58 @@
+
+
+
+ Test that remote playback state changes when connecting and disconnecting.
+
+
+
+
+
+
+
+
Please make sure a device for remote playback is available.
+
+
+
+
+
+ Click the button below to prompt for a remote playback device and select
+ one! After connecting to the device, please click again and disconnect
+ from device.
+
+
+
+
+
+
+
+
diff --git a/remote-playback/styles.css b/remote-playback/styles.css
new file mode 100644
index 00000000000000..7c3dc811482bec
--- /dev/null
+++ b/remote-playback/styles.css
@@ -0,0 +1,3 @@
+button {
+ padding: 2em;
+}
diff --git a/remote-playback/watch-availability-callback-parameter.html b/remote-playback/watch-availability-callback-parameter.html
new file mode 100644
index 00000000000000..e05507e7bfe12e
--- /dev/null
+++ b/remote-playback/watch-availability-callback-parameter.html
@@ -0,0 +1,30 @@
+
+
+
+ Test that the callback is called with boolean parameter when calling
+ watchAvailability().
+
+
+
+
+
+
diff --git a/remote-playback/watch-availability-initial-callback.html b/remote-playback/watch-availability-initial-callback.html
index 352321b06ae66c..e615b76779f59b 100644
--- a/remote-playback/watch-availability-initial-callback.html
+++ b/remote-playback/watch-availability-initial-callback.html
@@ -1,22 +1,26 @@
-Test that the callback is called once watchAvailability() resolves.
-
-
-
-
+
+
+
+ v.remote
+ .watchAvailability(t.step_func_done(() => assert_true(promiseResolved)))
+ .then(
+ t.step_func(() => {
+ promiseResolved = true;
+ }),
+ t.unreached_func()
+ );
+ }, "Test that the callback is called once watchAvailability() resolves.");
+
diff --git a/remote-playback/watch-availability-promise-return-callback-id.html b/remote-playback/watch-availability-promise-return-callback-id.html
new file mode 100644
index 00000000000000..771a36c035deb8
--- /dev/null
+++ b/remote-playback/watch-availability-promise-return-callback-id.html
@@ -0,0 +1,25 @@
+
+
+
+ Test that the promise returns the callback id when calling
+ watchAvailability().
+
+
+
+
+
+
diff --git a/runner-results.json b/runner-results.json
new file mode 100755
index 00000000000000..3cb4b8019298ba
--- /dev/null
+++ b/runner-results.json
@@ -0,0 +1,462 @@
+{
+ "results": [
+ {
+ "test": "/remote-playback/cancel-watch-availability.html",
+ "subtests": [
+ {
+ "name": "Test that calling cancelWatchAvailability() with an id does remove the callback.",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "Test that calling cancelWatchAvailability() without an id removes all the callbacks.",
+ "status": "PASS",
+ "message": null
+ }
+ ],
+ "status": "OK",
+ "message": null
+ },
+ {
+ "test": "/remote-playback/disable-remote-playback-cancel-watch-availability-throws.html",
+ "subtests": [
+ {
+ "name": "Test that calling cancelWatchAvailability() when disableRemotePlayback attribute is set throws an exception.",
+ "status": "PASS",
+ "message": null
+ }
+ ],
+ "status": "OK",
+ "message": null
+ },
+ {
+ "test": "/remote-playback/disable-remote-playback-prompt-throws.html",
+ "subtests": [
+ {
+ "name": "Test that calling prompt() when disableRemotePlayback attribute is set throws an exception.",
+ "status": "PASS",
+ "message": null
+ }
+ ],
+ "status": "OK",
+ "message": null
+ },
+ {
+ "test": "/remote-playback/disable-remote-playback-watch-availability-throws.html",
+ "subtests": [
+ {
+ "name": "Test that calling watchAvailability() when disableRemotePlayback attribute is set throws an exception.",
+ "status": "PASS",
+ "message": null
+ }
+ ],
+ "status": "OK",
+ "message": null
+ },
+ {
+ "test": "/remote-playback/idlharness.window.html",
+ "subtests": [
+ {
+ "name": "idl_test setup",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "idl_test validation",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "Partial interface HTMLMediaElement: original interface defined",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "Partial interface HTMLMediaElement: member names are unique",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "HTMLElement includes GlobalEventHandlers: member names are unique",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "HTMLElement includes DocumentAndElementEventHandlers: member names are unique",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "HTMLElement includes ElementContentEditable: member names are unique",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "HTMLElement includes HTMLOrSVGElement: member names are unique",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "Element includes ParentNode: member names are unique",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "Element includes NonDocumentTypeChildNode: member names are unique",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "Element includes ChildNode: member names are unique",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "Element includes Slottable: member names are unique",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: existence and properties of interface object",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface object length",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface object name",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: existence and properties of interface prototype object",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: existence and properties of interface prototype object's \"constructor\" property",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: existence and properties of interface prototype object's @@unscopables property",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: operation watchAvailability(RemotePlaybackAvailabilityCallback)",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: operation cancelWatchAvailability(optional long)",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: attribute state",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: attribute onconnecting",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: attribute onconnect",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: attribute ondisconnect",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: operation prompt()",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback must be primary interface of media.remote",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "Stringification of media.remote",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: media.remote must inherit property \"watchAvailability(RemotePlaybackAvailabilityCallback)\" with the proper type",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: calling watchAvailability(RemotePlaybackAvailabilityCallback) on media.remote with too few arguments must throw TypeError",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: media.remote must inherit property \"cancelWatchAvailability(optional long)\" with the proper type",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: calling cancelWatchAvailability(optional long) on media.remote with too few arguments must throw TypeError",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: media.remote must inherit property \"state\" with the proper type",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: media.remote must inherit property \"onconnecting\" with the proper type",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: media.remote must inherit property \"onconnect\" with the proper type",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: media.remote must inherit property \"ondisconnect\" with the proper type",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "RemotePlayback interface: media.remote must inherit property \"prompt()\" with the proper type",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "HTMLMediaElement interface: attribute remote",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "HTMLMediaElement interface: attribute disableRemotePlayback",
+ "status": "PASS",
+ "message": null
+ }
+ ],
+ "status": "OK",
+ "message": null
+ },
+ {
+ "test": "/remote-playback/prompt-in-detached-iframe.html",
+ "subtests": [
+ {
+ "name": "Calling remote.prompt() in a detached context should throw InvalidAccessError",
+ "status": "PASS",
+ "message": null
+ }
+ ],
+ "status": "OK",
+ "message": null
+ },
+ {
+ "test": "/remote-playback/watch-availability-callback-parameter.html",
+ "subtests": [
+ {
+ "name": "Test that the callback is called with boolean parameter when calling watchAvailability().",
+ "status": "PASS",
+ "message": null
+ }
+ ],
+ "status": "OK",
+ "message": null
+ },
+ {
+ "test": "/remote-playback/watch-availability-initial-callback.html",
+ "subtests": [
+ {
+ "name": "Test that the callback is called once watchAvailability() resolves.",
+ "status": "PASS",
+ "message": null
+ }
+ ],
+ "status": "OK",
+ "message": null
+ },
+ {
+ "test": "/remote-playback/watch-availability-promise-return-callback-id.html",
+ "subtests": [
+ {
+ "name": "Test that the promise returns the callback id when calling watchAvailability().",
+ "status": "PASS",
+ "message": null
+ }
+ ],
+ "status": "OK",
+ "message": null
+ },
+ {
+ "test": "/remote-playback/event-handlers-manual.html",
+ "subtests": [
+ {
+ "name": "Test that all event handlers are called.",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "Prompt to connect device",
+ "status": "PASS",
+ "message": null
+ }
+ ],
+ "status": "OK",
+ "message": null
+ },
+ {
+ "test": "/remote-playback/prompt-and-cancel-selection-manual.html",
+ "subtests": [
+ {
+ "name": "Test that promise is rejected when user cancels device selection.",
+ "status": "PASS",
+ "message": null
+ }
+ ],
+ "status": "OK",
+ "message": null
+ },
+ {
+ "test": "/remote-playback/prompt-and-select-device-manual.html",
+ "subtests": [
+ {
+ "name": "Test that promise is resolved when user selects a device.",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "Prompt resolves",
+ "status": "PASS",
+ "message": null
+ }
+ ],
+ "status": "OK",
+ "message": null
+ },
+ {
+ "test": "/remote-playback/prompt-and-watch-availability-no-device-manual.html",
+ "subtests": [
+ {
+ "name": "Test that watchAvailability returned false when there is no device for the user to select.",
+ "status": "PASS",
+ "message": null
+ }
+ ],
+ "status": "OK",
+ "message": null
+ },
+ {
+ "test": "/remote-playback/prompt-and-watch-availability-with-device-manual.html",
+ "subtests": [
+ {
+ "name": "Test that watchAvailability returned true when user selects device.",
+ "status": "PASS",
+ "message": null
+ }
+ ],
+ "status": "OK",
+ "message": null
+ },
+ {
+ "test": "/remote-playback/remote-video-control-pausing-manual.html",
+ "subtests": [
+ {
+ "name": "Test if video is playing on remote device.",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "Prompt resolves",
+ "status": "PASS",
+ "message": null
+ }
+ ],
+ "status": "OK",
+ "message": null
+ },
+ {
+ "test": "/remote-playback/remote-video-control-seek-manual.html",
+ "subtests": [
+ {
+ "name": "Test if video is playing on remote device.",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "Prompt resolves",
+ "status": "PASS",
+ "message": null
+ }
+ ],
+ "status": "OK",
+ "message": null
+ },
+ {
+ "test": "/remote-playback/remote-video-playback-manual.html",
+ "subtests": [
+ {
+ "name": "Test if video is playing on remote device.",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "Prompt resolves",
+ "status": "PASS",
+ "message": null
+ }
+ ],
+ "status": "OK",
+ "message": null
+ },
+ {
+ "test": "/remote-playback/state-attribute-changes-when-selecting-device-manual.html",
+ "subtests": [
+ {
+ "name": "Test that the remote playback state changes when selecting a device.",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "Prompt call resolves",
+ "status": "PASS",
+ "message": null
+ }
+ ],
+ "status": "OK",
+ "message": null
+ },
+ {
+ "test": "/remote-playback/state-attribute-changes-with-event-handlers-manual.html",
+ "subtests": [
+ {
+ "name": "Test that remote playback state changes when connecting and disconnecting.",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "Prompt to connect device",
+ "status": "PASS",
+ "message": null
+ },
+ {
+ "name": "Prompt to disconnect device",
+ "status": "PASS",
+ "message": null
+ }
+ ],
+ "status": "OK",
+ "message": null
+ }
+ ]
+}
\ No newline at end of file