From b9766a8d5bb3aa8ab732a8df5cf463d6f8be73f2 Mon Sep 17 00:00:00 2001 From: Fritz Heiden Date: Thu, 11 Aug 2022 16:31:15 +0200 Subject: [PATCH 1/5] Implemented some tests for remote-playback api --- .../prompt-and-cancel-selection-manual.html | 43 +++++++++++++++++++ .../prompt-and-select-device-manual.html | 35 +++++++++++++++ ...device-with-watch-availability-manual.html | 37 ++++++++++++++++ ...lects-remote-playback-properly-manual.html | 0 ...watch-availability-callback-parameter.html | 20 +++++++++ ...ailability-promise-return-callback-id.html | 23 ++++++++++ 6 files changed, 158 insertions(+) create mode 100644 remote-playback/prompt-and-cancel-selection-manual.html create mode 100644 remote-playback/prompt-and-select-device-manual.html create mode 100644 remote-playback/prompt-and-select-device-with-watch-availability-manual.html create mode 100644 remote-playback/state-attribute-reflects-remote-playback-properly-manual.html create mode 100644 remote-playback/watch-availability-callback-parameter.html create mode 100644 remote-playback/watch-availability-promise-return-callback-id.html 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..a8a5ec871df7e2 --- /dev/null +++ b/remote-playback/prompt-and-cancel-selection-manual.html @@ -0,0 +1,43 @@ + + + + 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..af6e27e0fb5c41 --- /dev/null +++ b/remote-playback/prompt-and-select-device-manual.html @@ -0,0 +1,35 @@ + + + Test that promise is resolved when user selects a device. + + + + +

+ Click the button below to prompt for a remote playback device and select + one! +

+ + + + diff --git a/remote-playback/prompt-and-select-device-with-watch-availability-manual.html b/remote-playback/prompt-and-select-device-with-watch-availability-manual.html new file mode 100644 index 00000000000000..ebcfdbc0e00812 --- /dev/null +++ b/remote-playback/prompt-and-select-device-with-watch-availability-manual.html @@ -0,0 +1,37 @@ + + + Test that watchAvailability returned true when user selects device. + + + + +

+ Click the button below to prompt for a remote playback device and select + one! +

+ + + + diff --git a/remote-playback/state-attribute-reflects-remote-playback-properly-manual.html b/remote-playback/state-attribute-reflects-remote-playback-properly-manual.html new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/remote-playback/watch-availability-callback-parameter.html b/remote-playback/watch-availability-callback-parameter.html new file mode 100644 index 00000000000000..591b6ad41f8d5e --- /dev/null +++ b/remote-playback/watch-availability-callback-parameter.html @@ -0,0 +1,20 @@ + + +Test that the callback is called with boolean parameter when calling watchAvailability(). + + + + + 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..5ec3ec1afc1ebb --- /dev/null +++ b/remote-playback/watch-availability-promise-return-callback-id.html @@ -0,0 +1,23 @@ + + + + Test that the promise returns the callback id when calling + watchAvailability(). + + + + + + From d389514206c412e4de27ee3fa90afa0e8aec46e1 Mon Sep 17 00:00:00 2001 From: Fritz Heiden Date: Fri, 12 Aug 2022 15:16:38 +0200 Subject: [PATCH 2/5] Implemented all API tests --- remote-playback/event-handlers-manual.html | 83 +++++++++++++++++++ .../prompt-and-cancel-selection-manual.html | 29 +++---- .../prompt-and-select-device-manual.html | 56 ++++++++----- ...device-with-watch-availability-manual.html | 37 --------- ...d-watch-availability-no-device-manual.html | 65 +++++++++++++++ ...watch-availability-with-device-manual.html | 69 +++++++++++++++ ...-changes-when-selecting-device-manual.html | 67 +++++++++++++++ ...te-changes-with-event-handlers-manual.html | 78 +++++++++++++++++ ...lects-remote-playback-properly-manual.html | 0 9 files changed, 408 insertions(+), 76 deletions(-) create mode 100644 remote-playback/event-handlers-manual.html delete mode 100644 remote-playback/prompt-and-select-device-with-watch-availability-manual.html create mode 100644 remote-playback/prompt-and-watch-availability-no-device-manual.html create mode 100644 remote-playback/prompt-and-watch-availability-with-device-manual.html create mode 100644 remote-playback/state-attribute-changes-when-selecting-device-manual.html create mode 100644 remote-playback/state-attribute-changes-with-event-handlers-manual.html delete mode 100644 remote-playback/state-attribute-reflects-remote-playback-properly-manual.html diff --git a/remote-playback/event-handlers-manual.html b/remote-playback/event-handlers-manual.html new file mode 100644 index 00000000000000..674235480b9b59 --- /dev/null +++ b/remote-playback/event-handlers-manual.html @@ -0,0 +1,83 @@ + + + + Test that all event handlers are called. + + + + + +
+

