<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Thanks Alex!<div class="">Yura<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 9, 2020, at 1:57 PM, Mike Conley <<a href="mailto:mconley@mozilla.com" class="">mconley@mozilla.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">This is really nice, thanks so much asurkov! I think this will make writing tests, especially Fission-exercising ones, easier.<br class=""></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 9 Jan 2020 at 13:55, Alexander Surkov <<a href="mailto:surkov.alexander@gmail.com" class="">surkov.alexander@gmail.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class=""><div class="">Hi.</div><div class=""><br class=""></div><div class="">Here's a small feature for those who deals with fission automated testing.<br class=""></div><div class=""><br class=""></div><div class="">Some background: when you design a fission compatible test, you often need to put content into out-of-process iframe to trigger a certain code path. The only way to do this is to use iframe URL of a different origin other than the test document has itself. For example <iframe src='<a href="http://example.com/" target="_blank" class="">http://example.com</a>'> will put iframe into a separate process when fission is on.<br class=""></div><div class=""><br class=""></div><div class="">If you need to put a custom document into out-of-process iframe, then the following technique is widely used: create html file and then refer it from URL, for example:</div><div class=""><iframe src='<a href="http://example.com/path_to_file" target="_blank" class="">http://example.com/path_to_file</a>'></div><div class=""><br class=""></div><div class="">It works nicely, but you have to have a file and it adds some overhead. When it comes to no fission testing, then people prefer to use data URLs, especially when a code snippet size is reasonably small. Apparently, you cannot use data URL in the fission world because iframe document is not loaded into a separate process in this case.</div><div class=""><br class=""></div><div class="">The idea to workaround the issue is to use sjs script which takes a code snippet and feeds it to iframe. The script was implemented by yzen and was used in accessibility for a while, but recently it was ported to the mochitest suite (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1601733" target="_blank" class="">https://bugzilla.mozilla.org/show_bug.cgi?id=1601733</a>). So now you can do things like:</div><div class=""><br class=""></div><div class=""><iframe src='<a href="http://example.com/document-builder.sjs?html=" target="_blank" class="">http://example.com/document-builder.sjs?html=</a><input>'></div><div class=""><br class=""></div><div class="">Thanks!</div><div class="">Alexander.</div><div class=""><br class=""></div></div>
_______________________________________________<br class="">
firefox-dev mailing list<br class="">
<a href="mailto:firefox-dev@mozilla.org" target="_blank" class="">firefox-dev@mozilla.org</a><br class="">
<a href="https://mail.mozilla.org/listinfo/firefox-dev" rel="noreferrer" target="_blank" class="">https://mail.mozilla.org/listinfo/firefox-dev</a><br class="">
</blockquote></div>
_______________________________________________<br class="">firefox-dev mailing list<br class=""><a href="mailto:firefox-dev@mozilla.org" class="">firefox-dev@mozilla.org</a><br class="">https://mail.mozilla.org/listinfo/firefox-dev<br class=""></div></blockquote></div><br class=""></div></body></html>