Permalink
Browse files

Test for callback context

  • Loading branch information...
1 parent 0f25574 commit 04f1b2caed1222fd378a351673501a9fa3083d11 @iangreenleaf iangreenleaf committed Apr 9, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 test/jsdom/index.js
View
@@ -1062,7 +1062,8 @@ document.write("<SCR"+"IPT TYPE=\'text/javascript\' SRC=\'...\'><\/SCR"+"IPT>");
"<head></head>" +
"<body>" +
" <div onclick='window.divClicked = true;'" +
- " onmouseover='window.divMousedOver = true;'>" +
+ " onmouseover='window.divMousedOver = true;'" +
+ " onmouseout='window.divCalledFrom = this.tagName;'>" +
" <a></a>" +
" </div>" +
"</body>" +
@@ -1084,6 +1085,11 @@ document.write("<SCR"+"IPT TYPE=\'text/javascript\' SRC=\'...\'><\/SCR"+"IPT>");
div.dispatchEvent(mouseOver);
test.equal(window.divMousedOver, true);
+ var mouseOut = doc.createEvent('MouseEvents');
+ mouseOut.initMouseEvent('mouseout', false, false);
+ div.dispatchEvent(mouseOut);
+ test.equal(window.divMousedCalledFrom, "DIV");
+
test.done();
},

0 comments on commit 04f1b2c

Please sign in to comment.