mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 08:35:26 +00:00
342883de53
--HG-- rename : extensions/universalchardet/tests/bug631751be_text.html => parser/htmlparser/tests/mochitest/file_bug672453_bomless_utf16.html
99 lines
2.6 KiB
HTML
99 lines
2.6 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<!--
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=489671
|
|
-->
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Test for Bug 489671</title>
|
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
</head>
|
|
<body>
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=489671">Mozilla Bug 489671</a>
|
|
<p id="display" onclick="throw 'Got click'"></p>
|
|
<div id="content" style="display: none">
|
|
|
|
</div>
|
|
<pre id="test">
|
|
<script type="application/javascript">
|
|
|
|
/** Test for Bug 489671 **/
|
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
|
|
|
const Cc = Components.classes;
|
|
const Ci = Components.interfaces;
|
|
const Cr = Components.results;
|
|
|
|
var listener = {
|
|
observe: function(message) {
|
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
|
|
|
is(message.QueryInterface(Ci.nsIScriptError).errorMessage,
|
|
"uncaught exception: Got click");
|
|
SimpleTest.executeSoon(nextTest);
|
|
},
|
|
|
|
QueryInterface: function(iid) {
|
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
|
if (iid.equals(Ci.nsIConsoleListener) ||
|
|
iid.equals(Ci.nsISupports)) {
|
|
return this;
|
|
}
|
|
throw Cr.NS_NOINTERFACE;
|
|
}
|
|
};
|
|
|
|
|
|
function addListener() {
|
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
|
var consoleService =
|
|
Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService);
|
|
consoleService.reset();
|
|
consoleService.registerListener(listener);
|
|
}
|
|
|
|
function removeListener() {
|
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
|
var consoleService =
|
|
Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService);
|
|
consoleService.unregisterListener(listener);
|
|
}
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
addListener();
|
|
// override window.onerror so it won't see our exceptions
|
|
window.onerror = function() {}
|
|
|
|
var testNum = 0;
|
|
function nextTest() {
|
|
switch(testNum++) {
|
|
case 0:
|
|
var event = document.createEvent("MouseEvents");
|
|
event.initMouseEvent("click", true, true, document.defaultView,
|
|
0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
|
$("display").dispatchEvent(event);
|
|
break;
|
|
case 1:
|
|
var script = document.createElement("script");
|
|
script.textContent = "throw 'Got click'";
|
|
document.body.appendChild(script);
|
|
break;
|
|
case 2:
|
|
window.setTimeout("throw 'Got click'", 0);
|
|
break;
|
|
case 3:
|
|
removeListener();
|
|
SimpleTest.finish();
|
|
break;
|
|
}
|
|
}
|
|
|
|
nextTest();
|
|
|
|
</script>
|
|
</pre>
|
|
</body>
|
|
</html>
|