aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2014-03-18 20:55:50 +0100
committerMichał Gołębiowski <m.goleb@gmail.com>2014-03-18 20:55:50 +0100
commit14e0a632a04e114dbf6cc044e74c3260c7f28a7f (patch)
treefba38cf4d0fc170e9676d8cb3a91f9b149343fec /test
parentb5074944b0b27f50ffe2ca9f96348b8d0cd5c82c (diff)
downloadjquery-14e0a632a04e114dbf6cc044e74c3260c7f28a7f.tar.gz
jquery-14e0a632a04e114dbf6cc044e74c3260c7f28a7f.zip
Event: Don't test stopImmediatePropagation in Android 2.3
Android 2.3 doesn't support stopImmediatePropagation; jQuery fallbacks to stopPropagation in such a case.
Diffstat (limited to 'test')
-rw-r--r--test/unit/event.js27
1 files changed, 19 insertions, 8 deletions
diff --git a/test/unit/event.js b/test/unit/event.js
index e8cfd715c..6e5a2d09e 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -387,7 +387,13 @@ test("on immediate propagation", function() {
});
test("on bubbling, isDefaultPrevented, stopImmediatePropagation", function() {
- expect( 3 );
+ // Support: Android 2.3
+ if ( /android 2\.3/i.test( navigator.userAgent ) ) {
+ expect( 2 );
+ } else {
+ expect( 3 );
+ }
+
var $anchor2 = jQuery( "#anchor2" ),
$main = jQuery( "#qunit-fixture" ),
neverCallMe = function() {
@@ -418,13 +424,18 @@ test("on bubbling, isDefaultPrevented, stopImmediatePropagation", function() {
$anchor2.off( "click" );
$main.off( "click", "**" );
- $anchor2.on( "click", function( e ) {
- e.stopImmediatePropagation();
- ok( true, "anchor was clicked and prop stopped" );
- });
- $anchor2[0].addEventListener( "click", neverCallMe, false );
- fakeClick( $anchor2 );
- $anchor2[0].removeEventListener( "click", neverCallMe );
+ // Android 2.3 doesn't support stopImmediatePropagation; jQuery fallbacks to stopPropagation
+ // in such a case.
+ // Support: Android 2.3
+ if ( !/android 2\.3/i.test( navigator.userAgent ) ) {
+ $anchor2.on( "click", function( e ) {
+ e.stopImmediatePropagation();
+ ok( true, "anchor was clicked and prop stopped" );
+ });
+ $anchor2[0].addEventListener( "click", neverCallMe, false );
+ fakeClick( $anchor2 );
+ $anchor2[0].removeEventListener( "click", neverCallMe );
+ }
});
test("on(), iframes", function() {