diff options
Diffstat (limited to 'toolkit/components/feeds/test/xml/rss2')
95 files changed, 1606 insertions, 0 deletions
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_category.xml b/toolkit/components/feeds/test/xml/rss2/feed_category.xml new file mode 100644 index 000000000..553825995 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_category.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel category works +Expect: feed.categories.queryElementAt(0, Components.interfaces.nsIPropertyBag).getProperty('term') == 'hmm' + +--> +<rss version="2.0" > +<channel> +<category>hmm</category> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_category_count.xml b/toolkit/components/feeds/test/xml/rss2/feed_category_count.xml new file mode 100644 index 000000000..881c6e0d9 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_category_count.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel category works w/ domain +Expect: feed.categories.length == 4 + +--> +<rss version="2.0" > +<channel> +<category>hmm0</category> +<category>hmm1</category> +<category domain="http://example.org">hmm2</category> +<category>hmm3</category> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_cloud.xml b/toolkit/components/feeds/test/xml/rss2/feed_cloud.xml new file mode 100644 index 000000000..caa033548 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_cloud.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel cloud works +Expect: ((feed.cloud.getProperty('domain')=="rpc.sys.com") && (feed.cloud.getProperty('port')=="80") && (feed.cloud.getProperty('path')=="/RPC2") && (feed.cloud.getProperty('registerProcedure')=="pingMe") && (feed.cloud.getProperty('protocol')=="soap")) + +--> +<rss version="2.0" > +<channel> +<cloud domain="rpc.sys.com" port="80" path="/RPC2" registerProcedure="pingMe" protocol="soap"/> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_copyright.xml b/toolkit/components/feeds/test/xml/rss2/feed_copyright.xml new file mode 100644 index 000000000..2d00e7a14 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_copyright.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel copyright works +Expect: feed.fields.getProperty('copyright') == 'copyright 2006' + +--> +<rss version="2.0" > +<channel> +<copyright>copyright 2006</copyright> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_copyright_linebreak.xml b/toolkit/components/feeds/test/xml/rss2/feed_copyright_linebreak.xml new file mode 100644 index 000000000..4b9ca5e71 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_copyright_linebreak.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel copyright works +Expect: feed.fields.getProperty('copyright') == 'copyright 2005' + +--> +<rss version="2.0" > +<channel> +<copyright>copyright 2005 + + +</copyright> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_data_outside_channel.xml b/toolkit/components/feeds/test/xml/rss2/feed_data_outside_channel.xml new file mode 100644 index 000000000..bf212760d --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_data_outside_channel.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel copyright works +Expect: feed.fields.getProperty('copyright') == 'copyright 2006' + +--> +<rss version="2.0" > +<dc:creator xmlns:dc="http://example.org">heynow</dc:creator> +<channel> +<copyright>copyright 2006</copyright> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_dc_contributor.xml b/toolkit/components/feeds/test/xml/rss2/feed_dc_contributor.xml new file mode 100644 index 000000000..cfb514ccd --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_dc_contributor.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel copyright works +Expect: feed.contributors.queryElementAt(0, Components.interfaces.nsIFeedPerson).name == 'them'; + +--> +<rss version="2.0" > +<channel xmlns:dc="http://purl.org/dc/elements/1.1/"> +<copyright>copyright 2006</copyright> +<dc:creator>me</dc:creator> +<dc:contributor>them</dc:contributor> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_dc_creator.xml b/toolkit/components/feeds/test/xml/rss2/feed_dc_creator.xml new file mode 100644 index 000000000..8ed1aff7f --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_dc_creator.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel copyright works +Expect: feed.authors.queryElementAt(0, Components.interfaces.nsIFeedPerson).name == 'me' + +--> +<rss version="2.0" > +<channel xmlns:dc="http://purl.org/dc/elements/1.1/"> +<copyright>copyright 2006</copyright> +<dc:creator>me</dc:creator> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_description.xml b/toolkit/components/feeds/test/xml/rss2/feed_description.xml new file mode 100644 index 000000000..11463dfe0 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_description.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel description works +Expect: var desc = feed.fields.getProperty('description'); desc == 'test'; + +--> +<rss version="2.0" > +<channel> +<description>test</description> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_description_html.xml b/toolkit/components/feeds/test/xml/rss2/feed_description_html.xml new file mode 100644 index 000000000..ecb544f6c --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_description_html.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel description works w/html +Expect: feed.fields.getProperty('description') == '<b>test</b>' + +--> +<rss version="2.0" > +<channel> +<description><b>test</b></description> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_description_html_cdata.xml b/toolkit/components/feeds/test/xml/rss2/feed_description_html_cdata.xml new file mode 100644 index 000000000..45ee9e92b --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_description_html_cdata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel description works w/ html & CDATA +Expect: feed.fields.getProperty('description') == '<b>test</b>' + +--> +<rss version="2.0" > +<channel> +<description><![CDATA[<b>test</b>]]></description> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_docs.xml b/toolkit/components/feeds/test/xml/rss2/feed_docs.xml new file mode 100644 index 000000000..20323b22f --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_docs.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel docs works +Expect: feed.fields.getProperty('docs') == 'http://example.org' + +--> +<rss version="2.0" > +<channel> +<docs>http://example.org</docs> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_generator.xml b/toolkit/components/feeds/test/xml/rss2/feed_generator.xml new file mode 100644 index 000000000..91ba579b4 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_generator.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel generator works +Expect: feed.generator.agent == 'a generator used to make feeds' + +--> +<rss version="2.0" > +<channel> +<generator>a generator used to make feeds</generator> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_image_desc.xml b/toolkit/components/feeds/test/xml/rss2/feed_image_desc.xml new file mode 100644 index 000000000..7f665641b --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_image_desc.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel image description and required fields work +Expect: ((feed.image.getProperty('title') == 'A picture') && (feed.image.getProperty('link') == 'http://example.org') && (feed.image.getProperty('url') == 'http://example.org/a.jpg') && (feed.image.getProperty('description') == 'Yo!')) + +--> +<rss version="2.0" > +<channel> +<image> + <link>http://example.org</link> + <title>A picture</title> + <url>http://example.org/a.jpg</url> + <description>Yo!</description> +</image> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_image_desc_width_height.xml b/toolkit/components/feeds/test/xml/rss2/feed_image_desc_width_height.xml new file mode 100644 index 000000000..2be53e86c --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_image_desc_width_height.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel image required fields work +Expect: ((feed.image.getProperty('title') == 'A picture') && (feed.image.getProperty('link') == 'http://example.org') && (feed.image.getProperty('url') == 'http://example.org/a.jpg') && (feed.image.getProperty('description') == 'Yo!') && (feed.image.getProperty('width') == '42') && (feed.image.getProperty('height') == '43')) + +--> +<rss version="2.0" > +<channel> +<image> + <link>http://example.org</link> + <title>A picture</title> + <url>http://example.org/a.jpg</url> + <description>Yo!</description> + <width>42</width> + <height>43</height> +</image> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_image_required.xml b/toolkit/components/feeds/test/xml/rss2/feed_image_required.xml new file mode 100644 index 000000000..9035523a1 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_image_required.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel image required fields work +Expect: ((feed.image.getProperty('title') == 'A picture') && (feed.image.getProperty('link') == 'http://example.org') && (feed.image.getProperty('url') == 'http://example.org/a.jpg')) + +--> +<rss version="2.0" > +<channel> +<image> + <link>http://example.org</link> + <title>A picture</title> + <url>http://example.org/a.jpg</url> +</image> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_language.xml b/toolkit/components/feeds/test/xml/rss2/feed_language.xml new file mode 100644 index 000000000..d4047a99f --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_language.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel language works +Expect: feed.fields.getProperty('language') == 'en-us' + +--> +<rss version="2.0" > +<channel> +<language>en-us</language> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_lastBuildDate.xml b/toolkit/components/feeds/test/xml/rss2/feed_lastBuildDate.xml new file mode 100644 index 000000000..fee9ff582 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_lastBuildDate.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel lastBuildDate works +Expect: feed.fields.getProperty('lastBuildDate') == 'Sat, 07 Sep 2002 00:00:01 GMT' + +--> +<rss version="2.0" > +<channel> +<lastBuildDate>Sat, 07 Sep 2002 00:00:01 GMT</lastBuildDate> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_linebreak_link.xml b/toolkit/components/feeds/test/xml/rss2/feed_linebreak_link.xml new file mode 100644 index 000000000..1af6550f9 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_linebreak_link.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel link works w/ line break +Expect: feed.link.spec == 'http://mozilla.org/' + +--> +<rss version="2.0" > +<channel> +<link> +http://mozilla.org/ +</link> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_link.xml b/toolkit/components/feeds/test/xml/rss2/feed_link.xml new file mode 100644 index 000000000..a4874e9ca --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_link.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel link works +Expect: feed.link.spec == 'http://mozilla.org/' + +--> +<rss version="2.0" > +<channel> +<link>http://mozilla.org/</link> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_link_cdata.xml b/toolkit/components/feeds/test/xml/rss2/feed_link_cdata.xml new file mode 100644 index 000000000..5031ac1c3 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_link_cdata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel link works w/ CDATA +Expect: feed.link.spec == 'http://mozilla.org/' + +--> +<rss version="2.0" > +<channel> +<link> + <![CDATA[http://mozilla.org/]]> +</link> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_managingEditor.xml b/toolkit/components/feeds/test/xml/rss2/feed_managingEditor.xml new file mode 100644 index 000000000..3f7060449 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_managingEditor.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel managingEditor works +Expect: feed.authors.queryElementAt(0, Components.interfaces.nsIFeedPerson).email == 'example@example.com' + +--> +<rss version="2.0" > +<channel> +<managingEditor>example@example.com</managingEditor> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_managingEditor_extra_att.xml b/toolkit/components/feeds/test/xml/rss2/feed_managingEditor_extra_att.xml new file mode 100644 index 000000000..017a4595f --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_managingEditor_extra_att.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel managingEditor works +Expect: feed.authors.queryElementAt(0, Components.interfaces.nsIFeedPerson).email == 'example@example.com' + +--> +<rss version="2.0" > +<channel> +<managingEditor foo:bar="baz" xmlns:foo="http://example.org">example@example.com</managingEditor> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_multiple_categories.xml b/toolkit/components/feeds/test/xml/rss2/feed_multiple_categories.xml new file mode 100644 index 000000000..538362b6a --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_multiple_categories.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel category works +Expect: feed.categories.queryElementAt(2, Components.interfaces.nsIPropertyBag).getProperty('term') == 'hmm2' + +--> +<rss version="2.0" > +<channel> +<category>hmm0</category> +<category>hmm1</category> +<category>hmm2</category> +<category>hmm3</category> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_pubDate.xml b/toolkit/components/feeds/test/xml/rss2/feed_pubDate.xml new file mode 100644 index 000000000..42cea6832 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_pubDate.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel pubDate works +Expect: feed.fields.getProperty('pubDate') == 'Sat, 07 Sep 2002 00:00:01 GMT' + +--> +<rss version="2.0" > +<channel> +<pubDate>Sat, 07 Sep 2002 00:00:01 GMT</pubDate> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_pubDate_invalid.xml b/toolkit/components/feeds/test/xml/rss2/feed_pubDate_invalid.xml new file mode 100644 index 000000000..48cce256a --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_pubDate_invalid.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: non-RFC822 date should produce null feed.updated +Expect: feed.updated == null + +--> +<rss version="2.0" > +<channel> +<pubDate>Satmonkey, 07 Sepmonkey 2002 00:00:01 GMT</pubDate> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/feed_pubDate_nonRFC822_1.xml b/toolkit/components/feeds/test/xml/rss2/feed_pubDate_nonRFC822_1.xml new file mode 100644 index 000000000..846ef22a6 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_pubDate_nonRFC822_1.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: Test whether date parsing handles partly-abbreviated dates. +Expect: feed.updated == 'Tue, 25 Apr 2006 08:00:00 GMT' + +--> +<rss version="2.0" > +<channel> +<pubDate>Tues, 25 Apri 2006 08:00:00 GMT</pubDate> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/feed_pubDate_nonRFC822_2.xml b/toolkit/components/feeds/test/xml/rss2/feed_pubDate_nonRFC822_2.xml new file mode 100644 index 000000000..d1ee96f36 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_pubDate_nonRFC822_2.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: Test whether date parsing handles unabbreviated dates. +Expect: feed.updated == 'Sat, 25 Nov 2006 00:12:45 GMT' + +--> +<rss version="2.0" > +<channel> +<pubDate>Saturday 25 November 2006 10:12:45 +1000</pubDate> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/feed_pubDate_timezoneZ.xml b/toolkit/components/feeds/test/xml/rss2/feed_pubDate_timezoneZ.xml new file mode 100644 index 000000000..b31ed5c56 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_pubDate_timezoneZ.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: Test whether date parsing handles "Z" as a timezone in RFC822. +Expect: feed.updated == 'Tue, 25 Apr 2006 08:00:00 GMT' + +--> +<rss version="2.0" > +<channel> +<pubDate>Tue, 25 Apr 2006 08:00:00 Z</pubDate> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/feed_pubDate_utc.xml b/toolkit/components/feeds/test/xml/rss2/feed_pubDate_utc.xml new file mode 100644 index 000000000..8eff56046 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_pubDate_utc.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: Test whether date parsing handles 'UTC' as a timezone. +Expect: feed.updated == 'Mon, 16 Apr 2007 03:12:45 GMT' + +--> +<rss version="2.0" > +<channel> +<pubDate>Monday, 16 April 2007 03:12:45 UTC</pubDate> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/feed_rating.xml b/toolkit/components/feeds/test/xml/rss2/feed_rating.xml new file mode 100644 index 000000000..dd5f8f9e5 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_rating.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel rating works +Expect: feed.fields.getProperty('rating') == '(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l by "webmaster@example.com" on "2006.01.29T10:09-0800" r (n 0 s 0 v 0 l 0))' + +--> +<rss version="2.0" > +<channel> +<rating>(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l by "webmaster@example.com" on "2006.01.29T10:09-0800" r (n 0 s 0 v 0 l 0))</rating> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_single_quote_stylesheet_pi.xml b/toolkit/components/feeds/test/xml/rss2/feed_single_quote_stylesheet_pi.xml new file mode 100644 index 000000000..10141fe7e --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_single_quote_stylesheet_pi.xml @@ -0,0 +1,26 @@ +<?xml version="1.0"?> +<!-- + +Description: stylesheets with single quoted attributes work. Bug 352549. +Base: http://www.penny-arcade.com/rss.xml +Expect: result.stylesheet.spec == "http://www.penny-arcade.com/stylesheets/rss-display.xsl" + +--> +<?xml-stylesheet type='text/xsl' href='/stylesheets/rss-display.xsl' version='1.0'?> +<rss version="2.0"> +<channel> +<title>Penny-Arcade</title> +<link>http://www.penny-arcade.com/</link> +<language>en-us</language> + +<copyright>Copyright 1999 - 2006 Penny Arcade, Inc.</copyright> +<image> +<url>http://www.penny-arcade.com/images/rss-logo.png</url> +<title>Penny-Arcade Logo</title> +<link>http://www.penny-arcade.com/</link> +<width>144</width> + +<height>82</height> +</image> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_skipDays.xml b/toolkit/components/feeds/test/xml/rss2/feed_skipDays.xml new file mode 100644 index 000000000..8c6ffa9e4 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_skipDays.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel skipDays works +Expect: ((feed.skipDays.queryElementAt(0, Components.interfaces.nsISupportsString) == 'Sunday') && (feed.skipDays.queryElementAt(1, Components.interfaces.nsISupportsString) == 'Monday')) + +--> +<rss version="2.0" > +<channel> +<skipDays> + <day>Sunday</day> + <day>Monday</day> +</skipDays> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/feed_skipHours.xml b/toolkit/components/feeds/test/xml/rss2/feed_skipHours.xml new file mode 100644 index 000000000..a20372eda --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_skipHours.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel skipHours works +Expect: ((feed.skipHours.queryElementAt(0, Components.interfaces.nsISupportsString) == '0') && (feed.skipHours.queryElementAt(4, Components.interfaces.nsISupportsString) == '23')) + +--> +<rss version="2.0" > +<channel> +<skipHours> + <hour>0</hour> + <hour>1</hour> + <hour>2</hour> + <hour>22</hour> + <hour>23</hour> +</skipHours> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/feed_subtitle.xml b/toolkit/components/feeds/test/xml/rss2/feed_subtitle.xml new file mode 100644 index 000000000..a98a3c19e --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_subtitle.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel description works +Expect: feed.subtitle.text == 'test' + +--> +<rss version="2.0" > +<channel> +<description>test</description> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/feed_subtitle_html.xml b/toolkit/components/feeds/test/xml/rss2/feed_subtitle_html.xml new file mode 100644 index 000000000..fca819d36 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_subtitle_html.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel description works +Expect: feed.subtitle.plainText() == '<i><b>test</b></i>' + +--> +<rss version="2.0" > +<channel> +<description><![CDATA[<i><b>test</b></i>]]></description> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/feed_subtitle_markup_stripped.xml b/toolkit/components/feeds/test/xml/rss2/feed_subtitle_markup_stripped.xml new file mode 100644 index 000000000..54f6a623c --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_subtitle_markup_stripped.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel description markup is not HTML +Expect: feed.subtitle.plainText() == '<i><b>test</b></i>' + +--> +<rss version="2.0" > +<channel> +<description><![CDATA[<i><b>test</b></i>]]></description> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/feed_textinput.xml b/toolkit/components/feeds/test/xml/rss2/feed_textinput.xml new file mode 100644 index 000000000..4617d62bc --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_textinput.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel textInput works +Expect: ((feed.textInput.getProperty('description') == 'Your aggregator supports the textInput element. What software are you using?') && (feed.textInput.getProperty('link') == 'http://www.cadenhead.org/textinput.php') && (feed.textInput.getProperty('name') == 'query') && (feed.textInput.getProperty('title') == 'TextInput Inquiry')) + +--> +<rss version="2.0" > +<channel> +<textInput> + <description>Your aggregator supports the textInput element. What software are you using?</description> + <link>http://www.cadenhead.org/textinput.php</link> + <name>query</name> + <title>TextInput Inquiry</title> +</textInput> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_title.xml b/toolkit/components/feeds/test/xml/rss2/feed_title.xml new file mode 100644 index 000000000..1f7d63ad2 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_title.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel title works +Expect: feed.title.plainText() == 'test title' + +--> +<rss version="2.0" > +<channel> +<title>test title</title> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/feed_title_cdata_mixed.xml b/toolkit/components/feeds/test/xml/rss2/feed_title_cdata_mixed.xml new file mode 100644 index 000000000..19ef62915 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_title_cdata_mixed.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel title works w/ funky CDATA title +Expect: feed.title.plainText() == 'test title' + +--> +<rss version="2.0" > +<channel> +<title>test t<![CDATA[it]]>le</title> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/feed_title_nesting.xml b/toolkit/components/feeds/test/xml/rss2/feed_title_nesting.xml new file mode 100644 index 000000000..82492cef7 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_title_nesting.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel title works w/ nested title +Expect: feed.title.text == 'test title' + +--> +<rss version="2.0" > +<channel> +<title>test title</title> +<bogus><title>bogus title</title></bogus> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/feed_ttl.xml b/toolkit/components/feeds/test/xml/rss2/feed_ttl.xml new file mode 100644 index 000000000..57158aff4 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_ttl.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel ttl works +Expect: feed.fields.getProperty('ttl') == '60' + +--> +<rss version="2.0" > +<channel> +<ttl>60</ttl> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_updated.xml b/toolkit/components/feeds/test/xml/rss2/feed_updated.xml new file mode 100644 index 000000000..c9e75e360 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_updated.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel pubDate works +Expect: feed.updated == 'Sat, 07 Sep 2002 00:00:01 GMT' + +--> +<rss version="2.0" > +<channel> +<pubDate>Sat, 07 Sep 2002 00:00:01 GMT</pubDate> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_updated_dcdate.xml b/toolkit/components/feeds/test/xml/rss2/feed_updated_dcdate.xml new file mode 100644 index 000000000..aa69e7800 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_updated_dcdate.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel pubDate works +Expect: feed.updated == 'Sat, 07 Sep 2002 00:00:01 GMT' + +--> +<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"> +<channel> +<dc:date>Sat, 07 Sep 2002 00:00:01 GMT</dc:date> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_updated_lastBuildDate.xml b/toolkit/components/feeds/test/xml/rss2/feed_updated_lastBuildDate.xml new file mode 100644 index 000000000..2fb24a7ec --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_updated_lastBuildDate.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel lastBuildDate works +Expect: feed.updated == 'Sat, 07 Sep 2002 00:00:01 GMT' + +--> +<rss version="2.0" > +<channel> +<lastBuildDate>Sat, 07 Sep 2002 00:00:01 GMT</lastBuildDate> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/feed_updated_lastBuildDate_priority.xml b/toolkit/components/feeds/test/xml/rss2/feed_updated_lastBuildDate_priority.xml new file mode 100644 index 000000000..24f024005 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_updated_lastBuildDate_priority.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel lastBuildDate trumps pubDate +Expect: feed.updated == 'Sat, 07 Sep 2002 00:00:01 GMT' + +--> +<rss version="2.0" > +<channel> +<pubDate>Sun, 08 Sep 2002 00:00:01 GMT</pubDate> +<lastBuildDate>Sat, 07 Sep 2002 00:00:01 GMT</lastBuildDate> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/feed_webMaster.xml b/toolkit/components/feeds/test/xml/rss2/feed_webMaster.xml new file mode 100644 index 000000000..887894983 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_webMaster.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel webMaster works +Expect: feed.fields.getProperty('webMaster') == 'example@example.com' + +--> +<rss version="2.0" > +<channel> +<webMaster>example@example.com</webMaster> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_wfw_commentapi.xml b/toolkit/components/feeds/test/xml/rss2/feed_wfw_commentapi.xml new file mode 100644 index 000000000..af725064e --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_wfw_commentapi.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel copyright works +Expect: feed.fields.getProperty('wfw:comment') == 'http://example.org' + +--> +<rss xmlns:wfw="http://wellformedweb.org/CommentAPI/" version="2.0" > +<channel xmlns:dc="http://purl.org/dc/elements/1.1/"> +<wfw:comment>http://example.org</wfw:comment> +<copyright>copyright 2006</copyright> +<dc:creator>me</dc:creator> +<dc:contributor>them</dc:contributor> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_wfw_commentrss.xml b/toolkit/components/feeds/test/xml/rss2/feed_wfw_commentrss.xml new file mode 100644 index 000000000..fb1d89609 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_wfw_commentrss.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel copyright works +Expect: feed.fields.getProperty('wfw:commentRss') == 'http://example.org' + +--> +<rss xmlns:wfw="http://wellformedweb.org/CommentAPI/" version="2.0" > +<channel xmlns:dc="http://purl.org/dc/elements/1.1/"> +<copyright>copyright 2006</copyright> +<dc:creator>me</dc:creator> +<wfw:commentRss>http://example.org</wfw:commentRss> +<dc:contributor>them</dc:contributor> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_wiki.xml b/toolkit/components/feeds/test/xml/rss2/feed_wiki.xml new file mode 100644 index 000000000..b8cb783b0 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_wiki.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel unusual prefixed ext works +Expect: feed.fields.getProperty('wiki:version') == '1' + +--> +<rss +xmlns:w='http://purl.org/rss/1.0/modules/wiki/' +xmlns:wfw="http://wellformedweb.org/CommentAPI/" version="2.0" > +<channel xmlns:dc="http://purl.org/dc/elements/1.1/"> +<copyright>copyright 2006</copyright> +<dc:creator>me</dc:creator> +<w:version>1</w:version> +<wfw:commentRss>http://example.org</wfw:commentRss> +<dc:contributor>them</dc:contributor> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/feed_wiki_unusual_prefix.xml b/toolkit/components/feeds/test/xml/rss2/feed_wiki_unusual_prefix.xml new file mode 100644 index 000000000..b8cb783b0 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/feed_wiki_unusual_prefix.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel unusual prefixed ext works +Expect: feed.fields.getProperty('wiki:version') == '1' + +--> +<rss +xmlns:w='http://purl.org/rss/1.0/modules/wiki/' +xmlns:wfw="http://wellformedweb.org/CommentAPI/" version="2.0" > +<channel xmlns:dc="http://purl.org/dc/elements/1.1/"> +<copyright>copyright 2006</copyright> +<dc:creator>me</dc:creator> +<w:version>1</w:version> +<wfw:commentRss>http://example.org</wfw:commentRss> +<dc:contributor>them</dc:contributor> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/item_author.xml b/toolkit/components/feeds/test/xml/rss2/item_author.xml new file mode 100644 index 000000000..ad0c97e2a --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_author.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item author works +Expect: var authors = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).authors; var author = authors.queryElementAt(0, Components.interfaces.nsIFeedPerson); ((author.name == 'Joe Bob Briggs')); + +--> +<rss version="2.0" > +<channel> +<item> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<title>test</title> +</item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_category.xml b/toolkit/components/feeds/test/xml/rss2/item_category.xml new file mode 100644 index 000000000..4795e00bb --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_category.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item category works +Expect: var cats = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('categories'); cats.QueryInterface(Components.interfaces.nsIArray); var cat = cats.queryElementAt(0, Components.interfaces.nsIPropertyBag); ((cat.getProperty('domain') == 'foo') && (cat.getProperty('term') == 'bar')); + +--> +<rss version="2.0" > +<channel> +<item> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<title>test</title> +<category domain="foo">bar</category> +</item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_comments.xml b/toolkit/components/feeds/test/xml/rss2/item_comments.xml new file mode 100644 index 000000000..da1cccc82 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_comments.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item comments works +Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('comments') == 'http://example.org' + +--> +<rss version="2.0" > +<channel> +<item> +<title>test</title> +<!--<author>jbb@dallas.example.com (Joe Bob Briggs)</author>--> +<comments>http://example.org</comments> + +<category domain="foo">bar</category> + +</item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_content_encoded.xml b/toolkit/components/feeds/test/xml/rss2/item_content_encoded.xml new file mode 100644 index 000000000..6611375b6 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_content_encoded.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item title works +Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).content.plainText() == 'foobar' + +--> +<rss version="2.0" > +<channel> +<item xmlns:c="http://purl.org/rss/1.0/modules/content/"> + <title>test</title> + <c:encoded>foobar</c:encoded> +</item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_count.xml b/toolkit/components/feeds/test/xml/rss2/item_count.xml new file mode 100644 index 000000000..a69cbc979 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_count.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: items length is correct +Expect: feed.items.length == 1 + +--> +<rss version="2.0" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + +<channel> +<title>Items Test</title> +<link>http://mozilla.org/</link> +<description></description> + +<dc:language>en-us</dc:language> +<dc:creator>sayrer@gmail.com</dc:creator> +<dc:date>2005-12-07T14:48:03-05:00</dc:date> + +<item> +<title>Is the date right?</title> +<link>http://example.org/dc_date.html</link> +</item> + +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/item_count2.xml b/toolkit/components/feeds/test/xml/rss2/item_count2.xml new file mode 100644 index 000000000..27df0a932 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_count2.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: items length is correct +Expect: feed.items.length == 2 + +--> +<rss version="2.0" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + +<channel> +<title>Items Test</title> +<link>http://mozilla.org/</link> +<description></description> + +<dc:language>en-us</dc:language> +<dc:creator>sayrer@gmail.com</dc:creator> +<dc:date>2005-12-07T14:48:03-05:00</dc:date> + +<item> +<title>Is the date right?</title> +<link>http://example.org/dc_date.html</link> +</item> +<item> +<title>Is the date right?</title> +<link>http://example.org/dc_date.html</link> +</item> + +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/item_description.xml b/toolkit/components/feeds/test/xml/rss2/item_description.xml new file mode 100644 index 000000000..7416d48e6 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_description.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item desc encoded works +Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).summary.text == 'I\'m headed for France. I wasn\'t gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.' + +--> +<rss version="2.0" > +<channel> +<item> +<comments>http://example.org</comments> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<title>test</title> +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_description_2.xml b/toolkit/components/feeds/test/xml/rss2/item_description_2.xml new file mode 100644 index 000000000..427726868 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_description_2.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item desc encoded works +Expect: feed.items.queryElementAt(1, Components.interfaces.nsIFeedEntry).summary.text == 'I\'m headed for France. I wasn\'t gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.' + +--> +<rss version="2.0" > +<channel> +<item> + <description>hmmm</description> +</item> +<item> +<comments>http://example.org</comments> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<title>test</title> +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_description_cdata.xml b/toolkit/components/feeds/test/xml/rss2/item_description_cdata.xml new file mode 100644 index 000000000..ef3926f87 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_description_cdata.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item desc CDATA works +Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).summary.text == 'I\'m headed for France. I wasn\'t gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.' + +--> +<rss version="2.0" > +<channel> +<item> + +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test</title> + +<category domain="foo">bar</category> +<description><![CDATA[I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.]]></description> +</item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_description_decode_entities.xml b/toolkit/components/feeds/test/xml/rss2/item_description_decode_entities.xml new file mode 100644 index 000000000..e259354dc --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_description_decode_entities.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + +Description: item desc encoded, double-escaped entity +Expect: var summary = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).summary; summary.plainText() == "test D\u00e9sol\u00e9e"; + +--> +<rss version="2.0" > +<channel> +<item> +<comments>http://example.org</comments> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<title>test</title> +<category domain="foo">bar</category> + +<description> + <b>test D&eacute;sol&eacute;e</b> +</description> +</item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_description_normalized.xml b/toolkit/components/feeds/test/xml/rss2/item_description_normalized.xml new file mode 100644 index 000000000..9819deb36 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_description_normalized.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item desc encoded, normalied works +Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).summary.text == 'I\'m headed for France. I wasn\'t gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.' + +--> +<rss version="2.0" > +<channel> +<item> +<comments>http://example.org</comments> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<title>test</title> +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_description_normalized_nohtml.xml b/toolkit/components/feeds/test/xml/rss2/item_description_normalized_nohtml.xml new file mode 100644 index 000000000..0a34a008d --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_description_normalized_nohtml.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item desc encoded, normalized works +Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).summary.plainText() == 'I\'m headed for France. I wasn\'t gonna go this year, but then last week Valley Girl came out and I said to myself, Joe Bob, you gotta get out of the country for a while.' + +--> +<rss version="2.0" > +<channel> +<item> +<comments>http://example.org</comments> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<title>test</title> +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_enclosure.xml b/toolkit/components/feeds/test/xml/rss2/item_enclosure.xml new file mode 100644 index 000000000..2e38a370a --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_enclosure.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item enclosure works +Expect: var enc = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('enclosure'); enc.QueryInterface(Components.interfaces.nsIPropertyBag); ((enc.getProperty('length') == '24986239') && (enc.getProperty('type') == 'audio/mpeg') && (enc.getProperty('url') == 'http://dallas.example.com/joebob_050689.mp3') && (feed.type == 1) && (feed.enclosureCount == 1)); + +--> +<rss version="2.0" > +<channel> +<item> + +<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test</title> + +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_enclosure_duplicates.xml b/toolkit/components/feeds/test/xml/rss2/item_enclosure_duplicates.xml new file mode 100644 index 000000000..a9bcd2cc9 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_enclosure_duplicates.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: feed with duplicate enclosures on a single item +Expect: ((feed.type == 4) && (feed.enclosureCount == 1)); + +--> +<rss xmlns:media="http://search.yahoo.com/mrss" version="2.0" > +<channel> + +<item> +<enclosure length="24986239" type="video/mpeg" url="http://dallas.example.com/joebob_050689.mpeg" /> +<media:content fileSize="24986239" type="video/mpeg" url="http://dallas.example.com/joebob_050689.mpeg" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test audio</title> + +<category domain="foo">bar</category> + +<description>Listen to the words that are coming out of my mouth.</description> +</item> + +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_enclosure_duplicates2.xml b/toolkit/components/feeds/test/xml/rss2/item_enclosure_duplicates2.xml new file mode 100644 index 000000000..51f7caba9 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_enclosure_duplicates2.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: feed with duplicate enclosures on a single item with different data available +Expect: var enc = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('enclosure'); enc.QueryInterface(Components.interfaces.nsIPropertyBag); ((enc.getProperty('length') == '24986239') && (enc.getProperty('type') == 'video/mpeg') && (feed.type == 4) && (feed.enclosureCount == 1) ); + +--> +<rss xmlns:media="http://search.yahoo.com/mrss" version="2.0" > +<channel> + +<item> +<enclosure url="http://dallas.example.com/joebob_050689.mpeg" /> +<media:content fileSize="24986239" type="video/mpeg" url="http://dallas.example.com/joebob_050689.mpeg" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test audio</title> + +<category domain="foo">bar</category> + +<description>Listen to the words that are coming out of my mouth.</description> +</item> + +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_enclosure_mixed.xml b/toolkit/components/feeds/test/xml/rss2/item_enclosure_mixed.xml new file mode 100644 index 000000000..7b49e4d74 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_enclosure_mixed.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: feed with different kinds of enclosures that should be TYPE_FEED (0) +Expect: ((feed.type == 0) && (feed.enclosureCount == 2)); + +--> +<rss version="2.0" > +<channel> + +<item> +<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test audio</title> + +<category domain="foo">bar</category> + +<description>Listen to the words that are coming out of my mouth.</description> +</item> + +<item> +<enclosure length="3000000" type="video/mpeg" url="http://dallas.example.com/joebob_pants.mpeg" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test video</title> + +<category domain="foo">bar</category> + +<description>Look into my eyes....</description> +</item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_enclosure_mixed2.xml b/toolkit/components/feeds/test/xml/rss2/item_enclosure_mixed2.xml new file mode 100644 index 000000000..a54a40559 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_enclosure_mixed2.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: feed that doesn't have at least one enclosure per entry should be TYPE_FEED (0) +Expect: ((feed.type == 0) && (feed.enclosureCount == 1)); + +--> +<rss version="2.0" > +<channel> + +<item> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>no video this week!</title> + +<category domain="foo">bar</category> + +<description>I'm on a trip to the moon this week for this year's Spaceshot Vlogger +conference. No video this week!</description> +</item> + +<item> +<enclosure length="3000000" type="video/mpeg" url="http://dallas.example.com/joebob_pants.mpeg" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>orange keyboard</title> + +<category domain="foo">bar</category> + +<description>Crazy things happen when you paint your keyboard orange.</description> +</item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid.xml b/toolkit/components/feeds/test/xml/rss2/item_guid.xml new file mode 100644 index 000000000..2e7f551ef --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_guid.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item guid works +Expect: var guid = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('guid'); guid.QueryInterface(Components.interfaces.nsIPropertyBag2); guid.getProperty('guid') == 'asdf'; + +--> +<rss version="2.0" > +<channel> +<item> + +<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test</title> +<guid>asdf</guid> +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid_bogus_url.xml b/toolkit/components/feeds/test/xml/rss2/item_guid_bogus_url.xml new file mode 100644 index 000000000..2f1b67ced --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_guid_bogus_url.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item copes with bogus guid +Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link == null; + +--> +<rss version="2.0" > +<channel> +<item> + +<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test</title> +<guid isPermaLink="true">xorg</guid> +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink.xml b/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink.xml new file mode 100644 index 000000000..c64341427 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item guid works +Expect: var link = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link; link.spec == 'http://www.example.org/'; + +--> +<rss version="2.0" > +<channel> +<item> + +<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<title>test</title> +<guid isPermaLink="true">http://www.example.org/</guid> +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_default.xml b/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_default.xml new file mode 100644 index 000000000..7d6ae7958 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_default.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item guid works +Expect: var link = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link; link.spec == 'http://www.example.org/'; + +--> +<rss version="2.0" > +<channel> +<item> + +<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<title>test</title> +<guid>http://www.example.org/</guid> +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_false.xml b/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_false.xml new file mode 100644 index 000000000..c2a1ad867 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_false.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item guid should not map to link when isPermaLink=false +Expect: var link = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link; link == null; + +--> +<rss version="2.0" > +<channel> +<item> + +<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<title>test</title> +<guid isPermaLink="false">http://www.example.org/</guid> +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_false_uppercase.xml b/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_false_uppercase.xml new file mode 100644 index 000000000..9ff2505c4 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_false_uppercase.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item guid should not map to link when isPermaLink=FaLsE +Expect: var link = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link; link == null; + +--> +<rss version="2.0" > +<channel> +<item> + +<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<title>test</title> +<guid isPermaLink="FaLsE">http://www.example.org/</guid> +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_true_uppercase.xml b/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_true_uppercase.xml new file mode 100644 index 000000000..bc4fdc0e9 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_true_uppercase.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item guid should map to link when isPermaLink=TrUe +Expect: var link = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link; link.spec == "http://www.example.org/"; + +--> +<rss version="2.0" > +<channel> +<item> + +<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<title>test</title> +<guid isPermaLink="TrUe">http://www.example.org/</guid> +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_unknown_value.xml b/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_unknown_value.xml new file mode 100644 index 000000000..4dce8c390 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_unknown_value.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item guid should map to link when isPermaLink=meatcake or other unknown values +Expect: var link = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link; link.spec == "http://www.example.org/"; + +--> +<rss version="2.0" > +<channel> +<item> + +<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<title>test</title> +<guid isPermaLink="meatcake">http://www.example.org/</guid> +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid_normalized.xml b/toolkit/components/feeds/test/xml/rss2/item_guid_normalized.xml new file mode 100644 index 000000000..e4ac97862 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_guid_normalized.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item guid works +Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).id == 'asdf'; + +--> +<rss version="2.0" > +<channel> +<item> + +<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test</title> +<guid>asdf</guid> +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid_with_link.xml b/toolkit/components/feeds/test/xml/rss2/item_guid_with_link.xml new file mode 100644 index 000000000..d2d3daca5 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_guid_with_link.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item prefers link to guid +Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link.spec == 'http://link.example.org/'; + +--> +<rss version="2.0" > +<channel> +<item> + +<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test</title> +<guid isPermaLink="true">http://www.example.org</guid> +<link>http://link.example.org/</link> +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_link.xml b/toolkit/components/feeds/test/xml/rss2/item_link.xml new file mode 100644 index 000000000..c89f71e77 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_link.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item comments works +Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('link') == 'http://dallas.example.com/1983/05/06/joebob.htm' + +--> +<rss version="2.0" > +<channel> +<item> +<title>test</title> +<!--<author>jbb@dallas.example.com (Joe Bob Briggs)</author>--> +<comments>http://example.org</comments> +<link>http://dallas.example.com/1983/05/06/joebob.htm</link> +<category domain="foo">bar</category> + +</item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_link_normalized.xml b/toolkit/components/feeds/test/xml/rss2/item_link_normalized.xml new file mode 100644 index 000000000..876d7613c --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_link_normalized.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item link normalized works +Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link.spec == 'http://dallas.example.com/1983/05/06/joebob.htm' + +--> +<rss version="2.0" > +<channel> +<item> +<title>test</title> +<!--<author>jbb@dallas.example.com (Joe Bob Briggs)</author>--> +<comments>http://example.org</comments> +<link>http://dallas.example.com/1983/05/06/joebob.htm</link> +<category domain="foo">bar</category> + +</item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_plain_desc.xml b/toolkit/components/feeds/test/xml/rss2/item_plain_desc.xml new file mode 100644 index 000000000..ffb4226f1 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_plain_desc.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item desc plain text works +Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).summary.text == "I'm headed for France. I wasn't gonna go this year, but then last week \"Valley Girl\" came out and I said to myself, Joe Bob, you gotta get out of the country for a while." + +--> +<rss version="2.0" > +<channel> +<item> + +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test</title> + +<category domain="foo">bar</category> +<description>I'm headed for France. I wasn't gonna go this year, but then last week "Valley Girl" came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_populated_enclosures.xml b/toolkit/components/feeds/test/xml/rss2/item_populated_enclosures.xml new file mode 100644 index 000000000..0a7d60df6 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_populated_enclosures.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item enclosure is added to enclosures array +Expect: var encs = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).enclosures; encs.QueryInterface(Components.interfaces.nsIArray); var enc = encs.queryElementAt(0, Components.interfaces.nsIPropertyBag2); ((enc.getProperty('length') == '24986239') && (enc.getProperty('type') == 'audio/mpeg') && (enc.getProperty('url') == 'http://dallas.example.com/joebob_050689.mp3')); + +--> +<rss version="2.0" > +<channel> +<item> + +<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test</title> + +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_pubDate.xml b/toolkit/components/feeds/test/xml/rss2/item_pubDate.xml new file mode 100644 index 000000000..acb4abdcc --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_pubDate.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: entry pubDate works +Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).published == 'Tue, 02 Sep 2003 00:00:01 GMT' + +--> +<rss version="2.0" xmlns:dcterms="http://purl.org/dc/terms/"> +<channel> +<item> +<pubDate>Tue, 02 Sep 2003 00:00:01 GMT</pubDate> +</item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_published.xml b/toolkit/components/feeds/test/xml/rss2/item_published.xml new file mode 100644 index 000000000..86bf55602 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_published.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: entry published works +Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).published == 'Sat, 07 Sep 2002 00:00:01 GMT' + +--> +<rss version="2.0" xmlns:dcterms="http://purl.org/dc/terms/"> +<channel> +<item> +<dcterms:issued>Sat, 07 Sep 2002 00:00:01 GMT</dcterms:issued> +</item> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/item_title.xml b/toolkit/components/feeds/test/xml/rss2/item_title.xml new file mode 100644 index 000000000..0126d7da0 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_title.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item title works +Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('title') == 'test' + +--> +<rss version="2.0" > +<channel> +<item> + <title>test</title> +</item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_title_normalized.xml b/toolkit/components/feeds/test/xml/rss2/item_title_normalized.xml new file mode 100644 index 000000000..51de0f7e2 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_title_normalized.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: item title works +Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).title.text == 'test' + +--> +<rss version="2.0" > +<channel> +<item> + <title>test</title> +</item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/item_updated_dcdate.xml b/toolkit/components/feeds/test/xml/rss2/item_updated_dcdate.xml new file mode 100644 index 000000000..dc20cdbc0 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/item_updated_dcdate.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: channel pubDate works +Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).updated == 'Sat, 07 Sep 2002 00:00:01 GMT' + +--> +<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"> +<channel> +<item> +<dc:date>Sat, 07 Sep 2002 00:00:01 GMT</dc:date> +</item> +</channel> +</rss>
\ No newline at end of file diff --git a/toolkit/components/feeds/test/xml/rss2/items_2_titles.xml b/toolkit/components/feeds/test/xml/rss2/items_2_titles.xml new file mode 100644 index 000000000..3a0d1eb67 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/items_2_titles.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: 2 items title works +Expect: ((feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).title.text == 'test') && (feed.items.queryElementAt(1, Components.interfaces.nsIFeedEntry).title.text == 'test #2')) + +--> +<rss version="2.0" > +<channel> +<item> + <title>test</title> +</item> +<item> + <title>test #2</title> +</item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/mrss_content.xml b/toolkit/components/feeds/test/xml/rss2/mrss_content.xml new file mode 100644 index 000000000..62a47cdef --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/mrss_content.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: mrss content works +Expect: var enc = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getPropertyAsInterface('mediacontent', Components.interfaces.nsIArray).queryElementAt(0, Components.interfaces.nsIPropertyBag); Assert.equal(enc.getProperty('fileSize'), '24986239', 'file size is correct'); Assert.equal(enc.getProperty('type'), 'video/mpeg', 'type is correct'); Assert.equal(enc.getProperty('url'), 'http://dallas.example.com/joebob_050689.mpeg', 'url is correct'); Assert.equal(feed.type, 4, 'Feed type is correct'); Assert.equal(feed.enclosureCount,1, 'Enclosure count is correct'); true; + +--> +<rss xmlns:media="http://search.yahoo.com/mrss" version="2.0" > +<channel> +<item> + +<media:content fileSize="24986239" type="video/mpeg" url="http://dallas.example.com/joebob_050689.mpeg" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test</title> + +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/mrss_content2.xml b/toolkit/components/feeds/test/xml/rss2/mrss_content2.xml new file mode 100644 index 000000000..a0d740e69 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/mrss_content2.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: mrss content with a thumbnail +Expect: var enc = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getPropertyAsInterface('mediacontent', Components.interfaces.nsIArray).queryElementAt(0, Components.interfaces.nsIPropertyBag); Assert.equal(enc.getProperty('fileSize'), '24986239', 'file size is correct'); Assert.equal(enc.getProperty('type'), 'video/mpeg', 'type is correct'); Assert.equal(enc.getProperty('url'), 'http://dallas.example.com/joebob_050689.mpeg', 'url is correct'); Assert.equal(feed.type, 0, 'Feed type is correct'); Assert.equal(feed.enclosureCount,2, 'Enclosure count is correct'); true; + +--> +<rss xmlns:media="http://search.yahoo.com/mrss" version="2.0" > +<channel> +<item> + +<media:content fileSize="24986239" type="video/mpeg" url="http://dallas.example.com/joebob_050689.mpeg" /> +<media:thumbnail url="http://dallas.example.com/joebob_050689.jpg" width="75" height="50"/> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test</title> + +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/mrss_content_429049.xml b/toolkit/components/feeds/test/xml/rss2/mrss_content_429049.xml new file mode 100644 index 000000000..d13efc94c --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/mrss_content_429049.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: this tests bug 429049. the item with a valid url is added to the enclosures array and the item with an empty url does not. +Expect: var encs = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).enclosures; encs.QueryInterface(Components.interfaces.nsIArray); (encs.length == 1); + +--> +<rss xmlns:media="http://search.yahoo.com/mrss" version="2.0" > +<channel> + +<item> +<media:content fileSize="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test</title> + +<category domain="foo">bar</category> +<description>no description</description> +</item> + +<item> +<media:content url="" height="" width=""></media:content> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test empty</title> + +<category domain="foo">bar</category> +<description>no description</description> +</item> + +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/mrss_content_multiple.xml b/toolkit/components/feeds/test/xml/rss2/mrss_content_multiple.xml new file mode 100644 index 000000000..c391efdd2 --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/mrss_content_multiple.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: mrss content with multiple media:content items works +Expect: var mcs = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('mediacontent'); mcs.QueryInterface(Components.interfaces.nsIArray); var enc1 = mcs.queryElementAt(0, Components.interfaces.nsIPropertyBag); var enc2 = mcs.queryElementAt(1, Components.interfaces.nsIPropertyBag); ((enc1.getProperty('fileSize') == '24986239') && (enc1.getProperty('type') == 'video/mpeg') && (enc1.getProperty('url') == 'http://dallas.example.com/joebob_1.mpeg') && (enc2.getProperty('fileSize') == '30000000') && (enc2.getProperty('type') == 'video/mpeg') && (enc2.getProperty('url') == 'http://dallas.example.com/joebob_2.mpeg') && (feed.type == 4) && (feed.enclosureCount == 2)); + +--> +<rss xmlns:media="http://search.yahoo.com/mrss" version="2.0" > +<channel> +<item> + +<media:content fileSize="24986239" type="video/mpeg" url="http://dallas.example.com/joebob_1.mpeg" /> +<media:content fileSize="30000000" type="video/mpeg" url="http://dallas.example.com/joebob_2.mpeg" /> + +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test</title> + +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while. Two videos of that.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/mrss_content_populate_enclosure.xml b/toolkit/components/feeds/test/xml/rss2/mrss_content_populate_enclosure.xml new file mode 100644 index 000000000..f0718655f --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/mrss_content_populate_enclosure.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: mrss content added to enclosures array +Expect: var encs = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).enclosures; encs.QueryInterface(Components.interfaces.nsIArray); var enc = encs.queryElementAt(0, Components.interfaces.nsIPropertyBag); ((enc.getProperty('length') == '24986239') && (enc.getProperty('type') == 'audio/mpeg') && (enc.getProperty('url') == 'http://dallas.example.com/joebob_050689.mp3') && (feed.type == 1) && (feed.enclosureCount == 1)); + +--> +<rss xmlns:media="http://search.yahoo.com/mrss" version="2.0" > +<channel> +<item> + +<media:content fileSize="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" /> +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test</title> + +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/mrss_group_content.xml b/toolkit/components/feeds/test/xml/rss2/mrss_group_content.xml new file mode 100644 index 000000000..da2ddb29c --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/mrss_group_content.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: mrss group content works +Expect: var mg = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('mediagroup'); mg.QueryInterface(Components.interfaces.nsIPropertyBag); var mcs = mg.getProperty("mediacontent"); mcs.QueryInterface(Components.interfaces.nsIArray); var mc1 = mcs.queryElementAt(0, Components.interfaces.nsIPropertyBag); var mc2 = mcs.queryElementAt(1, Components.interfaces.nsIPropertyBag); ((mc1.getProperty('fileSize') == '400') && (mc1.getProperty('type') == 'audio/mpeg') && (mc1.getProperty('url') == 'http://dallas.example.com/joebob_050689_2.mp3') && (mc2.getProperty('fileSize') == '200') && (mc2.getProperty('type') == 'audio/mpeg') && (mc2.getProperty('url') == 'http://dallas.example.com/joebob_050689_1.mp3')); + +--> +<rss xmlns:media="http://search.yahoo.com/mrss" version="2.0" > +<channel> +<item> + +<media:group> + <media:content fileSize="400" type="audio/mpeg" url="http://dallas.example.com/joebob_050689_2.mp3" /> + <media:content fileSize="200" type="audio/mpeg" url="http://dallas.example.com/joebob_050689_1.mp3" /> +</media:group> + +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test</title> + +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> + +</channel> +</rss> diff --git a/toolkit/components/feeds/test/xml/rss2/mrss_group_content_populate_enclosure.xml b/toolkit/components/feeds/test/xml/rss2/mrss_group_content_populate_enclosure.xml new file mode 100644 index 000000000..f7b9ebabf --- /dev/null +++ b/toolkit/components/feeds/test/xml/rss2/mrss_group_content_populate_enclosure.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- + +Description: mrss group content works +Expect: var encs = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).enclosures; encs.QueryInterface(Components.interfaces.nsIArray); var enc1 = encs.queryElementAt(0, Components.interfaces.nsIPropertyBag); var enc2 = encs.queryElementAt(1, Components.interfaces.nsIPropertyBag); ((enc1.getProperty('length') == '400') && (enc1.getProperty('type') == 'audio/mpeg') && (enc1.getProperty('url') == 'http://dallas.example.com/joebob_050689_2.mp3') && (enc2.getProperty('length') == '200') && (enc2.getProperty('type') == 'audio/mpeg') && (enc2.getProperty('url') == 'http://dallas.example.com/joebob_050689_1.mp3')); + + +--> +<rss xmlns:media="http://search.yahoo.com/mrss" version="2.0" > +<channel> +<item> + +<media:group> + <media:content fileSize="400" type="audio/mpeg" url="http://dallas.example.com/joebob_050689_2.mp3" /> + <media:content fileSize="200" type="audio/mpeg" url="http://dallas.example.com/joebob_050689_1.mp3" /> +</media:group> + +<author>jbb@dallas.example.com (Joe Bob Briggs)</author> +<comments>http://example.org</comments> +<title>test</title> + +<category domain="foo">bar</category> + +<description>I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item> +</channel> +</rss> |