diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2012-11-03 00:06:50 -0400 |
---|---|---|
committer | Richard Gibson <richard.gibson@gmail.com> | 2012-11-05 17:24:03 -0500 |
commit | 81b094b2c180d490c093dafe53a69f59e1f8afe7 (patch) | |
tree | 62bedc6e856dc88414549299f68c2771a5fd5580 /test/unit/attributes.js | |
parent | 80d45a69ea5e81897ebcb6868a902f3b21d5b101 (diff) | |
download | jquery-81b094b2c180d490c093dafe53a69f59e1f8afe7.tar.gz jquery-81b094b2c180d490c093dafe53a69f59e1f8afe7.zip |
No ticket: update test suite to pass QUnit globals check in most environments. Close gh-1016.
Diffstat (limited to 'test/unit/attributes.js')
-rw-r--r-- | test/unit/attributes.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/unit/attributes.js b/test/unit/attributes.js index 3ad08a75a..3fa0e869b 100644 --- a/test/unit/attributes.js +++ b/test/unit/attributes.js @@ -340,9 +340,12 @@ test( "attr(String, Object)", function() { }); jQuery.each( [ window, document, obj, "#firstp" ], function( i, elem ) { - var $elem = jQuery( elem ); + // use iframeCallback to avoid generating a new global when testing window + var oldVal = elem.iframeCallback, + $elem = jQuery( elem ); strictEqual( $elem.attr("nonexisting"), undefined, "attr works correctly for non existing attributes (bug #7500)." ); - equal( $elem.attr( "something", "foo" ).attr("something"), "foo", "attr falls back to prop on unsupported arguments" ); + equal( $elem.attr( "iframeCallback", "foo" ).attr("iframeCallback"), "foo", "attr falls back to prop on unsupported arguments" ); + elem.iframeCallback = oldVal; }); var table = jQuery("#table").append("<tr><td>cell</td></tr><tr><td>cell</td><td>cell</td></tr><tr><td>cell</td><td>cell</td></tr>"), |