diff options
author | timmywil <tim.willison@thisismedium.com> | 2011-03-16 14:44:31 -0400 |
---|---|---|
committer | timmywil <tim.willison@thisismedium.com> | 2011-03-16 14:44:31 -0400 |
commit | eb1497c1fb5a5e529e83c3597c7d212eae129ab7 (patch) | |
tree | 92f28be690f06077dce5edfeaf3b7a6f10267cbc /test | |
parent | 929792834f77e075e4b5397fb4b25b1a2dcbd49a (diff) | |
parent | 0cf336d2c95809ef41d94131e629fd1767f054a0 (diff) | |
download | jquery-eb1497c1fb5a5e529e83c3597c7d212eae129ab7.tar.gz jquery-eb1497c1fb5a5e529e83c3597c7d212eae129ab7.zip |
Merge branch 'master' of git://github.com/jquery/jquery into 2773_find_closest
Diffstat (limited to 'test')
m--------- | test/qunit | 0 | ||||
-rw-r--r-- | test/unit/ajax.js | 12 | ||||
-rw-r--r-- | test/unit/manipulation.js | 7 |
3 files changed, 16 insertions, 3 deletions
diff --git a/test/qunit b/test/qunit new file mode 160000 +Subproject d404faf8f587fcbe6b8907943022e6318dd51e0 diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 2a2ac46a1..7c572a32c 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -492,7 +492,7 @@ test(".ajax() - hash", function() { test("jQuery ajax - cross-domain detection", function() { - expect( 5 ); + expect( 6 ); var loc = document.location, otherPort = loc.port === 666 ? 667 : 666, @@ -508,6 +508,7 @@ test("jQuery ajax - cross-domain detection", function() { }); jQuery.ajax({ + dataType: "jsonp", url: 'app:/path', beforeSend: function( _ , s ) { ok( s.crossDomain , "Adobe AIR app:/ URL detected as cross-domain" ); @@ -535,6 +536,15 @@ test("jQuery ajax - cross-domain detection", function() { jQuery.ajax({ dataType: "jsonp", + url: "about:blank", + beforeSend: function( _ , s ) { + ok( s.crossDomain , "Test about:blank is detected as cross-domain" ); + return false; + } + }); + + jQuery.ajax({ + dataType: "jsonp", url: loc.protocol + "//" + loc.host, crossDomain: true, beforeSend: function( _ , s ) { diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 34425ed3a..ff3dff164 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -739,7 +739,7 @@ test("insertAfter(String|Element|Array<Element>|jQuery)", function() { }); var testReplaceWith = function(val) { - expect(20); + expect(21); jQuery('#yahoo').replaceWith(val( '<b id="replace">buga</b>' )); ok( jQuery("#replace")[0], 'Replace element with string' ); ok( !jQuery("#yahoo")[0], 'Verify that original element is gone, after string' ); @@ -800,6 +800,9 @@ var testReplaceWith = function(val) { equals( set[0].nodeName.toLowerCase(), "span", "Replace the disconnected node." ); equals( set.length, 1, "Replace the disconnected node." ); + var non_existant = jQuery('#does-not-exist').replaceWith( val("<b>should not throw an error</b>") ); + equals( non_existant.length, 0, "Length of non existant element." ); + var $div = jQuery("<div class='replacewith'></div>").appendTo("body"); // TODO: Work on jQuery(...) inline script execution //$div.replaceWith("<div class='replacewith'></div><script>" + @@ -827,7 +830,7 @@ test("replaceWith(String|Element|Array<Element>|jQuery)", function() { test("replaceWith(Function)", function() { testReplaceWith(functionReturningObj); - expect(21); + expect(22); var y = jQuery("#yahoo")[0]; |