Please make sure a device for remote playback is available.

+ + +
+ + + + diff --git a/remote-playback/prompt-and-cancel-selection-manual.html b/remote-playback/prompt-and-cancel-selection-manual.html index a8a5ec871df7e2..8117a6e489bee4 100644 --- a/remote-playback/prompt-and-cancel-selection-manual.html +++ b/remote-playback/prompt-and-cancel-selection-manual.html @@ -18,26 +18,17 @@ var v = document.createElement("video"); v.src = getVideoURI("/media/movie_5"); - function callback(available) { - async_test((t) => { - v.remote - .prompt() - .then(t.unreached_func()) - .catch( - t.step_func_done((error) => - assert_equals(error.name, "NotAllowedError") - ) - ); - }, "Test that promise is rejected with 'NotAllowedError'."); - } - var button = document.getElementById("prompt-button"); - button.onclick = function () { - v.remote.watchAvailability(t.step_func_done(callback)).then( - t.step_func(() => {}), - t.unreached_func() - ); - }; + button.onclick = t.step_func(() => { + v.remote + .prompt() + .then(t.unreached_func()) + .catch( + t.step_func_done((error) => + assert_equals(error.name, "NotAllowedError") + ) + ); + }); }, "Test that promise is rejected when user cancels device selection."); diff --git a/remote-playback/prompt-and-select-device-manual.html b/remote-playback/prompt-and-select-device-manual.html index af6e27e0fb5c41..44a0e45c78d655 100644 --- a/remote-playback/prompt-and-select-device-manual.html +++ b/remote-playback/prompt-and-select-device-manual.html @@ -5,31 +5,47 @@ -

- Click the button below to prompt for a remote playback device and select - one! -

- +
+

Please make sure a device for remote playback is available.

+ + +
+ diff --git a/remote-playback/prompt-and-select-device-with-watch-availability-manual.html b/remote-playback/prompt-and-select-device-with-watch-availability-manual.html deleted file mode 100644 index ebcfdbc0e00812..00000000000000 --- a/remote-playback/prompt-and-select-device-with-watch-availability-manual.html +++ /dev/null @@ -1,37 +0,0 @@ - - - Test that watchAvailability returned true when user selects device. - - - - -

- 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..da38d9a831fb47 --- /dev/null +++ b/remote-playback/prompt-and-watch-availability-no-device-manual.html @@ -0,0 +1,65 @@ + + + + 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.

+ + +
+ + + + 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..0aa2bc6a25cafd --- /dev/null +++ b/remote-playback/prompt-and-watch-availability-with-device-manual.html @@ -0,0 +1,69 @@ + + + + Test that watchAvailability returned true when user selects device. + + + + + +
+

Please make sure a device for remote playback is available.

+ + +
+ + + + 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..2d0f449a7ab87e --- /dev/null +++ b/remote-playback/state-attribute-changes-when-selecting-device-manual.html @@ -0,0 +1,67 @@ + + + + Test that the remote playback state changes when selecting a device. + + + + + +
+

Please make sure a device for remote playback is available.

+ + +
+ + + + 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..99e73dd952c645 --- /dev/null +++ b/remote-playback/state-attribute-changes-with-event-handlers-manual.html @@ -0,0 +1,78 @@ + + + + Test that remote playback state changes when connecting and disconnecting. + + + + + +
+

Please make sure a device for remote playback is available.

