summaryrefslogtreecommitdiffstats
path: root/3rdparty/simplepie/tests/data/fftests.html
blob: 283f722ef327d084f49972eed2fd4ad1f68cb54f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=377611

From Firefox Source Code, mozilla.org, licensed under LGPL 2.1:

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-->
  <head>
    <title>Test for feed discovery</title>

    <!-- Straight up standard -->
    <link rel="alternate" type="application/atom+xml" title="1" href="/1.atom" />
    <link rel="alternate" type="application/rss+xml" title="2" href="/2.rss" />
    <link rel="feed" title="3" href="/3.xml" />

    <!-- rel is a space-separated list -->
    <link rel=" alternate " type="application/atom+xml" title="4" href="/4.atom" />
    <link rel="foo alternate" type="application/atom+xml" title="5" href="/5.atom" />
    <link rel="alternate foo" type="application/atom+xml" title="6" href="/6.atom" />
    <link rel="foo alternate foo" type="application/atom+xml" title="7" href="/7.atom" />
    <link rel="meat feed cake" title="8" href="/8.atom" />

    <!-- rel is case-insensitive -->
    <link rel="ALTERNate" type="application/atom+xml" title="9" href="/9.atom" />
    <link rel="fEEd" title="10" href="/10.atom" />

    <!-- type can have leading and trailing whitespace -->
    <link rel="alternate" type="  application/atom+xml  " title="11" href="/11.atom" />

    <!-- type is case-insensitive -->
    <link rel="alternate" type="aPPliCAtion/ATom+xML" title="12" href="/12.atom" />

    <!-- "feed stylesheet" is a feed, though "alternate stylesheet" isn't -->
    <link rel="feed stylesheet" title="13" href="/13.atom" />

    <!-- hyphens or letters around rel not allowed -->
    <link rel="disabled-alternate" type="application/atom+xml" title="Bogus1" href="/Bogus1" />
    <link rel="alternates" type="application/atom+xml" title="Bogus2" href="/Bogus2" />
    <link rel=" alternate-like" type="application/atom+xml" title="Bogus3" href="/Bogus3" />

    <!-- don't tolerate text/xml if title includes 'rss' not as a word -->
    <link rel="alternate" type="text/xml" title="Bogus4 scissorsshaped" href="/Bogus4" />

    <!-- don't tolerate application/xml if title includes 'rss' not as a word -->
    <link rel="alternate" type="application/xml" title="Bogus5 scissorsshaped" href="/Bogus5" />

    <!-- don't tolerate application/rdf+xml if title includes 'rss' not as a word -->
    <link rel="alternate" type="application/rdf+xml" title="Bogus6 scissorsshaped" href="/Bogus6" />

    <!-- don't tolerate random types -->
    <link rel="alternate" type="text/plain" title="Bogus7 rss" href="/Bogus7" />

    <!-- don't find Atom by title -->
    <link rel="foopy" type="application/atom+xml" title="Bogus8 Atom and RSS" href="/Bogus8" />

    <!-- don't find application/rss+xml by title -->
    <link rel="goats" type="application/rss+xml" title="Bogus9 RSS and Atom" href="/Bogus9" />

    <!-- don't find application/rdf+xml by title -->
    <link rel="alternate" type="application/rdf+xml" title="Bogus10 RSS and Atom" href="/Bogus10" />

    <!-- don't find application/xml by title -->
    <link rel="alternate" type="application/xml" title="Bogus11 RSS and Atom" href="/Bogus11" />

    <!-- don't find text/xml by title -->
    <link rel="alternate" type="text/xml" title="Bogus12 RSS and Atom" href="/Bogus12" />

    <!-- alternate and stylesheet isn't a feed -->
    <link rel="alternate stylesheet" type="application/rss+xml" title="Bogus13 RSS" href="/Bogus13" />
  </head>
  <body>
    <script type="text/javascript">
      window.onload = function() {
        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");

        var tests = new Array();

        var currentWindow =
        window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                              .getInterface(Components.interfaces.nsIWebNavigation)
                              .QueryInterface(Components.interfaces.nsIDocShellTreeItem)
                              .rootTreeItem
                              .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                              .getInterface(Components.interfaces.nsIDOMWindow);
        var browser = currentWindow.gBrowser.selectedBrowser;

        var discovered = browser.feeds;
        tests.push({ check: discovered.length > 0,
                     message: "some feeds should be discovered" });

        var feeds = [];

        for each (var aFeed in discovered) {
          feeds[aFeed.href] = true;
        }

        for each (var aLink in document.getElementsByTagName("link")) {
          // ignore real stylesheets, and anything without an href property
          if (aLink.type != "text/css" && aLink.href) {
            if (/bogus/i.test(aLink.title)) {
              tests.push({ check: !feeds[aLink.href],
                           message: "don't discover " + aLink.href });
            } else {
              tests.push({ check: feeds[aLink.href],
                           message: "should discover " + aLink.href });
            }
          }
        }
        window.arguments[0].tests = tests;
        window.close();
      }
    </script>
  </body>
</html>