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><metacharset="utf-8"><title>Test for bug 1730284 (throttling of same-origin iframes)</title><scriptsrc="/tests/SimpleTest/SimpleTest.js"></script><linkrel="stylesheet"href="/tests/SimpleTest/test.css"><style>iframe{width:10px;height:10px;}.display-none{display:none;}.vis-hidden{visibility:hidden}.transparent{opacity:0;}.zero-size{width:0;height:0;border:0;}.offscreen{position:absolute;top:500%;}.scroller{height:100px;overflow:auto;}.scroller-padding{height:500px;}</style><iframeclass="visible"></iframe><iframeclass="display-none"data-throttled-expected></iframe><iframeclass="vis-hidden"data-throttled-expected></iframe><iframeclass="transparent"></iframe><iframeclass="zero-size"></iframe><divclass="scroller"><divclass="scroller-padding"></div><iframeclass="scrolled-out-of-view"data-throttled-expected></iframe></div><iframeclass="offscreen"data-throttled-expected></iframe><iframeclass="offscreen zero-size"data-throttled-expected></iframe><iframeclass="offscreen vis-hidden"data-throttled-expected></iframe><iframeclass="offscreen transparent"data-throttled-expected></iframe><script>asyncfunctionassertThrottled(win,shouldThrottle,msg){if(isXOrigin){// In XOrigin mode we need to depend as well on the main process having// painted the cross-origin iframe at least once for coordinates to be// correct.awaitSimpleTest.promiseWaitForCondition(()=>{returnSpecialPowers.getDOMWindowUtils(win).effectivelyThrottlesFrameRequests==shouldThrottle;},msg);}is(SpecialPowers.getDOMWindowUtils(win).effectivelyThrottlesFrameRequests,shouldThrottle,msg);}add_task(asyncfunction(){awaitSimpleTest.promiseFocus(window);awaitassertThrottled(window,false,"Should not be throttling main page");for(letframeofdocument.querySelectorAll("iframe")){letshouldThrottle=frame.getAttribute("data-throttled-expected")!==null;awaitassertThrottled(frame.contentWindow,shouldThrottle,frame.className);}});</script>