Chromium Code Reviews| Index: content/test/data/media/peerconnection-call.html |
| diff --git a/content/test/data/media/peerconnection-call.html b/content/test/data/media/peerconnection-call.html |
| index 12ae9ef8711eb5141cde29943da5e26e24e81857..ea59738faa42728d5bf9ae1054cfaa34e301cc84 100644 |
| --- a/content/test/data/media/peerconnection-call.html |
| +++ b/content/test/data/media/peerconnection-call.html |
| @@ -551,6 +551,33 @@ |
| }); |
| } |
| + // Loads this page inside itself using an iframe, and ensures we can make a |
| + // successful getUserMedia + peerconnection call inside the iframe. |
| + function callInsideIframe(constraints) { |
| + runInsideIframe(function(iframe) { |
| + // Run a regular webrtc call inside the iframe. |
| + iframe.contentWindow.call(constraints); |
| + }); |
| + } |
| + |
| + // Func should accept an iframe as its first argument. |
| + function runInsideIframe(func) { |
| + var iframe = document.createElement('iframe'); |
| + document.body.appendChild(iframe); |
| + iframe.onload = onIframeLoaded; |
| + iframe.src = window.location; |
| + |
| + function onIframeLoaded() { |
| + var iframe = window.document.querySelector('iframe'); |
| + |
| + // Propagate test success out of the iframe. |
| + iframe.contentWindow.setAllEventsOccuredHandler( |
| + window.parent.reportTestSuccess); |
|
kjellander_chromium
2015/06/03 07:57:36
nit: +2 spaces indent
phoglund_chromium
2015/06/03 08:31:53
Done.
|
| + |
| + func(iframe); |
| + } |
| + } |
| + |
| // This function is used for setting up a test that: |
| // 1. Creates a data channel on |gFirstConnection| and sends data to |
| // |gSecondConnection|. |