Bug 1973726 - Set DOM file path for webkitRelativePath. r=sefeng,geckoview-reviewers,webidl,smaug,ohall
Actually, there is no way to set webkitRelativePath from JavaScript.
Since GeckoView's folder picker handles virtual file data, we need to
set relative path from JavaScript directly.
A content URI of System storage document provider only allow file data
access from file/folder picker, so there is no way to test it on
geckoivew-junit.
Also, after landing bug 1591640, GVE always crash when using folder
picker. So this includes a fix for it.
Differential Revision: https://phabricator.services.mozilla.com/D255615
<!DOCTYPE HTML><html><head><scripttype="application/javascript">varscriptRelativePath="../";</script><scripttype="application/javascript"src="../pc.js"></script></head><body><preid="test"><scripttype="application/javascript">'use strict';createHTML({title:"Identity Provider returning errors is handled correctly",bug:"942367"});runNetworkTest(function(){vartest=newPeerConnectionTest();test.setMediaConstraints([{audio:true}],[{audio:true}]);// No IdP for local.// Remote generates a bad assertion, but that only fails to validatetest.pcRemote.setIdentityProvider('example.com',{protocol:'idp.js#bad-validate',usernameHint:'nobody'});// Save the peerIdentity promises now, since when they reject they are// replaced and we expect them to be rejected this timevarpeerIdentityLocal=test.pcLocal._pc.peerIdentity;varpeerIdentityRemote=test.pcRemote._pc.peerIdentity;test.chain.append([functionONLY_REMOTE_SDP_INCLUDES_IDENTITY_ASSERTION(t){ok(!t.originalOffer.sdp.includes('a=identity'),'a=identity not contained in the offer SDP');ok(t.originalAnswer.sdp.includes('a=identity'),'a=identity is contained in the answer SDP');},functionPEER_IDENTITY_IS_EMPTY(t){// we are only waiting for the local side to complete// an error on the remote side is immediately fatal thoughreturnPromise.race([peerIdentityLocal.then(()=>ok(false,t.pcLocal+' incorrectly received valid peer identity'),e=>ok(e,t.pcLocal+' correctly failed to validate peer identity')),peerIdentityRemote.then(()=>ok(false,t.pcRemote+' incorrecly received a valid peer identity'),e=>ok(false,t.pcRemote+' incorrectly rejected peer identity'))]);}]);returntest.run();});</script></pre></body></html>