Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Remove Ajax requirement for simple XML tests
Previously, all jQuery tests that wanted an XML document would make an Ajax request to go through jQuery's XML parsing logic in jQuery.ajax. Now, use jQuery.parseXML instead. This removes the need for the Ajax server for these tests, improves their performance, and decouples simple core tests from Ajax. (with scottgonzalez)
- Loading branch information
Showing
4 changed files
with
78 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -547,21 +547,17 @@ test("XSS via location.hash", function() { | ||
jQuery( '#<img id="check9521" src="no-such-.gif" onerror="jQuery._check9521(false)">' ).appendTo("#qunit-fixture"); | ||
} catch (err) { | ||
jQuery._check9521(true); | ||
}; | ||
} | ||
}); | ||
|
||
if ( !isLocal ) { | ||
test("isXMLDoc - XML", function() { | ||
expect(3); | ||
stop(); | ||
jQuery.get("data/dashboard.xml", function(xml) { | ||
ok( jQuery.isXMLDoc( xml ), "XML document" ); | ||
ok( jQuery.isXMLDoc( xml.documentElement ), "XML documentElement" ); | ||
ok( jQuery.isXMLDoc( jQuery("tab", xml)[0] ), "XML Tab Element" ); | ||
start(); | ||
}); | ||
var xml = createXMLDocument(); | ||
This comment has been minimized.
Sorry, something went wrong.
Krinkle
Member
|
||
xml.documentElement.appendChild( xml.createElement( "tab" ) ); | ||
ok( jQuery.isXMLDoc( xml ), "XML document" ); | ||
ok( jQuery.isXMLDoc( xml.documentElement ), "XML documentElement" ); | ||
ok( jQuery.isXMLDoc( jQuery("tab", xml)[0] ), "XML Tab Element" ); | ||
}); | ||
} | ||
|
||
test("isWindow", function() { | ||
expect( 14 ); | ||
@@ -638,20 +634,16 @@ test("jQuery('html', context)", function() { | ||
equal($span.length, 1, "Verify a span created with a div context works, #1763"); | ||
}); | ||
|
||
if ( !isLocal ) { | ||
test("jQuery(selector, xml).text(str) - Loaded via XML document", function() { | ||
expect(2); | ||
stop(); | ||
jQuery.get("data/dashboard.xml", function(xml) { | ||
// tests for #1419 where IE was a problem | ||
var tab = jQuery("tab", xml).eq(0); | ||
equal( tab.text(), "blabla", "Verify initial text correct" ); | ||
tab.text("newtext"); | ||
equal( tab.text(), "newtext", "Verify new text correct" ); | ||
start(); | ||
}); | ||
|
||
var xml = createDashboardXML(); | ||
// tests for #1419 where IE was a problem | ||
var tab = jQuery("tab", xml).eq(0); | ||
equal( tab.text(), "blabla", "Verify initial text correct" ); | ||
tab.text("newtext"); | ||
equal( tab.text(), "newtext", "Verify new text correct" ); | ||
}); | ||
} | ||
|
||
test("end()", function() { | ||
expect(3); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Where is this function being used?