X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=blobdiff_plain;f=src%2Fjquery%2FcoreTest.js;h=77fd17e52cf03fc227afaca6d97c006a204abfe2;hp=5c982ee225b56eb6edb30c58d9d9686b8f785ca4;hb=707f23f83a59e692454eb18285a610889ce8102f;hpb=0f7c89cd97de6ca644a834a119dda1e057fd724e diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js index 5c982ee..77fd17e 100644 --- a/src/jquery/coreTest.js +++ b/src/jquery/coreTest.js @@ -159,7 +159,7 @@ test("index(Object)", function() { }); test("attr(String)", function() { - expect(15); + expect(13); ok( $('#text1').attr('value') == "Test", 'Check for value attribute' ); ok( $('#text1').attr('type') == "text", 'Check for type attribute' ); ok( $('#radio1').attr('type') == "radio", 'Check for type attribute' ); @@ -175,15 +175,20 @@ test("attr(String)", function() { $('').attr('href', '#5').appendTo('#main'); // using innerHTML in IE causes href attribute to be serialized to the full path ok( $('#tAnchor5').attr('href') == "#5", 'Check for non-absolute href (an anchor)' ); - - stop(); - $.get("data/dashboard.xml", function(xml) { - ok( $("locations", xml).attr("class") == "foo", "Check class attribute in XML document" ); - ok( $("location", xml).attr("for") == "bar", "Check for attribute in XML document" ); - start(); - }); }); +if ( location.protocol != "file:" ) { + test("attr(String) in XML Files", function() { + expect(2); + stop(); + $.get("data/dashboard.xml", function(xml) { + ok( $("locations", xml).attr("class") == "foo", "Check class attribute in XML document" ); + ok( $("location", xml).attr("for") == "bar", "Check for attribute in XML document" ); + start(); + }); + }); +} + test("attr(String, Function)", function() { expect(2); ok( $('#text1').attr('value', function() { return this.id })[0].value == "text1", "Set value from id" ); @@ -571,10 +576,10 @@ test("is(String)", function() { ok( !$('#foo').is(undefined), 'Expected false for an invalid expression - undefined' ); // test is() with comma-seperated expressions - ok( $('#en').is('[@lang="en"],[@lang="de"]'), 'Check for lang attribute: Expecte en or de' ); - ok( $('#en').is('[@lang="de"],[@lang="en"]'), 'Check for lang attribute: Expecte en or de' ); - ok( $('#en').is('[@lang="en"] , [@lang="de"]'), 'Check for lang attribute: Expecte en or de' ); - ok( $('#en').is('[@lang="de"] , [@lang="en"]'), 'Check for lang attribute: Expecte en or de' ); + ok( $('#en').is('[@lang="en"],[@lang="de"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' ); + ok( $('#en').is('[@lang="de"],[@lang="en"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' ); + ok( $('#en').is('[@lang="en"] , [@lang="de"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' ); + ok( $('#en').is('[@lang="de"] , [@lang="en"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' ); }); test("$.extend(Object, Object)", function() { @@ -816,3 +821,17 @@ test("click() context", function() { return false; }).click(); }); + +test("$().html().evalScripts() Eval's Scripts Twice in Firefox, see #975", function() { + expect(1); + $("#main").html('').evalScripts(); +}); + +test("$('') needs optional document parameter to ease cross-frame DOM wrangling, see #968", function() { + var f = frames["iframe"].document; + f.open(); + f.write(""); + f.close(); + $("
Testing
").appendTo(f.body); + ok( true, "passed" ); +}); \ No newline at end of file