1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/xpconnect/tests/mochitest/test_bug691059.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,57 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=691059 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 691059</title> 1.11 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.13 +</head> 1.14 +<body> 1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=691059">Mozilla Bug 691059</a> 1.16 +<p id="display"></p> 1.17 +<div id="content" style="display: none"> 1.18 + 1.19 +</div> 1.20 +<pre id="test"> 1.21 +<script type="application/javascript"> 1.22 + 1.23 + 1.24 +/** Test for Bug 691059 **/ 1.25 + 1.26 +function f() {} 1.27 + 1.28 +function testEventTarget(obj) { 1.29 + obj.onmouseenter = f; 1.30 + is(obj.onmouseenter, f, 1.31 + "onmouseenter should be settable"); 1.32 + obj.onmouseleave = f; 1.33 + is(obj.onmouseleave, f, 1.34 + "onmouseenter should be settable"); 1.35 +} 1.36 + 1.37 +function testInterface(obj) { 1.38 + try { 1.39 + obj.prototype.onmouseenter = f; 1.40 + is(obj.onmouseenter, null, 1.41 + "prototype.onmouseenter should be settable, but the value should stay null"); 1.42 + obj.prototype.onmouseleave = f; 1.43 + is(obj.onmouseleave, null, 1.44 + "prototype.onmouseleave should be settable, but the value should stay null"); 1.45 + } catch(ex) { 1.46 + ok(false, ex); 1.47 + } 1.48 +} 1.49 + 1.50 +testEventTarget(window); 1.51 +testEventTarget(document); 1.52 +testEventTarget(document.documentElement); 1.53 + 1.54 +testInterface(Document); 1.55 +testInterface(HTMLElement); 1.56 + 1.57 +</script> 1.58 +</pre> 1.59 +</body> 1.60 +</html>