Skip to content

Commit 2e38938

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 Fixes gh-1786
1 parent dc8ba6a commit 2e38938

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
@@ -1440,6 +1440,15 @@ module( "ajax", {
14401440
});
14411441

14421442
asyncTest( "#11743 - jQuery.ajax() - script, throws exception", 1, function() {
1443+
// Support: Android 2.3 only
1444+
// Android 2.3 doesn't fire the window.onerror handler, just accept the reality there.
1445+
if ( /android 2\.3/i.test( navigator.userAgent ) ) {
1446+
ok( true, "Test skipped, Android 2.3 doesn't fire window.onerror for " +
1447+
"errors in dynamically included scripts" );
1448+
start();
1449+
return;
1450+
}
1451+
14431452
var onerror = window.onerror;
14441453
window.onerror = function() {
14451454
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)