]> source.dussan.org Git - jquery.git/commitdiff
Revert "Manipulation: improve test for data-URI"
authorOleg Gaidarenko <markelog@gmail.com>
Fri, 13 Nov 2015 13:44:35 +0000 (16:44 +0300)
committerOleg Gaidarenko <markelog@gmail.com>
Fri, 13 Nov 2015 17:04:24 +0000 (20:04 +0300)
This reverts commit dd596ccf729b2f39d44b73bc54b53bd41c880146.

test/unit/manipulation.js

index 3000a83930b177670a00308656766355d9d08fdb..492390adf1b16d949a856436fad7cea0a60a5efe 100644 (file)
@@ -2679,28 +2679,11 @@ QUnit.test( "Make sure col element is appended correctly", function( assert ) {
        assert.strictEqual( table.find( "td" ).width(), 150 );
 } );
 
-QUnit.test( "Insert script with data-URI (gh-1887)", 1, function( assert ) {
+asyncTest( "Insert script with data-URI (gh-1887)", 1, function() {
        Globals.register( "testFoo" );
-       Globals.register( "testSrcFoo" );
-
-       var script = document.createElement( "script" ),
-               fixture = document.getElementById( "qunit-fixture" ),
-               done = assert.async();
-
-       script.src = "data:text/javascript,testSrcFoo = 'foo';";
-
-       fixture.appendChild( script );
-
-       jQuery( fixture ).append( "<script src=\"data:text/javascript,testFoo = 'foo';\"></script>" );
-
-       setTimeout( function() {
-               if ( window[ "testSrcFoo" ] === "foo" ) {
-                       assert.strictEqual( window[ "testFoo" ], window[ "testSrcFoo" ], "data-URI script executed" );
-
-               } else {
-                       assert.ok( true, "data-URI script is not supported by this environment" );
-               }
-
-               done();
-       });
+       jQuery( "#qunit-fixture" ).append( "<script src=\"data:text/javascript,testFoo = 'foo';\"></script>" );
+       setTimeout(function() {
+               strictEqual( window[ "testFoo" ], "foo", "data-URI script executed" );
+               start();
+       }, 100 );
 });