diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index ca3b8b548..12f5d14df 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -2437,9 +2437,25 @@ test( "Validate creation of multiple quantities of certain elements (#13818)", 4 asyncTest( "Insert script with data-URI (gh-1887)", 1, function() { Globals.register( "testFoo" ); - jQuery( "#qunit-fixture" ).append( "" ); + Globals.register( "testSrcFoo" ); + + var script = document.createElement( "script" ), + fixture = document.getElementById( "qunit-fixture" ); + + script.src = "data:text/javascript,testSrcFoo = 'foo';"; + + fixture.appendChild( script ); + + jQuery( fixture ).append( "" ); + setTimeout(function() { - strictEqual( window[ "testFoo" ], "foo", "data-URI script executed" ); + if ( window[ "testSrcFoo" ] === "foo" ) { + strictEqual( window[ "testFoo" ], window[ "testSrcFoo" ], "data-URI script executed" ); + + } else { + ok( true, "data-URI script is not supported by this environment" ); + } + start(); - }, 100 ); + }); });