From dd900460ac6f77be71ceb878bc2cd1465397dc60 Mon Sep 17 00:00:00 2001 From: Mike Sherov Date: Wed, 11 Jan 2012 21:35:13 -0500 Subject: Fix #10902. DRY up the ways to include src files in tests. --- test/csp.php | 20 +------ test/data/include_js.php | 102 +++++++++++++++++++++++++++++++++ test/data/offset/absolute.html | 13 +---- test/data/offset/body.html | 12 +--- test/data/offset/fixed.html | 12 +--- test/data/offset/relative.html | 12 +--- test/data/offset/scroll.html | 12 +--- test/data/offset/static.html | 12 +--- test/data/offset/table.html | 12 +--- test/data/selector/html5_selector.html | 21 +------ test/data/selector/sizzle_cache.html | 21 +------ test/data/support/bodyBackground.html | 21 +------ test/data/support/boxModelIE.html | 21 +------ test/data/support/hiddenIFrameFF.html | 21 +------ test/data/versioncheck.js | 8 --- test/delegatetest.html | 13 +---- test/hovertest.html | 2 +- test/index.html | 24 +------- test/localfile.html | 20 +------ test/networkerror.html | 20 +------ test/readywait.html | 20 +------ 21 files changed, 122 insertions(+), 297 deletions(-) create mode 100644 test/data/include_js.php delete mode 100644 test/data/versioncheck.js diff --git a/test/csp.php b/test/csp.php index 13c324ea6..46cba8348 100644 --- a/test/csp.php +++ b/test/csp.php @@ -5,25 +5,7 @@ CSP Test Page - - - - - - - - - - - - - - - - - - - +

CSP Test Page

diff --git a/test/data/include_js.php b/test/data/include_js.php new file mode 100644 index 000000000..467a6b2be --- /dev/null +++ b/test/data/include_js.php @@ -0,0 +1,102 @@ +/* +<'+'/script>');"; +} + +// the concatenated version of the the src files is both the default and the fallback +// because it does not require you to "make" jquery for it to update +if( $output === "" ) { + $files = array( + "intro", + "core", + "callbacks", + "deferred", + "support", + "data", + "queue", + "attributes", + "event", + "sizzle/sizzle", + "sizzle-jquery", + "traversing", + "manipulation", + "css", + "ajax", + "ajax/jsonp", + "ajax/script", + "ajax/xhr", + "effects", + "offset", + "dimensions", + "exports", + "outro" + ); + + foreach ( $files as $file ) { + $output .= file_get_contents( "../../src/" . $file . ".js" ); + } + + $output = str_replace( "(function( jQuery ) {", "", $output ); + $output = str_replace( "})( jQuery );", "", $output ); +} + +echo $output; +die(); +?> +*/ + +// javascript fallback using src files in case this is not run on a PHP server! +var baseURL = document.location.href.replace( /\/test\/.+/, "/"), + files = [ + "core", + "callbacks", + "deferred", + "support", + "data", + "queue", + "attributes", + "event", + "sizzle/sizzle", + "sizzle-jquery", + "traversing", + "manipulation", + "css", + "ajax", + "ajax/jsonp", + "ajax/script", + "ajax/xhr", + "effects", + "offset", + "dimensions", + "exports" + ], + len = files.length, + i = 0; + +for ( ; i < len; i++ ) { + document.write(" - - - - - - - - - - - + - - - - - - - - - - + - - - - - - - - - - + - - - - - - - - - - + - - - - - - - - - - + - - - - - - - - - - + - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - + diff --git a/test/data/support/bodyBackground.html b/test/data/support/bodyBackground.html index 3d135ab56..cd3744b87 100644 --- a/test/data/support/bodyBackground.html +++ b/test/data/support/bodyBackground.html @@ -10,26 +10,7 @@
- - - - - - - - - - - - - - - - - - - - +
- - - - - - - - - - - - - - - - - - - + diff --git a/test/data/support/hiddenIFrameFF.html b/test/data/support/hiddenIFrameFF.html index a21708d57..c2dda8cd4 100644 --- a/test/data/support/hiddenIFrameFF.html +++ b/test/data/support/hiddenIFrameFF.html @@ -1,25 +1,6 @@ - - - - - - - - - - - - - - - - - - - - + diff --git a/test/data/versioncheck.js b/test/data/versioncheck.js deleted file mode 100644 index f4b7790da..000000000 --- a/test/data/versioncheck.js +++ /dev/null @@ -1,8 +0,0 @@ -// Run minified source from dist (do make first) -// Should be loaded before QUnit but after src -(function() { - if ( /jquery\=min/.test( window.location.search ) ) { - jQuery.noConflict( true ); - document.write(unescape("%3Cscript%20src%3D%27../dist/jquery.min.js%27%3E%3C/script%3E")); - } -})(); \ No newline at end of file diff --git a/test/delegatetest.html b/test/delegatetest.html index 5bf1c305a..012d27c91 100644 --- a/test/delegatetest.html +++ b/test/delegatetest.html @@ -2,15 +2,7 @@ Event Delegation Tests - + -

Delegate Tests (BAD FILE IN URL, x)

+

Delegate Tests (x)

@@ -133,7 +125,6 @@ th, td { + - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - + -- cgit v1.2.3