An Ajax-based test was being run locally (which doesn't work).
authorJohn Resig <jeresig@gmail.com>
Sat, 24 Mar 2007 02:07:37 +0000 (02:07 +0000)
committerJohn Resig <jeresig@gmail.com>
Sat, 24 Mar 2007 02:07:37 +0000 (02:07 +0000)
src/jquery/coreTest.js

index 5c982ee..ab47c46 100644 (file)
@@ -159,7 +159,7 @@ test("index(Object)", function() {
 });\r
 \r
 test("attr(String)", function() {\r
-       expect(15);\r
+       expect(13);\r
        ok( $('#text1').attr('value') == "Test", 'Check for value attribute' );\r
        ok( $('#text1').attr('type') == "text", 'Check for type attribute' );\r
        ok( $('#radio1').attr('type') == "radio", 'Check for type attribute' );\r
@@ -175,15 +175,20 @@ test("attr(String)", function() {
        \r
        $('<a id="tAnchor5"></a>').attr('href', '#5').appendTo('#main'); // using innerHTML in IE causes href attribute to be serialized to the full path\r
        ok( $('#tAnchor5').attr('href') == "#5", 'Check for non-absolute href (an anchor)' );\r
-       \r
-       stop();\r
-       $.get("data/dashboard.xml", function(xml) {\r
-               ok( $("locations", xml).attr("class") == "foo", "Check class attribute in XML document" );\r
-               ok( $("location", xml).attr("for") == "bar", "Check for attribute in XML document" );\r
-               start();\r
-       });\r
 });\r
 \r
+if ( location.protocol != "file:" ) {\r
+       test("attr(String) in XML Files", function() {\r
+               expect(2);\r
+               stop();\r
+               $.get("data/dashboard.xml", function(xml) {\r
+                       ok( $("locations", xml).attr("class") == "foo", "Check class attribute in XML document" );\r
+                       ok( $("location", xml).attr("for") == "bar", "Check for attribute in XML document" );\r
+                       start();\r
+               });\r
+       });\r
+}\r
+\r
 test("attr(String, Function)", function() {\r
        expect(2);\r
        ok( $('#text1').attr('value', function() { return this.id })[0].value == "text1", "Set value from id" );\r