Skip to content

Commit b3eb2a1

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. (cherry-picked from 6044fb6) Refs gh-1573 Refs gh-1786 Refs jquery/jquery.com#108 Closes gh-2458
1 parent d176001 commit b3eb2a1

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

test/unit/ajax.js

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

14871487
asyncTest( "#11743 - jQuery.ajax() - script, throws exception", 1, function() {
1488+
// Support: Android 2.3 only
1489+
// Android 2.3 doesn't fire the window.onerror handler, just accept the reality there.
1490+
if ( /android 2\.3/i.test( navigator.userAgent ) ) {
1491+
ok( true, "Test skipped, Android 2.3 doesn't fire window.onerror for " +
1492+
"errors in dynamically included scripts" );
1493+
start();
1494+
return;
1495+
}
1496+
14881497
var onerror = window.onerror;
14891498
window.onerror = function() {
14901499
ok( true, "Exception thrown" );

test/unit/manipulation.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2304,6 +2304,16 @@ test( "Ensure oldIE creates a new set on appendTo (#8894)", function() {
23042304
});
23052305

23062306
asyncTest( "html() - script exceptions bubble (#11743)", 2, function() {
2307+
// Support: Android 2.3 only
2308+
// Android 2.3 doesn't fire the window.onerror handler, just accept the reality there.
2309+
if ( /android 2\.3/i.test( navigator.userAgent ) ) {
2310+
ok( true, "Test skipped, Android 2.3 doesn't fire window.onerror for " +
2311+
"errors in dynamically included scripts" );
2312+
ok( true, "Test skipped, Android 2.3 doesn't fire window.onerror for " +
2313+
"errors in dynamically included scripts" );
2314+
start();
2315+
return;
2316+
}
23072317

23082318
var onerror = window.onerror;
23092319

0 commit comments

Comments
 (0)