From 67a2e4eaac98cee79a02a0a45e4826a7958d4b75 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Fri, 8 Feb 2013 00:20:33 -0500 Subject: Ref #13316: Sync all test documents on full vs. minified source. --- test/csp.php | 16 ----- test/data/ajax/unreleasedXHR.html | 2 +- test/data/core/cc_on.html | 2 +- test/data/dimensions/documentLarge.html | 2 +- test/data/dimensions/documentSmall.html | 2 +- test/data/event/promiseReady.html | 2 +- test/data/event/syncReady.html | 2 +- test/data/manipulation/iframe-denied.html | 2 +- test/data/offset/absolute.html | 2 +- test/data/offset/body.html | 2 +- test/data/offset/fixed.html | 2 +- test/data/offset/relative.html | 2 +- test/data/offset/scroll.html | 2 +- test/data/offset/static.html | 2 +- test/data/offset/table.html | 2 +- test/data/selector/html5_selector.html | 2 +- test/data/selector/sizzle_cache.html | 10 +-- test/data/support/bodyBackground.html | 2 +- test/data/support/csp.js | 3 + test/data/support/csp.php | 22 ++++++ test/data/support/shrinkWrapBlocks.html | 2 +- test/data/support/testElementCrash.html | 2 +- test/delegatetest.html | 2 +- test/hovertest.html | 2 +- test/index.html | 2 +- test/jquery.js | 5 ++ test/localfile.html | 2 +- test/networkerror.html | 2 +- test/polluted.php | 110 ------------------------------ test/readywait.html | 2 +- test/unit/selector.js | 3 +- test/unit/support.js | 32 ++++----- 32 files changed, 75 insertions(+), 174 deletions(-) delete mode 100644 test/csp.php create mode 100644 test/data/support/csp.js create mode 100644 test/data/support/csp.php create mode 100644 test/jquery.js delete mode 100644 test/polluted.php (limited to 'test') diff --git a/test/csp.php b/test/csp.php deleted file mode 100644 index 9ab18f392..000000000 --- a/test/csp.php +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - CSP Test Page - - - - -

CSP Test Page

- - diff --git a/test/data/ajax/unreleasedXHR.html b/test/data/ajax/unreleasedXHR.html index 6c3d8210b..5233354f5 100644 --- a/test/data/ajax/unreleasedXHR.html +++ b/test/data/ajax/unreleasedXHR.html @@ -3,7 +3,7 @@ Attempt to block tests because of dangling XHR requests (IE) - + - + + diff --git a/test/data/dimensions/documentSmall.html b/test/data/dimensions/documentSmall.html index 12cbf9385..63e1c2a8f 100644 --- a/test/data/dimensions/documentSmall.html +++ b/test/data/dimensions/documentSmall.html @@ -15,7 +15,7 @@
- +
diff --git a/test/data/event/promiseReady.html b/test/data/event/promiseReady.html index d2b166f32..17b6e7f2c 100644 --- a/test/data/event/promiseReady.html +++ b/test/data/event/promiseReady.html @@ -3,7 +3,7 @@ Test case for jQuery ticket #11470 - + + diff --git a/test/data/manipulation/iframe-denied.html b/test/data/manipulation/iframe-denied.html index 28a530575..14df26a69 100644 --- a/test/data/manipulation/iframe-denied.html +++ b/test/data/manipulation/iframe-denied.html @@ -6,7 +6,7 @@
- + + + + + + + + + + - -
Worlds collide
- diff --git a/test/data/support/bodyBackground.html b/test/data/support/bodyBackground.html index b0abc074f..8991007cf 100644 --- a/test/data/support/bodyBackground.html +++ b/test/data/support/bodyBackground.html @@ -17,7 +17,7 @@
- +
+ + + +

CSP Test Page