+ + +
+ + + + diff --git a/remote-playback/state-attribute-reflects-remote-playback-properly-manual.html b/remote-playback/state-attribute-reflects-remote-playback-properly-manual.html deleted file mode 100644 index e69de29bb2d1d6..00000000000000 From 8b35bac5e38fe121b3105b9c7c02fd17df6b5eff Mon Sep 17 00:00:00 2001 From: Fritz Heiden Date: Tue, 16 Aug 2022 18:55:04 +0200 Subject: [PATCH 3/5] Implemented all tests --- .../prompt-and-cancel-selection-manual.html | 4 +- .../remote-video-control-pausing-manual.html | 74 ++++++++++++++++++ .../remote-video-control-seek-manual.html | 77 +++++++++++++++++++ .../remote-video-playback-manual.html | 63 +++++++++++++++ 4 files changed, 216 insertions(+), 2 deletions(-) create mode 100644 remote-playback/remote-video-control-pausing-manual.html create mode 100644 remote-playback/remote-video-control-seek-manual.html create mode 100644 remote-playback/remote-video-playback-manual.html diff --git a/remote-playback/prompt-and-cancel-selection-manual.html b/remote-playback/prompt-and-cancel-selection-manual.html index 8117a6e489bee4..46ec86560525d4 100644 --- a/remote-playback/prompt-and-cancel-selection-manual.html +++ b/remote-playback/prompt-and-cancel-selection-manual.html @@ -8,8 +8,8 @@

- Click the button below to prompt for a remote playback device and cancel - the selection of a device! + Click the button below to prompt for a remote playback device and cancel + the selection of a device!

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..46a16d72e38547 --- /dev/null +++ b/remote-playback/remote-video-control-pausing-manual.html @@ -0,0 +1,74 @@ + + + Test if video is playing on remote device. + + + + + +
+

+ Click the button below to prompt for a remote playback device and select + one! +

+

+ +

+
+ + + + + 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..278931eb093a06 --- /dev/null +++ b/remote-playback/remote-video-control-seek-manual.html @@ -0,0 +1,77 @@ + + + Test if video is playing on remote device. + + + + + +
+

+ Click the button below to prompt for a remote playback device and select + one! +

+

+ +

+
+ + + + + diff --git a/remote-playback/remote-video-playback-manual.html b/remote-playback/remote-video-playback-manual.html new file mode 100644 index 00000000000000..5d9c1374bc53d0 --- /dev/null +++ b/remote-playback/remote-video-playback-manual.html @@ -0,0 +1,63 @@ + + + Test if video is playing on remote device. + + + + + +
+

+ Click the button below to prompt for a remote playback device and select + one! +

+

+ +

+
+ + + + + From 22f0f6cee66b775b2cf6a5756b016dbdaca0477a Mon Sep 17 00:00:00 2001 From: Fritz Heiden Date: Tue, 16 Aug 2022 19:38:24 +0200 Subject: [PATCH 4/5] Added test results --- runner-results.json | 462 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 462 insertions(+) create mode 100755 runner-results.json 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 From d51fbb8c026a61e4757d27b26ff09aa0dda62657 Mon Sep 17 00:00:00 2001 From: Fritz Heiden Date: Tue, 7 Mar 2023 14:52:17 +0100 Subject: [PATCH 5/5] Made changes according to PR feedback --- .../cancel-watch-availability.html | 93 +++++++++++-------- ...back-cancel-watch-availability-throws.html | 49 +++++----- ...disable-remote-playback-prompt-throws.html | 27 +++--- ...te-playback-watch-availability-throws.html | 32 ++++--- remote-playback/event-handlers-manual.html | 79 ++++++---------- remote-playback/prepare-device.js | 12 +++ .../prompt-and-cancel-selection-manual.html | 17 ++-- .../prompt-and-select-device-manual.html | 25 ++--- ...d-watch-availability-no-device-manual.html | 57 ++++-------- ...watch-availability-with-device-manual.html | 65 ++++++------- .../remote-video-control-pausing-manual.html | 60 ++++++------ .../remote-video-control-seek-manual.html | 65 ++++++------- .../remote-video-playback-manual.html | 32 +++---- ...-changes-when-selecting-device-manual.html | 28 ++---- ...te-changes-with-event-handlers-manual.html | 44 +++------ remote-playback/styles.css | 3 + ...watch-availability-callback-parameter.html | 42 +++++---- .../watch-availability-initial-callback.html | 38 ++++---- ...ailability-promise-return-callback-id.html | 16 ++-- 19 files changed, 374 insertions(+), 410 deletions(-) create mode 100644 remote-playback/prepare-device.js create mode 100644 remote-playback/styles.css diff --git a/remote-playback/cancel-watch-availability.html b/remote-playback/cancel-watch-availability.html index d83c8cecb006d7..a3fc96799390e7 100644 --- a/remote-playback/cancel-watch-availability.html +++ b/remote-playback/cancel-watch-availability.html @@ -1,44 +1,63 @@ -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 index 674235480b9b59..b7c32db88eebe6 100644 --- a/remote-playback/event-handlers-manual.html +++ b/remote-playback/event-handlers-manual.html @@ -1,11 +1,12 @@ - - Test that all event handlers are called. - + Test that all event handlers are called. +

