Skip to content

Commit 6044fb6

Browse files
committed
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. Refs gh-1573 Refs gh-1786 Refs jquery/jquery.com#108 Closes gh-2458
1 parent 2792845 commit 6044fb6

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

test/unit/ajax.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,6 +1450,15 @@ module( "ajax", {
14501450
});
14511451

14521452
asyncTest( "#11743 - jQuery.ajax() - script, throws exception", 1, function() {
1453+
// Support: Android 2.3 only
1454+
// Android 2.3 doesn't fire the window.onerror handler, just accept the reality there.
1455+
if ( /android 2\.3/i.test( navigator.userAgent ) ) {
1456+
ok( true, "Test skipped, Android 2.3 doesn't fire window.onerror for " +
1457+
"errors in dynamically included scripts" );
1458+
start();
1459+
return;
1460+
}
1461+
14531462
var onerror = window.onerror;
14541463
window.onerror = function() {
14551464
ok( true, "Exception thrown" );

test/unit/manipulation.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2241,6 +2241,17 @@ test( "Ensure oldIE creates a new set on appendTo (#8894)", function() {
22412241
});
22422242

22432243
asyncTest( "html() - script exceptions bubble (#11743)", 2, function() {
2244+
// Support: Android 2.3 only
2245+
// Android 2.3 doesn't fire the window.onerror handler, just accept the reality there.
2246+
if ( /android 2\.3/i.test( navigator.userAgent ) ) {
2247+
ok( true, "Test skipped, Android 2.3 doesn't fire window.onerror for " +
2248+
"errors in dynamically included scripts" );
2249+
ok( true, "Test skipped, Android 2.3 doesn't fire window.onerror for " +
2250+
"errors in dynamically included scripts" );
2251+
start();
2252+
return;
2253+
}
2254+
22442255
var onerror = window.onerror;
22452256

22462257
setTimeout(function() {

0 commit comments

Comments
 (0)