browser/components/feeds/test/unit/test_355473.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

michael@0 1 function run_test() {
michael@0 2 var feedFeedURI = ios.newURI("feed://example.com/feed.xml", null, null);
michael@0 3 var httpFeedURI = ios.newURI("feed:http://example.com/feed.xml", null, null);
michael@0 4 var httpURI = ios.newURI("http://example.com/feed.xml", null, null);
michael@0 5
michael@0 6 var httpsFeedURI =
michael@0 7 ios.newURI("feed:https://example.com/feed.xml", null, null);
michael@0 8 var httpsURI = ios.newURI("https://example.com/feed.xml", null, null);
michael@0 9
michael@0 10 var feedChannel = ios.newChannelFromURI(feedFeedURI, null);
michael@0 11 var httpChannel = ios.newChannelFromURI(httpFeedURI, null);
michael@0 12 var httpsChannel = ios.newChannelFromURI(httpsFeedURI, null);
michael@0 13
michael@0 14 // not setting .originalURI to the original URI is naughty
michael@0 15 do_check_true(feedFeedURI.equals(feedChannel.originalURI));
michael@0 16 do_check_true(httpFeedURI.equals(httpChannel.originalURI));
michael@0 17 do_check_true(httpsFeedURI.equals(httpsChannel.originalURI));
michael@0 18
michael@0 19 // actually using the horrible mess that's a feed: URI is suicidal
michael@0 20 do_check_true(httpURI.equals(feedChannel.URI));
michael@0 21 do_check_true(httpURI.equals(httpChannel.URI));
michael@0 22 do_check_true(httpsURI.equals(httpsChannel.URI));
michael@0 23
michael@0 24 // check that we don't throw creating feed: URIs from file and ftp
michael@0 25 var ftpFeedURI = ios.newURI("feed:ftp://example.com/feed.xml", null, null);
michael@0 26 var fileFeedURI = ios.newURI("feed:file:///var/feed.xml", null, null);
michael@0 27 }

mercurial