diff -r 000000000000 -r 6474c204b198 testing/mochitest/mochitest-e10s-utils-content.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testing/mochitest/mochitest-e10s-utils-content.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,16 @@ +// This is the content script for mochitest-e10s-utils + +// We hook up some events and forward them back to the parent for the tests +// This is only a partial solution to tests using these events - tests which +// check, eg, event.target is the content window are still likely to be +// confused. +// But it's a good start... +["load", "DOMContentLoaded", "pageshow"].forEach(eventName => { + addEventListener(eventName, function eventHandler(event) { + // Some tests also rely on load events from, eg, iframes, so we should see + // if we can do something sane to support that too. + if (event.target == content.document) { + sendAsyncMessage("Test:Event", {name: event.type}); + } + }, true); +});