+ + diff --git a/test/data/support/shrinkWrapBlocks.html b/test/data/support/shrinkWrapBlocks.html index 1ae15bfb5..a2097cb21 100644 --- a/test/data/support/shrinkWrapBlocks.html +++ b/test/data/support/shrinkWrapBlocks.html @@ -12,7 +12,7 @@
- +
+ + - + \n"; - if( $lib == "prototype" ) { // prototype must be included first - array_unshift( $includes, $include ); - } else { - array_push( $includes, $include ); - } - } - - $includes = implode( "\n", $includes ); - $suite = file_get_contents( "index.html" ); - echo str_replace( "", $includes, $suite ); - exit; - } -?> - - - - - Run jQuery Test Suite Polluted - - - - -

jQuery Test Suite

- -

Choose other libraries to include

- -
- $data ) { - echo "
$name"; - $i = 0; - foreach( $data[ "versions" ] as $ver ) { - $i++; - echo ""; - if( !($i % 4) ) echo "
"; - } - echo "
"; - } - ?> - -
- - diff --git a/test/readywait.html b/test/readywait.html index 4738b1b95..7a736bef5 100644 --- a/test/readywait.html +++ b/test/readywait.html @@ -14,7 +14,7 @@ #output { background-color: green } #expectedOutput { background-color: green } - + diff --git a/test/unit/selector.js b/test/unit/selector.js index 07e563da3..22d7305eb 100644 --- a/test/unit/selector.js +++ b/test/unit/selector.js @@ -178,7 +178,8 @@ testIframe("selector/html5_selector", "attributes - jQuery.attr", function( jQue testIframe("selector/sizzle_cache", "Sizzle cache collides with multiple Sizzles on a page", function( jQuery, window, document ) { var $cached = window["$cached"]; - expect(3); + expect(4); + notStrictEqual( jQuery, $cached, "Loaded two engines" ); deepEqual( $cached(".test a").get(), [ document.getElementById("collision") ], "Select collision anchor with first sizzle" ); equal( jQuery(".evil a").length, 0, "Select nothing with second sizzle" ); equal( jQuery(".evil a").length, 0, "Select nothing again with second sizzle" ); diff --git a/test/unit/support.js b/test/unit/support.js index 60a658261..4c6a49d55 100644 --- a/test/unit/support.js +++ b/test/unit/support.js @@ -18,33 +18,18 @@ test( "zoom of doom (#13089)", function() { if ( jQuery.css ) { testIframeWithCallback( "body background is not lost if set prior to loading jQuery (#9239)", "support/bodyBackground.html", function( color, support ) { expect( 2 ); - var i, - passed = true, - okValue = { + var okValue = { "#000000": true, "rgb(0, 0, 0)": true }; ok( okValue[ color ], "color was not reset (" + color + ")" ); - for ( i in jQuery.support ) { - if ( jQuery.support[ i ] !== support[ i ] ) { - passed = false; - strictEqual( jQuery.support[ i ], support[ i ], "Support property " + i + " is different" ); - } - } - for ( i in support ) { - if ( !( i in jQuery.support ) ) { - passed = false; - strictEqual( jQuery.support[ i ], support[ i ], "Unexpected property: " + i ); - } - } - - ok( passed, "Same support properties" ); + deepEqual( jQuery.extend( {}, support ), jQuery.support, "Same support properties" ); }); } testIframeWithCallback( "A background on the testElement does not cause IE8 to crash (#9823)", "support/testElementCrash.html", function() { - expect(1); + expect( 1 ); ok( true, "IE8 does not crash" ); }); @@ -382,3 +367,14 @@ testIframeWithCallback( "box-sizing does not affect jQuery.support.shrinkWrapBlo } })(); + +// Support: Safari 5.1 +// Shameless browser-sniff, but Safari 5.1 mishandles CSP +if ( !( typeof navigator !== "undefined" && + (/ AppleWebKit\/\d.*? Version\/(\d+)/.exec(navigator.userAgent) || [])[1] < 6 ) ) { + + testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Security/CSP) restrictions", "support/csp.php", function( support ) { + expect( 1 ); + deepEqual( jQuery.extend( {}, support ), jQuery.support, "No violations of CSP polices" ); + }); +} -- cgit v1.2.3