summaryrefslogtreecommitdiffstats
path: root/comm/suite/browser/test/mochitest/test_feed_discovery.html
blob: 2f2a0a459e18bc1ca0ebb0b7eb9dcf684e74146f (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
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=240393
-->
<head>
  <title>Test for feed discovery</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=377611">Mozilla Bug 377611</a>
<p id="display"></p>
<div id="content" style="display: none">
  
</div>
<pre id="test">
<script class="testbody">

/** Tests for bug 240393 (from bug 377611 on Firefox side) **/

var rv = { tests: null };
var testCheckInterval = null;

function startTest() {
  var url = window.location.href.replace(/test_feed_discovery\.html/,
                                         'feed_discovery.html');
  SpecialPowers.openDialog(window, [url, '', 'dialog=no,width=10,height=10', rv]);
  testCheckInterval = window.setInterval(tryIfTestIsFinished, 500);
}

function tryIfTestIsFinished() {
  if (rv.tests) {
    window.clearInterval(testCheckInterval);
    checkTest();
  }
}

function checkTest() {
  for (var i = 0; i < rv.tests.length; ++ i) {
    var test = rv.tests[i];
    if (test.todo)
      todo(test.check, test.message);
    else
      ok(test.check, test.message);
  }
  SimpleTest.finish();
}

window.onload = startTest;

SimpleTest.waitForExplicitFinish();
</script>
</pre>
</body>
</html>