diff options
author | jaubourg <j@ubourg.net> | 2012-12-05 14:54:14 +0100 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2012-12-05 14:54:14 +0100 |
commit | b7ece8c6206d87e71145d1aeefc984e1649af06a (patch) | |
tree | 51d47e55f12209926663554b885f3bb395297b91 /test/data/testinit.js | |
parent | 6df2900d3a201ba84d56dfb0eb67d4c6e88aaec2 (diff) | |
download | jquery-b7ece8c6206d87e71145d1aeefc984e1649af06a.tar.gz jquery-b7ece8c6206d87e71145d1aeefc984e1649af06a.zip |
Revert "Organizes the php scripts used for testing better, so that the whole logic of a unit, server-side and client-side, is contained within the unit itself. Nearly all ajax unit tests take advantage of the new 'framework'. Lots of files got deleted because they became redundant or weren't used anymore."
This reverts commit 228ab3ddae527f72cc3122a1c6115d7718bcfd57.
Diffstat (limited to 'test/data/testinit.js')
-rw-r--r-- | test/data/testinit.js | 46 |
1 files changed, 10 insertions, 36 deletions
diff --git a/test/data/testinit.js b/test/data/testinit.js index 6050eec4c..bff6b8dff 100644 --- a/test/data/testinit.js +++ b/test/data/testinit.js @@ -58,21 +58,7 @@ function t( a, b, c ) { deepEqual(f, q.apply( q, c ), a + " (" + b + ")"); } -function createComplexHTML() { - return 'html text<br/> \ - <script type="text/javascript">/* <![CDATA[ */ \ - testFoo = "foo"; jQuery("#foo").html("foo"); \ - ok( true, "inline script executed" ); \ - /* ]]> */</script> \ - <script src="' + service("echo", { - content: 'var testBar = "bar"; \ - jQuery("#ap").html("bar"); \ - ok( true, "remote script executed");' - }) + '"></script> \ - blabla'; -} - -function createDashboardXML( noParse ) { +function createDashboardXML() { var string = '<?xml version="1.0" encoding="UTF-8"?> \ <dashboard> \ <locations class="foo"> \ @@ -85,10 +71,10 @@ function createDashboardXML( noParse ) { </locations> \ </dashboard>'; - return noParse ? string : jQuery.parseXML(string); + return jQuery.parseXML(string); } -function createWithFriesXML( noParse ) { +function createWithFriesXML() { var string = '<?xml version="1.0" encoding="UTF-8"?> \ <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" \ xmlns:xsd="http://www.w3.org/2001/XMLSchema" \ @@ -113,9 +99,9 @@ function createWithFriesXML( noParse ) { </response> \ </jsconf> \ </soap:Body> \ - </soap:Envelope>'.replace( /\{\{\s*externalHost\s*\}\}/g, externalHost ); + </soap:Envelope>'; - return noParse ? string : jQuery.parseXML( string ); + return jQuery.parseXML( string.replace( /\{\{\s*externalHost\s*\}\}/g, externalHost ) ); } function createXMLFragment() { @@ -147,27 +133,16 @@ fireNative = document.createEvent ? /** * Add random number to url to stop caching * - * @example url("data/iframe.html") - * @result "data/iframe.html?10538358428943" + * @example url("data/test.html") + * @result "data/test.html?10538358428943" * - * @example url("data/ajax/echo?foo=bar") - * @result "data/ajax/echo?foo=bar&10538358345554" + * @example url("data/test.php?foo=bar") + * @result "data/test.php?foo=bar&10538358345554" */ function url( value ) { return value + (/\?/.test(value) ? "&" : "?") + new Date().getTime() + "" + parseInt(Math.random() * 100000, 10); } -function service( value, data ) { - var fragment = url( "data/ajax/" + ( value || "" ) ); - if ( data ) { - if ( typeof data !== "string" ) { - data = jQuery.param( data ); - } - fragment += "&" + data; - } - return fragment; -} - // Ajax testing helper function ajaxTest( title, expect, options ) { var requestOptions; @@ -192,9 +167,8 @@ function ajaxTest( title, expect, options ) { delete ajaxTest.abort; if ( options.teardown ) { options.teardown(); - } else { - start(); } + start(); } }, requests = jQuery.map( requestOptions, function( options ) { |