1 |
41cc1b08
|
Assos Assos
|
<!DOCTYPE HTML>
|
2 |
|
|
<html>
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
<head>
|
22 |
|
|
<title>Test for feed discovery</title>
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
<link rel="alternate" type="application/atom+xml" title="1" href="/1.atom" />
|
26 |
|
|
<link rel="alternate" type="application/rss+xml" title="2" href="/2.rss" />
|
27 |
|
|
<link rel="feed" title="3" href="/3.xml" />
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
<link rel=" alternate " type="application/atom+xml" title="4" href="/4.atom" />
|
31 |
|
|
<link rel="foo alternate" type="application/atom+xml" title="5" href="/5.atom" />
|
32 |
|
|
<link rel="alternate foo" type="application/atom+xml" title="6" href="/6.atom" />
|
33 |
|
|
<link rel="foo alternate foo" type="application/atom+xml" title="7" href="/7.atom" />
|
34 |
|
|
<link rel="meat feed cake" title="8" href="/8.atom" />
|
35 |
|
|
|
36 |
|
|
|
37 |
|
|
<link rel="ALTERNate" type="application/atom+xml" title="9" href="/9.atom" />
|
38 |
|
|
<link rel="fEEd" title="10" href="/10.atom" />
|
39 |
|
|
|
40 |
|
|
|
41 |
|
|
<link rel="alternate" type=" application/atom+xml " title="11" href="/11.atom" />
|
42 |
|
|
|
43 |
|
|
|
44 |
|
|
<link rel="alternate" type="aPPliCAtion/ATom+xML" title="12" href="/12.atom" />
|
45 |
|
|
|
46 |
|
|
|
47 |
|
|
<link rel="feed stylesheet" title="13" href="/13.atom" />
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
<link rel="disabled-alternate" type="application/atom+xml" title="Bogus1" href="/Bogus1" />
|
51 |
|
|
<link rel="alternates" type="application/atom+xml" title="Bogus2" href="/Bogus2" />
|
52 |
|
|
<link rel=" alternate-like" type="application/atom+xml" title="Bogus3" href="/Bogus3" />
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
<link rel="alternate" type="text/xml" title="Bogus4 scissorsshaped" href="/Bogus4" />
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
<link rel="alternate" type="application/xml" title="Bogus5 scissorsshaped" href="/Bogus5" />
|
59 |
|
|
|
60 |
|
|
|
61 |
|
|
<link rel="alternate" type="application/rdf+xml" title="Bogus6 scissorsshaped" href="/Bogus6" />
|
62 |
|
|
|
63 |
|
|
|
64 |
|
|
<link rel="alternate" type="text/plain" title="Bogus7 rss" href="/Bogus7" />
|
65 |
|
|
|
66 |
|
|
|
67 |
|
|
<link rel="foopy" type="application/atom+xml" title="Bogus8 Atom and RSS" href="/Bogus8" />
|
68 |
|
|
|
69 |
|
|
|
70 |
|
|
<link rel="goats" type="application/rss+xml" title="Bogus9 RSS and Atom" href="/Bogus9" />
|
71 |
|
|
|
72 |
|
|
|
73 |
|
|
<link rel="alternate" type="application/rdf+xml" title="Bogus10 RSS and Atom" href="/Bogus10" />
|
74 |
|
|
|
75 |
|
|
|
76 |
|
|
<link rel="alternate" type="application/xml" title="Bogus11 RSS and Atom" href="/Bogus11" />
|
77 |
|
|
|
78 |
|
|
|
79 |
|
|
<link rel="alternate" type="text/xml" title="Bogus12 RSS and Atom" href="/Bogus12" />
|
80 |
|
|
|
81 |
|
|
|
82 |
|
|
<link rel="alternate stylesheet" type="application/rss+xml" title="Bogus13 RSS" href="/Bogus13" />
|
83 |
|
|
</head>
|
84 |
|
|
<body>
|
85 |
|
|
<script type="text/javascript">
|
86 |
|
|
window.onload = function() {
|
87 |
|
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
88 |
|
|
|
89 |
|
|
var tests = new Array();
|
90 |
|
|
|
91 |
|
|
var currentWindow =
|
92 |
|
|
window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
|
93 |
|
|
.getInterface(Components.interfaces.nsIWebNavigation)
|
94 |
|
|
.QueryInterface(Components.interfaces.nsIDocShellTreeItem)
|
95 |
|
|
.rootTreeItem
|
96 |
|
|
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
|
97 |
|
|
.getInterface(Components.interfaces.nsIDOMWindow);
|
98 |
|
|
var browser = currentWindow.gBrowser.selectedBrowser;
|
99 |
|
|
|
100 |
|
|
var discovered = browser.feeds;
|
101 |
|
|
tests.push({ check: discovered.length > 0,
|
102 |
|
|
message: "some feeds should be discovered" });
|
103 |
|
|
|
104 |
|
|
var feeds = [];
|
105 |
|
|
|
106 |
|
|
for each (var aFeed in discovered) {
|
107 |
|
|
feeds[aFeed.href] = true;
|
108 |
|
|
}
|
109 |
|
|
|
110 |
|
|
for each (var aLink in document.getElementsByTagName("link")) {
|
111 |
|
|
|
112 |
|
|
if (aLink.type != "text/css" && aLink.href) {
|
113 |
|
|
if (/bogus/i.test(aLink.title)) {
|
114 |
|
|
tests.push({ check: !feeds[aLink.href],
|
115 |
|
|
message: "don't discover " + aLink.href });
|
116 |
|
|
} else {
|
117 |
|
|
tests.push({ check: feeds[aLink.href],
|
118 |
|
|
message: "should discover " + aLink.href });
|
119 |
|
|
}
|
120 |
|
|
}
|
121 |
|
|
}
|
122 |
|
|
window.arguments[0].tests = tests;
|
123 |
|
|
window.close();
|
124 |
|
|
}
|
125 |
|
|
</script>
|
126 |
|
|
</body>
|
127 |
|
|
</html>
|