@@ -98,6 +98,20 @@ window.addEventListener("load", () => {
9898 /** @type {HTMLIFrameElement } */
9999 const iframeAllowSameOrigin = document . getElementById ( 'iframe-allow-same-origin' ) ;
100100 const iframeAllowSameOriginWindow = iframeAllowSameOrigin ?. contentWindow ;
101+ // This test is specifically designed to get the RTCPeerConnection object
102+ // before the injected script on android is run.
103+ // The script injected into Android's WebView from Tauri
104+ // only runs once the page is loaded, compared to other targets
105+ // where the injected script is run immediately
106+ // after the iframe is constructed, before yeilding back to the JS
107+ // on the parent page which created the iframe.
108+ const iframeContainer = document . getElementById ( "iframe-container" ) ;
109+ /** @type {Window | undefined } */
110+ let iframeNotInitedWindow
111+ if ( iframeContainer ) {
112+ iframeContainer . innerHTML += "<iframe id=uninitiframe></iframe>"
113+ iframeNotInitedWindow = uninitiframe . contentWindow ;
114+ }
101115 const tests = [
102116 [ "RTCPeerConnection" , window . RTCPeerConnection ] ,
103117 [ "mozRTCPeerConnection" , window . mozRTCPeerConnection ] ,
@@ -108,6 +122,9 @@ window.addEventListener("load", () => {
108122 [ "iframe regular RTCPeerConnection" , iframeRegularWindow ?. RTCPeerConnection ] ,
109123 [ "iframe regular mozRTCPeerConnection" , iframeRegularWindow ?. mozRTCPeerConnection ] ,
110124 [ "iframe regular webkitRTCPeerConnection" , iframeRegularWindow ?. webkitRTCPeerConnection ] ,
125+ [ "iframe regular uninitialized RTCPeerConnection" , iframeNotInitedWindow ?. RTCPeerConnection ] ,
126+ [ "iframe regular uninitialized mozRTCPeerConnection" , iframeNotInitedWindow ?. mozRTCPeerConnection ] ,
127+ [ "iframe regular uninitialized webkitRTCPeerConnection" , iframeNotInitedWindow ?. webkitRTCPeerConnection ] ,
111128 ] ;
112129 const elements = [ ] ;
113130 const testPromises = [ ] ;
0 commit comments