mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 23:30:46 +00:00

This is split from the previous changeset since if we include dom/ the file size is too large for phabricator to handle. This is an autogenerated commit to handle scripts loading mochitest harness files, in the simple case where the script src is on the same line as the tag. This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170 using the `--part 2` argument. Differential Revision: https://phabricator.services.mozilla.com/D27457 --HG-- extra : moz-landing-system : lando
43 lines
1023 B
HTML
43 lines
1023 B
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Test Console binding</title>
|
|
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
</head>
|
|
<body>
|
|
<script type="application/javascript">
|
|
|
|
function consoleListener() {
|
|
SpecialPowers.addObserver(this, "console-api-log-event");
|
|
}
|
|
|
|
var order = 0;
|
|
consoleListener.prototype = {
|
|
observe(aSubject, aTopic, aData) {
|
|
if (aTopic == "console-api-log-event") {
|
|
var obj = aSubject.wrappedJSObject;
|
|
ok(!obj.chromeContext, "Thils is not a chrome context");
|
|
if (order + 1 == parseInt(obj.arguments[0])) {
|
|
ok(true, "Message received: " + obj.arguments[0]);
|
|
order++;
|
|
}
|
|
|
|
if (order == 3) {
|
|
SpecialPowers.removeObserver(this, "console-api-log-event");
|
|
SimpleTest.finish();
|
|
}
|
|
}
|
|
},
|
|
};
|
|
|
|
var cl = new consoleListener();
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
[1, 2, 3].forEach(console.log);
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|