aboutsummaryrefslogtreecommitdiffstats
path: root/test/data
diff options
context:
space:
mode:
authortimmywil <timmywillisn@gmail.com>2011-10-28 14:17:14 -0400
committertimmywil <timmywillisn@gmail.com>2011-10-28 14:17:14 -0400
commit38f087b5ae86faba941426437c3fd1d746de9be1 (patch)
tree9eca3296e9a0f0efda94f644b5e000ba45224b29 /test/data
parentfa0e801f52cdc97832ef0b696caa1eda33fc6b36 (diff)
downloadjquery-38f087b5ae86faba941426437c3fd1d746de9be1.tar.gz
jquery-38f087b5ae86faba941426437c3fd1d746de9be1.zip
Add a way to fire native events using dispatchEvent/fireEvent in testinit.js; fixes failing click test in FF3.6
Diffstat (limited to 'test/data')
-rw-r--r--test/data/testinit.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/data/testinit.js b/test/data/testinit.js
index 7d566faa5..ac97e181a 100644
--- a/test/data/testinit.js
+++ b/test/data/testinit.js
@@ -2,7 +2,7 @@ var jQuery = this.jQuery || "jQuery", // For testing .noConflict()
$ = this.$ || "$",
originaljQuery = jQuery,
original$ = $,
- amdDefined;
+ amdDefined;
/**
* Set up a mock AMD define function for testing AMD registration.
@@ -44,6 +44,20 @@ function t(a,b,c) {
same(f, q.apply(q,c), a + " (" + b + ")");
}
+var fireNative;
+if ( document.createEvent ) {
+ fireNative = function( node, type ) {
+ var event = document.createEvent('HTMLEvents');
+ event.initEvent( type, true, true );
+ node.dispatchEvent( event );
+ };
+} else {
+ fireNative = function( node, type ) {
+ var event = document.createEventObject();
+ node.fireEvent( 'on' + type, event );
+ };
+}
+
/**
* Add random number to url to stop IE from caching
*