From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- ...entationAvailability_onchange-manual.https.html | 89 ++++++++++ .../PresentationConnectionCloseEvent.https.html | 24 +++ ...resentationConnection_onclose-manual.https.html | 145 ++++++++++++++++ ...sentationConnection_onconnect-manual.https.html | 72 ++++++++ ...sentationConnection_onmessage-manual.https.html | 144 ++++++++++++++++ ...ntationConnection_onterminate-manual.https.html | 157 +++++++++++++++++ .../PresentationConnection_send-manual.https.html | 125 ++++++++++++++ .../PresentationRequest_error.https.html | 36 ++++ .../PresentationRequest_mixedcontent.https.html | 18 ++ ...ntationRequest_mixedcontent_multiple.https.html | 21 +++ ...Request_onconnectionavailable-manual.https.html | 85 ++++++++++ ...PresentationRequest_sandboxing_error.https.html | 26 +++ ...esentationRequest_sandboxing_success.https.html | 26 +++ .../PresentationRequest_success.https.html | 31 ++++ .../presentation-api/controlling-ua/common.js | 25 +++ .../controlling-ua/defaultRequest.https.html | 24 +++ .../defaultRequest_success-manual.https.html | 63 +++++++ .../controlling-ua/getAvailability.https.html | 54 ++++++ .../getAvailability_sandboxing_success.https.html | 25 +++ .../controlling-ua/idlharness.https.html | 51 ++++++ ...MultiplePresentations_success-manual.https.html | 138 +++++++++++++++ ...ToPresentation_notfound_error-manual.https.html | 61 +++++++ ...ectToPresentation_sandboxing_success.https.html | 25 +++ ...connectToPresentation_success-manual.https.html | 185 +++++++++++++++++++++ ...MultiplePresentations_success-manual.https.html | 99 +++++++++++ ...resentation_displaynotallowed-manual.https.html | 45 +++++ ...wPresentation_displaynotfound-manual.https.html | 45 +++++ .../startNewPresentation_error.https.html | 20 +++ ...esentation_sandboxing_success-manual.https.html | 31 ++++ .../startNewPresentation_success-manual.https.html | 95 +++++++++++ ...Presentation_unsettledpromise-manual.https.html | 44 +++++ .../controlling-ua/support/iframe.html | 181 ++++++++++++++++++++ .../controlling-ua/support/presentation.html | 98 +++++++++++ .../controlling-ua/support/stash.js | 83 +++++++++ .../controlling-ua/support/stash.py | 10 ++ 35 files changed, 2401 insertions(+) create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/PresentationAvailability_onchange-manual.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnectionCloseEvent.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_onclose-manual.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_onconnect-manual.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_onmessage-manual.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_onterminate-manual.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_send-manual.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_error.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_mixedcontent.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_mixedcontent_multiple.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_onconnectionavailable-manual.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_sandboxing_error.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_sandboxing_success.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_success.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/common.js create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/defaultRequest.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/defaultRequest_success-manual.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/getAvailability.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/getAvailability_sandboxing_success.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/idlharness.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/reconnectToMultiplePresentations_success-manual.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/reconnectToPresentation_notfound_error-manual.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/reconnectToPresentation_sandboxing_success.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/reconnectToPresentation_success-manual.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/startMultiplePresentations_success-manual.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_displaynotallowed-manual.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_displaynotfound-manual.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_error.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_sandboxing_success-manual.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_success-manual.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_unsettledpromise-manual.https.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/support/iframe.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/support/presentation.html create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/support/stash.js create mode 100644 testing/web-platform/tests/presentation-api/controlling-ua/support/stash.py (limited to 'testing/web-platform/tests/presentation-api/controlling-ua') diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/PresentationAvailability_onchange-manual.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationAvailability_onchange-manual.https.html new file mode 100644 index 0000000000..48ecb610c6 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationAvailability_onchange-manual.https.html @@ -0,0 +1,89 @@ + + +Monitoring the list of available presentation displays. + + + + + + +

