diff options
author | Michał Gołębiowski <m.goleb@gmail.com> | 2013-09-07 02:46:55 +0200 |
---|---|---|
committer | Michał Gołębiowski <m.goleb@gmail.com> | 2013-11-11 00:43:27 +0100 |
commit | 4b39a8289031bb7de25e9f018d9fd8235a35ec49 (patch) | |
tree | 1fe8494c0be1e315a81c739d70f7b390823e5eb8 /test/unit/event.js | |
parent | 2ace149f485438e8a3af6650f3bb18c1c22e48b6 (diff) | |
download | jquery-4b39a8289031bb7de25e9f018d9fd8235a35ec49.tar.gz jquery-4b39a8289031bb7de25e9f018d9fd8235a35ec49.zip |
Fix #14340. Remove remnants of oldIE from unit tests. Close gh-1425.
Diffstat (limited to 'test/unit/event.js')
-rw-r--r-- | test/unit/event.js | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/test/unit/event.js b/test/unit/event.js index 225a22068..91ac98007 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -392,28 +392,15 @@ test("on bubbling, isDefaultPrevented", function() { $main = jQuery( "#qunit-fixture" ), fakeClick = function($jq) { // Use a native click so we don't get jQuery simulated bubbling - if ( document.createEvent ) { - var e = document.createEvent( "MouseEvents" ); - e.initEvent( "click", true, true ); - $jq[0].dispatchEvent(e); - } - else if ( $jq[0].click ) { - $jq[0].click(); // IE - } + var e = document.createEvent( "MouseEvents" ); + e.initEvent( "click", true, true ); + $jq[ 0 ].dispatchEvent( e ); }; $anchor2.on( "click", function(e) { e.preventDefault(); }); - $main.on("click", "#foo", function(e) { - var orig = e.originalEvent; - - if ( typeof(orig.defaultPrevented) === "boolean" || typeof(orig.returnValue) === "boolean" || orig["getPreventDefault"] ) { - equal( e.isDefaultPrevented(), true, "isDefaultPrevented true passed to bubbled event" ); - - } else { - // Opera < 11 doesn't implement any interface we can use, so give it a pass - ok( true, "isDefaultPrevented not supported by this browser, test skipped" ); - } + $main.on( "click", "#foo", function( e ) { + equal( e.isDefaultPrevented(), true, "isDefaultPrevented true passed to bubbled event" ); }); fakeClick( $anchor2 ); $anchor2.off( "click" ); @@ -1224,8 +1211,6 @@ test("trigger(eventObject, [data], [fn])", function() { equal( event.isDefaultPrevented(), false, "default not prevented" ); }); -// Explicitly introduce global variable for oldIE so QUnit doesn't complain if checking globals -window.onclick = undefined; test(".trigger() bubbling on disconnected elements (#10489)", function() { expect(2); |