diff --git a/presentation-api/controlling-ua/reconnectToPresentation_sandboxing_error.html b/presentation-api/controlling-ua/PresentationRequest_sandboxing_error.html similarity index 51% rename from presentation-api/controlling-ua/reconnectToPresentation_sandboxing_error.html rename to presentation-api/controlling-ua/PresentationRequest_sandboxing_error.html index c3286f55a6088d..ad5e32a45a3a67 100644 --- a/presentation-api/controlling-ua/reconnectToPresentation_sandboxing_error.html +++ b/presentation-api/controlling-ua/PresentationRequest_sandboxing_error.html @@ -1,24 +1,24 @@ -Sandboxing: Reconnecting a presentation from a nested context fails when allow-presentation is not set +Sandboxing: Creating a PresentationRequest from a nested context fails when allow-presentation is not set - + + + + diff --git a/presentation-api/controlling-ua/getAvailability_sandboxing_error.html b/presentation-api/controlling-ua/getAvailability_sandboxing_error.html deleted file mode 100644 index 88cae73c0eae71..00000000000000 --- a/presentation-api/controlling-ua/getAvailability_sandboxing_error.html +++ /dev/null @@ -1,26 +0,0 @@ - - -Sandboxing: Retrieving display availability from a nested context fails when allow-presentation is not set - - - - - - diff --git a/presentation-api/controlling-ua/startNewPresentation_sandboxing_error-manual.html b/presentation-api/controlling-ua/startNewPresentation_sandboxing_error-manual.html deleted file mode 100644 index 06334b000bd50c..00000000000000 --- a/presentation-api/controlling-ua/startNewPresentation_sandboxing_error-manual.html +++ /dev/null @@ -1,31 +0,0 @@ - - -Sandboxing: starting a presentation from a nested context fails when allow-presentation is not 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/presentation-api/controlling-ua/support/iframe.html b/presentation-api/controlling-ua/support/iframe.html index b061a35271ac26..a37f0fcd8e0aa8 100644 --- a/presentation-api/controlling-ua/support/iframe.html +++ b/presentation-api/controlling-ua/support/iframe.html @@ -17,8 +17,18 @@ return '../' + url; } }); - var request = new PresentationRequest(urls); - if (ev.data === 'start') { + var request = null; + if (ev.data === 'create') { + try { + request = new PresentationRequest(urls); + parent.window.postMessage('success', '*'); + } + catch (err) { + parent.window.postMessage(err.name, '*'); + } + } + else if (ev.data === 'start') { + request = new PresentationRequest(urls); request.start() .then(function () { parent.window.postMessage('success', '*'); @@ -38,6 +48,7 @@ }); } else if (ev.data === 'reconnect') { + request = new PresentationRequest(urls); request.reconnect('someid') .then(function () { parent.window.postMessage('success', '*'); @@ -47,6 +58,7 @@ }); } else if (ev.data === 'getAvailability') { + request = new PresentationRequest(urls); request.getAvailability() .then(function () { parent.window.postMessage('success', '*');