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 @@ -
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', '*');