summaryrefslogtreecommitdiffstats
path: root/dom/html/test/test_frame_count_with_synthetic_doc.html
blob: c282ed09d73d288143e12f0205f0235be1cf442b (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
<!DOCTYPE html>
<html>
  <head>
    <script src="/tests/SimpleTest/SimpleTest.js"></script>
    <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
  </head>
  <body>
  <script>
    SimpleTest.waitForExplicitFinish();
    function getWindowLength() {
      setTimeout(function() {
        if (window.length) {
          ok(false, "Synthetic document shouldn't be exposed");
        }

        // Keep running this check until the test stops
        getWindowLength();
      });
    }

    function addObject() {
      const object = document.createElement("object");
      object.data = 'file_bug417760.png';
      document.body.appendChild(object);

      object.onload = function() {
        ok(true, "Test passes");
        SimpleTest.finish();
      }
    }

    getWindowLength();
    addObject();
  </script>
  </body>
</html>