aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2014-10-27 18:36:07 +0100
committerMichał Gołębiowski <m.goleb@gmail.com>2014-11-03 18:37:26 +0100
commit740e190223d19a114d5373758127285d14d6b71e (patch)
treef449fdea7a436cdabf7d6f764454887791d010a6 /test/unit
parent758fd6cea9e82f7bfebce07ba6ecf0d107e8a53c (diff)
downloadjquery-740e190223d19a114d5373758127285d14d6b71e.tar.gz
jquery-740e190223d19a114d5373758127285d14d6b71e.zip
Misc: Drop support for older browsers; update support comments
That includes Opera 12.x, Firefox<29, Safari<6.0 and some hacks for old Blackberry. Closes gh-1820 Refs gh-1815
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/ajax.js15
-rw-r--r--test/unit/css.js6
-rw-r--r--test/unit/dimensions.js4
-rw-r--r--test/unit/event.js38
-rw-r--r--test/unit/serialize.js6
-rw-r--r--test/unit/support.js36
6 files changed, 28 insertions, 77 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index d61d6b40d..6f3bacebe 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -1019,9 +1019,6 @@ module( "ajax", {
" (no cache)": false
},
function( label, cache ) {
- // Support: Opera 12.0
- // In Opera 12.0, XHR doesn't notify 304 back to the user properly
- var opera = window.opera && window.opera.version();
jQuery.each(
{
"If-Modified-Since": "if_modified_since.php",
@@ -1041,15 +1038,9 @@ module( "ajax", {
ifModified: true,
cache: cache,
success: function( data, status, jqXHR ) {
- if ( status === "success" && opera === "12.00" ) {
- strictEqual( status, "success", "Opera 12.0: Following status is 'success'" );
- strictEqual( jqXHR.status, 200, "Opera 12.0: XHR status is 200, not 304" );
- strictEqual( data, "", "Opera 12.0: response body is empty" );
- } else {
- strictEqual( status, "notmodified", "Following status is 'notmodified'" );
- strictEqual( jqXHR.status, 304, "XHR status is 304" );
- equal( data, null, "no response body is given" );
- }
+ strictEqual( status, "notmodified", "Following status is 'notmodified'" );
+ strictEqual( jqXHR.status, 304, "XHR status is 304" );
+ equal( data, null, "no response body is given" );
},
complete: function() {
start();
diff --git a/test/unit/css.js b/test/unit/css.js
index 8337f7df7..97eb1e9a6 100644
--- a/test/unit/css.js
+++ b/test/unit/css.js
@@ -228,8 +228,6 @@ test("css(String, Object)", function() {
j = jQuery("#nonnodes").contents();
j.css("overflow", "visible");
equal( j.css("overflow"), "visible", "Check node,textnode,comment css works" );
- // opera sometimes doesn't update 'display' correctly, see #2037
- jQuery("#t2037")[0].innerHTML = jQuery("#t2037")[0].innerHTML;
equal( jQuery("#t2037 .hidden").css("display"), "none", "Make sure browser thinks it is hidden" );
div = jQuery("#nothiddendiv");
@@ -790,8 +788,8 @@ test("Do not append px (#9548, #12990)", function() {
test("css('width') and css('height') should respect box-sizing, see #11004", function() {
expect( 4 );
- // Support: Firefox<29, Android 2.3 (Prefixed box-sizing versions).
- var el_dis = jQuery("<div style='width:300px;height:300px;margin:2px;padding:2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;'>test</div>"),
+ // Support: Android 2.3 (-webkit-box-sizing).
+ var el_dis = jQuery("<div style='width:300px;height:300px;margin:2px;padding:2px;-webkit-box-sizing:border-box;box-sizing:border-box;'>test</div>"),
el = el_dis.clone().appendTo("#qunit-fixture");
equal( el.css("width"), el.css("width", el.css("width")).css("width"), "css('width') is not respecting box-sizing, see #11004");
diff --git a/test/unit/dimensions.js b/test/unit/dimensions.js
index ce132fd32..8d51c6cde 100644
--- a/test/unit/dimensions.js
+++ b/test/unit/dimensions.js
@@ -418,8 +418,8 @@ test( "getters on non elements should return null", function() {
test("setters with and without box-sizing:border-box", function(){
expect(20);
- // Support: Firefox<29, Android 2.3 (Prefixed box-sizing versions).
- var el_bb = jQuery("<div style='width:114px;height:114px;margin:5px;padding:3px;border:4px solid white;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;'>test</div>").appendTo("#qunit-fixture"),
+ // Support: Android 2.3 (-webkit-box-sizing).
+ var el_bb = jQuery("<div style='width:114px;height:114px;margin:5px;padding:3px;border:4px solid white;-webkit-box-sizing:border-box;box-sizing:border-box;'>test</div>").appendTo("#qunit-fixture"),
el = jQuery("<div style='width:100px;height:100px;margin:5px;padding:3px;border:4px solid white;'>test</div>").appendTo("#qunit-fixture"),
expected = 100;
diff --git a/test/unit/event.js b/test/unit/event.js
index fe0f0c2da..1f08b4e95 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -1417,7 +1417,7 @@ test("Submit event can be stopped (#11049)", function() {
form.remove();
});
-// Test beforeunload event only if it supported (i.e. not Opera)
+// Test beforeunload event only if it supported.
// Support: iOS 7+, Android<4.0
// iOS & old Android have the window.onbeforeunload field but don't support the beforeunload
// handler making it impossible to feature-detect the support.
@@ -2431,32 +2431,26 @@ testIframeWithCallback( "focusin from an iframe", "event/focusinCrossFrame.html"
var input = jQuery( frameDoc ).find( "#frame-input" );
- if ( input.length ) {
- // Create a focusin handler on the parent; shouldn't affect the iframe's fate
- jQuery ( "body" ).on( "focusin.iframeTest", function() {
- ok( false, "fired a focusin event in the parent document" );
- });
-
- input.on( "focusin", function() {
- ok( true, "fired a focusin event in the iframe" );
- });
+ // Create a focusin handler on the parent; shouldn't affect the iframe's fate
+ jQuery ( "body" ).on( "focusin.iframeTest", function() {
+ ok( false, "fired a focusin event in the parent document" );
+ });
- // Avoid a native event; Chrome can't force focus to another frame
- input.trigger( "focusin" );
+ input.on( "focusin", function() {
+ ok( true, "fired a focusin event in the iframe" );
+ });
- // Must manually remove handler to avoid leaks in our data store
- input.remove();
+ // Avoid a native event; Chrome can't force focus to another frame
+ input.trigger( "focusin" );
- // Be sure it was removed; nothing should happen
- input.trigger( "focusin" );
+ // Must manually remove handler to avoid leaks in our data store
+ input.remove();
- // Remove body handler manually since it's outside the fixture
- jQuery( "body" ).off( "focusin.iframeTest" );
+ // Be sure it was removed; nothing should happen
+ input.trigger( "focusin" );
- } else {
- // Opera 12 (pre-Blink) doesn't select anything
- ok( true, "SOFTFAIL: no focus event fired in the iframe" );
- }
+ // Remove body handler manually since it's outside the fixture
+ jQuery( "body" ).off( "focusin.iframeTest" );
});
testIframeWithCallback( "jQuery.ready promise", "event/promiseReady.html", function( isOk ) {
diff --git a/test/unit/serialize.js b/test/unit/serialize.js
index 39e7d777e..54c75d62a 100644
--- a/test/unit/serialize.js
+++ b/test/unit/serialize.js
@@ -110,7 +110,7 @@ test("jQuery.param() Constructed prop values", function() {
});
test("serialize()", function() {
- expect(5);
+ expect(6);
// Add html5 elements only for serialize because selector can't yet find them on non-html5 browsers
jQuery("#search").after(
@@ -139,10 +139,8 @@ test("serialize()", function() {
"action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43&select1=&select2=3&select3=1&select3=2&select5=3&T3=%3F%0D%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=",
"Multiple form serialization as query string");
- /* Temporarily disabled. Opera 10 has problems with form serialization.
equal( jQuery("#form, #testForm :input").serialize(),
- "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43&select1=&select2=3&select3=1&select3=2&T3=%3F%0D%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=",
+ "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43&select1=&select2=3&select3=1&select3=2&select5=3&T3=%3F%0D%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=",
"Mixed form/input serialization as query string");
- */
jQuery("#html5email, #html5number").remove();
});
diff --git a/test/unit/support.js b/test/unit/support.js
index 97650bdff..80ce287d8 100644
--- a/test/unit/support.js
+++ b/test/unit/support.js
@@ -52,6 +52,8 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
userAgent = window.navigator.userAgent;
if ( /chrome/i.test( userAgent ) ) {
+ // Catches Chrome on Android as well (i.e. the default
+ // Android browser on Android >= 4.4).
expected = {
"ajax": true,
"boxSizingReliable": true,
@@ -67,22 +69,6 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"radioValue": true,
"reliableMarginRight": true
};
- } else if ( /opera.*version\/12\.1/i.test( userAgent ) ) {
- expected = {
- "ajax": true,
- "boxSizingReliable": true,
- "checkClone": true,
- "checkOn": true,
- "clearCloneStyle": true,
- "cors": true,
- "focusinBubbles": false,
- "noCloneChecked": true,
- "optDisabled": true,
- "optSelected": true,
- "pixelPosition": true,
- "radioValue": false,
- "reliableMarginRight": true
- };
} else if ( /trident\/7\.0/i.test( userAgent ) ) {
expected = {
"ajax": true,
@@ -163,22 +149,6 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"radioValue": true,
"reliableMarginRight": true
};
- } else if ( /5\.1(\.\d+|) safari/i.test( userAgent ) ) {
- expected = {
- "ajax": true,
- "boxSizingReliable": true,
- "checkClone": false,
- "checkOn": false,
- "clearCloneStyle": true,
- "cors": true,
- "focusinBubbles": false,
- "noCloneChecked": true,
- "optDisabled": true,
- "optSelected": true,
- "pixelPosition": false,
- "radioValue": true,
- "reliableMarginRight": true
- };
} else if ( /firefox/i.test( userAgent ) ) {
expected = {
"ajax": true,
@@ -195,7 +165,7 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"radioValue": true,
"reliableMarginRight": true
};
- } else if ( /iphone os (?:6|7)_/i.test( userAgent ) ) {
+ } else if ( /iphone os/i.test( userAgent ) ) {
expected = {
"ajax": true,
"boxSizingReliable": true,