Electrolysis/e10s test tips: Difference between revisions

Be clearer about contentWindow and contentDocument
(Beginning of a page with tips for making tests e10s compatible)
 
(Be clearer about contentWindow and contentDocument)
Line 33: Line 33:


== Browser-chrome ==
== Browser-chrome ==
* Use BrowserTestUtils!
* Use <code>BrowserTestUtils</code>!
** Lots of examples in the tree.
** Lots of examples in the tree.
** This + ContentTask.spawn make for nice control flow.
** This + <code>ContentTask.spawn</code> make for nice control flow.
** Can also use <code>browser.messageManager.loadFrameScript("data:,(" + fn.toString() + ")()")</code>
** Can also use <code>browser.messageManager.loadFrameScript("data:,(" + fn.toString() + ")()")</code>


* browser.contentWindow/contentDocument
* <code>browser.contentWindow/contentDocument</code>
** Sometimes "works" due to CPOWs.
** Tests that use this are asking to fail!
** Probably better to use ContentTask.spawn to retrieve needed information.
** Replace uses with <code>ContentTask.spawn</code> to retrieve needed information.
118

edits