aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2014-05-05 20:04:03 +0200
committerMichał Gołębiowski <m.goleb@gmail.com>2015-07-28 13:24:32 +0200
commitb3eb2a13cd51133f56ed3d6755f985cea87a062d (patch)
tree4c2a958470b5340a76ce781adf0c2fa68d79c5ed
parentd176001e6e4f0dda877ae17f56277f9ec8e30c9a (diff)
downloadjquery-b3eb2a13cd51133f56ed3d6755f985cea87a062d.tar.gz
jquery-b3eb2a13cd51133f56ed3d6755f985cea87a062d.zip
Ajax: Account for Android 2.3 not firing window.onerror on script errors
Android 2.3 doesn't fire the window.onerror handler, just accept the reality there and skip the test. (cherry-picked from 6044fb6a7384aec85906949835ef9a58114896ce) Refs gh-1573 Refs gh-1786 Refs jquery/jquery.com#108 Closes gh-2458
-rw-r--r--test/unit/ajax.js9
-rw-r--r--test/unit/manipulation.js10
2 files changed, 19 insertions, 0 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index f9c5e0ed3..e934b22b1 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -1485,6 +1485,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" );
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js
index 5edbe294b..8db5ca924 100644
--- a/test/unit/manipulation.js
+++ b/test/unit/manipulation.js
@@ -2304,6 +2304,16 @@ 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;