Please wait for a moment...

+

The test passes if a "PASS" result appears.

+ + \ No newline at end of file diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnectionCloseEvent.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnectionCloseEvent.https.html new file mode 100644 index 0000000000..34c935a603 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnectionCloseEvent.https.html @@ -0,0 +1,24 @@ + + +Constructing a PresentationConnectionCloseEvent + + + + + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_onclose-manual.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_onclose-manual.https.html new file mode 100644 index 0000000000..f63806f82b --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_onclose-manual.https.html @@ -0,0 +1,145 @@ + + + +Closing a PresentationConnection + + + + + + + + +

Description

+

+ This test validates that after connection close,
+ the connection state is set closed,
+ the onclose EventHandler is triggered. +

+
+

Click the button below to start the test.

+ + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_onconnect-manual.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_onconnect-manual.https.html new file mode 100644 index 0000000000..0f4a4ac369 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_onconnect-manual.https.html @@ -0,0 +1,72 @@ + + + +Establishing a presentation connection + + + + + + + +

Description

+

+ This test validates that after connection starts,
+ the onconnect EventHandler is triggered and connection state is connected. +

+
+

Click the button below to start the test.

+ + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_onmessage-manual.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_onmessage-manual.https.html new file mode 100644 index 0000000000..59d7e8c0e0 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_onmessage-manual.https.html @@ -0,0 +1,144 @@ + + + +Receiving a message through PresentationConnection + + + + + + + +

+ Click the button below and select the available presentation display, to start the manual test. The test passes if a "PASS" result appears.
+ +

+ + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_onterminate-manual.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_onterminate-manual.https.html new file mode 100644 index 0000000000..7fdc2dbdcd --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_onterminate-manual.https.html @@ -0,0 +1,157 @@ + + + +Terminating a presentation in a controlling browsing context + + + + + + + + +

+ Click the button below and select the available presentation display, to start the manual test. The test passes if a "PASS" result appears.
+ This test asks you to click the button twice, unless the test fails.
+

+ + + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_send-manual.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_send-manual.https.html new file mode 100644 index 0000000000..fcc91212e0 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationConnection_send-manual.https.html @@ -0,0 +1,125 @@ + + + +Sending a message through PresentationConnection + + + + + + + +

+ Click the button below and select the available presentation display, to start the manual test. The test passes if a "PASS" result appears.
+ +

+ + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_error.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_error.https.html new file mode 100644 index 0000000000..68e0fbcd22 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_error.https.html @@ -0,0 +1,36 @@ + + +Constructing a PresentationRequest (Error) + + + + + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_mixedcontent.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_mixedcontent.https.html new file mode 100644 index 0000000000..3b19b9c9bd --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_mixedcontent.https.html @@ -0,0 +1,18 @@ + + +Creating a PresentationRequest with an a priori unauthenticated URL in an HTTPS context throws a SecurityError exception. + + + + + + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_mixedcontent_multiple.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_mixedcontent_multiple.https.html new file mode 100644 index 0000000000..e9571224d6 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_mixedcontent_multiple.https.html @@ -0,0 +1,21 @@ + + +Creating a PresentationRequest with a set of URLs containing an a priori unauthenticated URL in an HTTPS context throws a SecurityError exception. + + + + + + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_onconnectionavailable-manual.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_onconnectionavailable-manual.https.html new file mode 100644 index 0000000000..d06daae11c --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_onconnectionavailable-manual.https.html @@ -0,0 +1,85 @@ + + +Firing a connectionavailable event at a controlling user agent + + + + + +

Click the button below and select the available presentation display, to start the manual test.

+ + + + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_sandboxing_error.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_sandboxing_error.https.html new file mode 100644 index 0000000000..ad5e32a45a --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_sandboxing_error.https.html @@ -0,0 +1,26 @@ + + +Sandboxing: Creating a PresentationRequest from a nested context fails when allow-presentation is not set + + + + + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_sandboxing_success.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_sandboxing_success.https.html new file mode 100644 index 0000000000..7ede80d595 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_sandboxing_success.https.html @@ -0,0 +1,26 @@ + + +Sandboxing: Creating a PresentationRequest from a nested context succeeds when allow-presentation is set + + + + + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_success.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_success.https.html new file mode 100644 index 0000000000..890e0ed624 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/PresentationRequest_success.https.html @@ -0,0 +1,31 @@ + + +Constructing a PresentationRequest + + + + + + + \ No newline at end of file diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/common.js b/testing/web-platform/tests/presentation-api/controlling-ua/common.js new file mode 100644 index 0000000000..4a73acd1de --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/common.js @@ -0,0 +1,25 @@ +(function (window) { + // Cast ID of the main custom receiver application linked with the test suite + // That application ID, maintained by W3C team, points at: + // https://[W3C test server]/presentation-api/controlling-ua/support/presentation.html + // + // NB: this mechanism should be improved later on as tests should not depend + // on something that directly or indirectly maps to a resource on the W3C test + // server. + var castAppId = '915D2A2C'; + var castUrl = 'cast:' + castAppId; + + window.presentationUrls = [ + 'support/presentation.html', + castUrl + ]; + + // Both a controlling side and a receiving one must share the same Stash ID to + // transmit data from one to the other. On the other hand, due to polling mechanism + // which cleans up a stash, stashes in both controller-to-receiver direction + // and one for receiver-to-controller are necessary. + window.stashIds = { + toController: '9bf08fea-a71a-42f9-b3c4-fa19499e4d12', + toReceiver: 'f1fdfd10-b606-4748-a644-0a8e9df3bdd6' + } +})(window); diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/defaultRequest.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/defaultRequest.https.html new file mode 100644 index 0000000000..713cea7f9a --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/defaultRequest.https.html @@ -0,0 +1,24 @@ + + +Setting a default presentation request + + + + + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/defaultRequest_success-manual.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/defaultRequest_success-manual.https.html new file mode 100644 index 0000000000..840b72b849 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/defaultRequest_success-manual.https.html @@ -0,0 +1,63 @@ + + +[Optional] Starting a presentation from the browser using a default presentation request. + + + + + + + +

+ Click the button or the menu item for presentation on your browser (for example, "Cast"),
+ to start the manual test, and select a presentation display when prompted to do so.
+ The test passes if a "PASS" result appears. +

+

+ If your browser does not support defaultRequest, please click this button: +

+ + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/getAvailability.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/getAvailability.https.html new file mode 100644 index 0000000000..71b19e6a4e --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/getAvailability.https.html @@ -0,0 +1,54 @@ + + +Getting the presentation displays availability information. + + + + + + + + +

The test passes if a "PASS" result appears.

+ + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/getAvailability_sandboxing_success.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/getAvailability_sandboxing_success.https.html new file mode 100644 index 0000000000..daa0a0ff14 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/getAvailability_sandboxing_success.https.html @@ -0,0 +1,25 @@ + + +Sandboxing: Retrieving display availability from a nested context succeeds when allow-presentation is set + + + + + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/idlharness.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/idlharness.https.html new file mode 100644 index 0000000000..1cb8830f89 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/idlharness.https.html @@ -0,0 +1,51 @@ + + +Presentation API IDL tests for Controlling User Agent + + + + + + + + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/reconnectToMultiplePresentations_success-manual.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/reconnectToMultiplePresentations_success-manual.https.html new file mode 100644 index 0000000000..ab1bd8089d --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/reconnectToMultiplePresentations_success-manual.https.html @@ -0,0 +1,138 @@ + + +Reconnecting presentations on two distinct displays + + + + + + + +

Click the button below and select the available presentation display, to start the manual test.

+

Click the button below and select the other available presentation display, to continue the manual test.

+

This test asks you to click the button twice, unless the test fails.
+This test requires two or more available displays.

+ + + + \ No newline at end of file diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/reconnectToPresentation_notfound_error-manual.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/reconnectToPresentation_notfound_error-manual.https.html new file mode 100644 index 0000000000..f92ab80f73 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/reconnectToPresentation_notfound_error-manual.https.html @@ -0,0 +1,61 @@ + + +Calling "reconnect" with a wrong presentation ID fails with a NotFoundError exception + + + + + + + + +

Click the button below to start the manual test. Select a presentation device after the selection dialog is prompted. + The test assumes that at least one presentation device is available. The test passes if a "PASS" result appears.

+ + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/reconnectToPresentation_sandboxing_success.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/reconnectToPresentation_sandboxing_success.https.html new file mode 100644 index 0000000000..96505aca05 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/reconnectToPresentation_sandboxing_success.https.html @@ -0,0 +1,25 @@ + + +Sandboxing: Reconnecting a presentation from a nested context succeeds when allow-presentation is set + + + + + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/reconnectToPresentation_success-manual.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/reconnectToPresentation_success-manual.https.html new file mode 100644 index 0000000000..a2619042f8 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/reconnectToPresentation_success-manual.https.html @@ -0,0 +1,185 @@ + + +Reconnect to presentation success manual test + + + + + + + + +

Click the button below to start the manual test. Select a presentation device after the selection dialog is prompted. + The test assumes that at least one presentation device is available. The test passes if a "PASS" result appears.

+ + + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/startMultiplePresentations_success-manual.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/startMultiplePresentations_success-manual.https.html new file mode 100644 index 0000000000..0268bd87e8 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/startMultiplePresentations_success-manual.https.html @@ -0,0 +1,99 @@ + + +Starting presentations on two distinct displays + + + + + + + +

Click the button below and select the available presentation display, to start the manual test.

+

Click the button below and select the other available presentation display, to continue the manual test.

+

This test asks you to click the button twice, unless the test fails.
+This test requires two or more available displays.

+ + + + \ No newline at end of file diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_displaynotallowed-manual.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_displaynotallowed-manual.https.html new file mode 100644 index 0000000000..877c17a35d --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_displaynotallowed-manual.https.html @@ -0,0 +1,45 @@ + + +Calling "start" when the user denied permission to use the display returns a Promise rejected with a NotAllowedError exception. + + + + + + +

Before starting this test, confirm that there are one or more available presentation display on your local network.

+

Click the button below to start the manual test. If prompted to select a device, please dismiss the dialog box. The test passes if a "PASS" result appears. +

+ + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_displaynotfound-manual.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_displaynotfound-manual.https.html new file mode 100644 index 0000000000..edfea3a4fd --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_displaynotfound-manual.https.html @@ -0,0 +1,45 @@ + + +Calling "start" when there is no available presentation display returns a Promise rejected with a NotFoundError exception. + + + + + + +

Before starting this test, confirm that there is no available presentation display on your local network.

+

Click the button below to start the manual test. If prompted to select a device, please dismiss the dialog box. The test passes if a "PASS" result appears. +

+ + + \ No newline at end of file diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_error.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_error.https.html new file mode 100644 index 0000000000..3171c6c104 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_error.https.html @@ -0,0 +1,20 @@ + + +Presentation API, start new presentation tests for Controlling User Agent (error) + + + + + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_sandboxing_success-manual.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_sandboxing_success-manual.https.html new file mode 100644 index 0000000000..68e037a5c0 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_sandboxing_success-manual.https.html @@ -0,0 +1,31 @@ + + +Sandboxing: starting a presentation from a nested context succeeds when allow-presentation is set + + + + + + +

Click the button below to start the manual test. If prompted to select a device, please dismiss the dialog box. The test passes if a "PASS" result appears.

+ + + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_success-manual.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_success-manual.https.html new file mode 100644 index 0000000000..c9378c0e68 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_success-manual.https.html @@ -0,0 +1,95 @@ + + +Checking the chain of events when starting a new presentation + + + + + + + +

Click the button below and select the available presentation display, to start the manual test.

+ + + + \ No newline at end of file diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_unsettledpromise-manual.https.html b/testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_unsettledpromise-manual.https.html new file mode 100644 index 0000000000..fb747eb0a4 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/startNewPresentation_unsettledpromise-manual.https.html @@ -0,0 +1,44 @@ + + +Calling "start" when there is already an unsettled Promise returns a Promise rejected with an OperationError exception. + + + + + + +

Click the button below to start the manual test. If prompted to select a device, please dismiss the dialog box. The test passes if a "PASS" result appears.

+ + + \ No newline at end of file diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/support/iframe.html b/testing/web-platform/tests/presentation-api/controlling-ua/support/iframe.html new file mode 100644 index 0000000000..e2171deaa8 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/support/iframe.html @@ -0,0 +1,181 @@ + + +Presentation API - controlling ua - sandboxing + + + + + + + + diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/support/presentation.html b/testing/web-platform/tests/presentation-api/controlling-ua/support/presentation.html new file mode 100644 index 0000000000..8ad838062f --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/support/presentation.html @@ -0,0 +1,98 @@ + + + + + + + + + + \ No newline at end of file diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/support/stash.js b/testing/web-platform/tests/presentation-api/controlling-ua/support/stash.js new file mode 100644 index 0000000000..616907d4f2 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/support/stash.js @@ -0,0 +1,83 @@ +var Stash = function(inbound, outbound) { + this.stashPath = '/presentation-api/controlling-ua/support/stash.py?id='; + this.inbound = inbound; + this.outbound = outbound; +} + +// initialize a stash on wptserve +Stash.prototype.init = function() { + return Promise.all([ + fetch(this.stashPath + this.inbound).then(response => { + return response.text(); + }), + fetch(this.stashPath + this.outbound).then(response => { + return response.text(); + }) + ]); +} + +// upload a test result to a stash on wptserve +Stash.prototype.send = function(result) { + return fetch(this.stashPath + this.outbound, { + method: 'POST', + body: JSON.stringify({ type: 'data', data: result }) + }).then(response => { + return response.text(); + }).then(text => { + return text === 'ok' ? null : Promise.reject(); + }) +}; + +// wait until a test result is uploaded to a stash on wptserve +Stash.prototype.receive = function() { + return new Promise((resolve, reject) => { + let intervalId; + const interval = 500; // msec + const polling = () => { + return fetch(this.stashPath + this.inbound).then(response => { + return response.text(); + }).then(text => { + if (text) { + try { + const json = JSON.parse(text); + if (json.type === 'data') + resolve(json.data); + else + reject(); + } catch(e) { + resolve(text); + } + clearInterval(intervalId); + } + }); + }; + intervalId = setInterval(polling, interval); + }); +}; + +// reset a stash on wptserve +Stash.prototype.stop = function() { + return Promise.all([ + fetch(this.stashPath + this.inbound).then(response => { + return response.text(); + }), + fetch(this.stashPath + this.outbound).then(response => { + return response.text(); + }) + ]).then(() => { + return Promise.all([ + fetch(this.stashPath + this.inbound, { + method: 'POST', + body: JSON.stringify({ type: 'stop' }) + }).then(response => { + return response.text(); + }), + fetch(this.stashPath + this.outbound, { + method: 'POST', + body: JSON.stringify({ type: 'stop' }) + }).then(response => { + return response.text(); + }) + ]); + }); +} diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/support/stash.py b/testing/web-platform/tests/presentation-api/controlling-ua/support/stash.py new file mode 100644 index 0000000000..83653d365a --- /dev/null +++ b/testing/web-platform/tests/presentation-api/controlling-ua/support/stash.py @@ -0,0 +1,10 @@ +def main(request, response): + key = request.GET.first(b"id") + + if request.method == u"POST": + request.server.stash.put(key, request.body) + return b"ok" + else: + value = request.server.stash.take(key) + assert request.server.stash.take(key) is None + return value \ No newline at end of file -- cgit v1.2.3