Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1152)

Unified Diff: content/test/data/media/peerconnection-call.html

Issue 1161403002: Relanding WebRTC peerconnection iframe test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing indent Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/media/webrtc_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3c782bfe21c4221600368fae55976b2c3c107c23 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);
+
+ func(iframe);
+ }
+ }
+
// This function is used for setting up a test that:
// 1. Creates a data channel on |gFirstConnection| and sends data to
// |gSecondConnection|.
« no previous file with comments | « content/browser/media/webrtc_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698