Chromium Code Reviews| Index: content/test/data/media/getusermedia.html |
| diff --git a/content/test/data/media/getusermedia.html b/content/test/data/media/getusermedia.html |
| index f194e1a57d98329a45543d087e5c669345e7254b..1decc3066e6d2b13f21b98fc6a2618a7f964a0f8 100644 |
| --- a/content/test/data/media/getusermedia.html |
| +++ b/content/test/data/media/getusermedia.html |
| @@ -281,6 +281,48 @@ |
| } |
| } |
| + function getUserMediaInIframeAndCloseInSuccessCb(constraints) { |
| + var iframe = document.createElement('iframe'); |
| + iframe.onload = onIframeLoaded; |
| + document.body.appendChild(iframe); |
| + iframe.src = window.location; |
| + |
| + function onIframeLoaded() { |
| + var iframe = window.document.querySelector('iframe'); |
| + iframe.contentWindow.navigator.webkitGetUserMedia( |
| + constraints, |
| + function (stream) { |
| + console.log("getUserMedia succeeded."); |
|
phoglund_chromium
2015/04/10 09:47:58
Remove.
perkj_chrome
2015/04/10 09:57:29
Done.
|
| + // Remove the iframe from the parent within the callback scope. |
| + window.parent.document.querySelector('iframe').remove(); |
| + window.parent.reportTestSuccess(); |
| + }, |
| + window.parent.failedCallback); |
| + } |
| + } |
| + |
| + function getUserMediaInIframeAndCloseInFailureCb(constraints) { |
| + var iframe = document.createElement('iframe'); |
| + iframe.onload = onIframeLoaded; |
| + document.body.appendChild(iframe); |
| + iframe.src = window.location; |
| + |
| + function onIframeLoaded() { |
| + var iframe = window.document.querySelector('iframe'); |
| + iframe.contentWindow.navigator.webkitGetUserMedia( |
| + constraints, |
| + function (stream) { |
| + window.parent.failTest('GetUserMedia call succeeded unexpectedly.'); |
| + }, |
| + function (error) { |
| + console.log("getUserMedia failed."); |
|
phoglund_chromium
2015/04/10 09:47:58
Remove.
perkj_chrome
2015/04/10 09:57:29
Done.
|
| + // Remove the iframe from the parent within the callback scope. |
| + window.parent.document.querySelector('iframe').remove(); |
| + window.parent.reportTestSuccess(); |
| + }); |
| + } |
| + } |
| + |
| function failedCallback(error) { |
| failTest('GetUserMedia call failed with code ' + error.code); |
| } |