Commit 38bc9680 authored by Rick Waldron's avatar Rick Waldron

Old acceptData tests refactored and adapted to support new data system

parent 054c6946
...@@ -144,42 +144,36 @@ test("jQuery.data(document)", 25, function() { ...@@ -144,42 +144,36 @@ test("jQuery.data(document)", 25, function() {
QUnit.expectJqData(document, "foo"); QUnit.expectJqData(document, "foo");
}); });
test("jQuery.data(<embed>)", 25, function() {
dataTests( document.createElement("embed") );
});
/* test("jQuery.data(<applet>)", 25, function() {
// Since the new data system does not rely on expandos, limiting the type of dataTests( document.createElement("applet") );
// nodes that can have data is no longer necessary. jQuery.acceptData is now irrelevant
// and should eventually be removed from the library.
test("Data is not being set on comment and text nodes", function() {
expect(2);
ok( !jQuery.hasData( jQuery("<!-- comment -->").data("foo", 0) ) );
ok( !jQuery.hasData( jQuery("<span>text</span>").contents().data("foo", 0) ) );
}); });
test("jQuery.data(object/flash)", 25, function() {
var flash = document.createElement("object");
flash.setAttribute( "classid", "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" );
test("jQuery.acceptData", function() { dataTests( flash );
expect(9); });
ok( jQuery.acceptData( document ), "document" ); test("jQuery.data(object/applet)", 25, function() {
ok( jQuery.acceptData( document.documentElement ), "documentElement" ); var applet = document.createElement("object");
ok( jQuery.acceptData( {} ), "object" ); applet.setAttribute( "classid", "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" );
ok( !jQuery.acceptData( document.createElement("embed") ), "embed" );
ok( !jQuery.acceptData( document.createElement("applet") ), "applet" );
var flash = document.createElement("object"); dataTests( applet );
flash.setAttribute("classid", "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"); });
ok( jQuery.acceptData( flash ), "flash" );
var applet = document.createElement("object"); test("jQuery.data(comment)", 25, function() {
applet.setAttribute("classid", "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"); dataTests( document.createComment("") );
ok( !jQuery.acceptData( applet ), "applet" ); });
ok( !jQuery.acceptData( document.createComment("") ), "comment" ); test("jQuery.data(text)", 25, function() {
ok( !jQuery.acceptData( document.createTextNode("") ), "text" ); dataTests( document.createTextNode("") );
}); });
*/
test(".data()", function() { test(".data()", function() {
expect(5); expect(5);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment