gecko-dev/testing/mochitest/redirect.html
Andrew Halberstadt 795728d89d Bug 1293295 - Replace all mochitest 'flavor' options with a single --flavor argument, r=jmaher
This accomplishes three things:

1) Easier to use CLI when running without the benefit of testing/mochitest/mach_commands.py
2) Guarantees these arguments are mutually exclusive
3) Simplifies a bunch of logic in the test harness

The primary motivation for this change is to slightly improve the UX when running mochitest
from a taskcluster interactive loaner. However, this is more of a bandaid solution that was
easy to implement before the proper fix in bug 1293259 can be landed.

MozReview-Commit-ID: IeHBGrJ0Sji

--HG--
extra : rebase_source : ba1b7e437881e363fe0051dccd3d732221311c59
2016-08-08 11:48:49 -04:00

41 lines
1012 B
HTML

<html>
<head>
<title>redirecting...</title>
<script type="text/javascript">
function redirect(aURL)
{
// We create a listener for this event in browser-test.js which will
// get picked up when specifying --flavor=chrome or --flavor=a11y
var event = new CustomEvent("contentEvent", {
bubbles: true,
detail: {
"data": aURL + location.search,
"type": "loadURI"
}
});
document.dispatchEvent(event);
}
function redirectToHarness()
{
redirect("chrome://mochikit/content/harness.xul");
}
function onLoad() {
// Wait for MozAfterPaint, since the listener in browser-test.js is not
// added until then.
window.addEventListener("MozAfterPaint", function testOnMozAfterPaint() {
window.removeEventListener("MozAfterPaint", testOnMozAfterPaint);
setTimeout(redirectToHarness, 0);
});
}
</script>
</head>
<body onload="onLoad();">
redirecting...
</body>
</html>