]> source.dussan.org Git - jquery.git/commitdiff
Ajax: Account for Android 2.3 not firing window.onerror on script errors
authorMichał Gołębiowski <m.goleb@gmail.com>
Mon, 5 May 2014 18:04:03 +0000 (20:04 +0200)
committerMichał Gołębiowski <m.goleb@gmail.com>
Tue, 28 Jul 2015 11:20:20 +0000 (13:20 +0200)
Android 2.3 doesn't fire the window.onerror handler, just accept the reality
there and skip the test.

Refs gh-1573
Refs gh-1786
Refs jquery/jquery.com#108
Closes gh-2458

test/unit/ajax.js
test/unit/manipulation.js

index 359fa9d8193bf44a4929d6ebb92971ad9c3068ee..e216f34a238562cf2f6b4504b1bb57f8b54a0510 100644 (file)
@@ -1450,6 +1450,15 @@ module( "ajax", {
        });
 
        asyncTest( "#11743 - jQuery.ajax() - script, throws exception", 1, function() {
+               // Support: Android 2.3 only
+               // Android 2.3 doesn't fire the window.onerror handler, just accept the reality there.
+               if ( /android 2\.3/i.test( navigator.userAgent ) ) {
+                       ok( true, "Test skipped, Android 2.3 doesn't fire window.onerror for " +
+                               "errors in dynamically included scripts" );
+                       start();
+                       return;
+               }
+
                var onerror = window.onerror;
                window.onerror = function() {
                        ok( true, "Exception thrown" );
index 5a84520118830b5702e115b23b709c02c20e1780..c1dac6993f99e5578ab6a6d62d8f484645633690 100644 (file)
@@ -2241,6 +2241,17 @@ test( "Ensure oldIE creates a new set on appendTo (#8894)", function() {
 });
 
 asyncTest( "html() - script exceptions bubble (#11743)", 2, function() {
+       // Support: Android 2.3 only
+       // Android 2.3 doesn't fire the window.onerror handler, just accept the reality there.
+       if ( /android 2\.3/i.test( navigator.userAgent ) ) {
+               ok( true, "Test skipped, Android 2.3 doesn't fire window.onerror for " +
+                       "errors in dynamically included scripts" );
+               ok( true, "Test skipped, Android 2.3 doesn't fire window.onerror for " +
+                       "errors in dynamically included scripts" );
+               start();
+               return;
+       }
+
        var onerror = window.onerror;
 
        setTimeout(function() {