Please make sure a device for remote playback is available.

@@ -24,60 +25,36 @@
+ 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 index 46ec86560525d4..eb93df83abfbfb 100644 --- a/remote-playback/prompt-and-cancel-selection-manual.html +++ b/remote-playback/prompt-and-cancel-selection-manual.html @@ -6,20 +6,23 @@ +

- Click the button below to prompt for a remote playback device and cancel - the selection of a device! + 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 index 44a0e45c78d655..0038c0f2dc7617 100644 --- a/remote-playback/prompt-and-select-device-manual.html +++ b/remote-playback/prompt-and-select-device-manual.html @@ -4,6 +4,9 @@ +

Please make sure a device for remote playback is available.

@@ -18,29 +21,13 @@
+ +

Please make sure no device is available for remote playback.

@@ -14,51 +18,30 @@
+ diff --git a/remote-playback/prompt-and-watch-availability-with-device-manual.html b/remote-playback/prompt-and-watch-availability-with-device-manual.html index 0aa2bc6a25cafd..fff8a38dad6191 100644 --- a/remote-playback/prompt-and-watch-availability-with-device-manual.html +++ b/remote-playback/prompt-and-watch-availability-with-device-manual.html @@ -6,6 +6,9 @@ +

Please make sure a device for remote playback is available.

@@ -20,49 +23,33 @@
+ diff --git a/remote-playback/remote-video-control-pausing-manual.html b/remote-playback/remote-video-control-pausing-manual.html index 46a16d72e38547..21e8f9f12bcb4b 100644 --- a/remote-playback/remote-video-control-pausing-manual.html +++ b/remote-playback/remote-video-control-pausing-manual.html @@ -1,14 +1,13 @@ - Test if video is playing on remote device. + + Test that pause() on the local video is reflected on the remote device. - +

@@ -21,8 +20,11 @@

diff --git a/remote-playback/remote-video-control-seek-manual.html b/remote-playback/remote-video-control-seek-manual.html index 278931eb093a06..5dc32667ae5269 100644 --- a/remote-playback/remote-video-control-seek-manual.html +++ b/remote-playback/remote-video-control-seek-manual.html @@ -1,28 +1,33 @@ - Test if video is playing on remote device. + + 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. +

diff --git a/remote-playback/remote-video-playback-manual.html b/remote-playback/remote-video-playback-manual.html index 5d9c1374bc53d0..fb51c48a6c3966 100644 --- a/remote-playback/remote-video-playback-manual.html +++ b/remote-playback/remote-video-playback-manual.html @@ -4,9 +4,12 @@ + @@ -31,13 +34,10 @@ diff --git a/remote-playback/state-attribute-changes-when-selecting-device-manual.html b/remote-playback/state-attribute-changes-when-selecting-device-manual.html index 2d0f449a7ab87e..10a048d3d03c37 100644 --- a/remote-playback/state-attribute-changes-when-selecting-device-manual.html +++ b/remote-playback/state-attribute-changes-when-selecting-device-manual.html @@ -6,6 +6,9 @@ +

Please make sure a device for remote playback is available.

@@ -20,32 +23,15 @@
+ +

Please make sure a device for remote playback is available.

@@ -24,43 +27,20 @@
+ - - - + + + + v.remote + .watchAvailability( + t.step_func_done(() => assert_true(typeof available === "boolean")) + ) + .then( + t.step_func(() => {}), + t.unreached_func() + ) + .catch( + t.step_func_done((error) => + assert_equals(error.name, "NotSupportedError") + ) + ); + }, "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 index 5ec3ec1afc1ebb..771a36c035deb8 100644 --- a/remote-playback/watch-availability-promise-return-callback-id.html +++ b/remote-playback/watch-availability-promise-return-callback-id.html @@ -9,15 +9,17 @@