tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_docload_embedded.html (2473B)


      1 <html>
      2 
      3 <head>
      4  <title>Accessible events testing for document</title>
      5 
      6  <link rel="stylesheet" type="text/css"
      7        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
      8 
      9  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
     10 
     11  <script type="application/javascript"
     12          src="../../common.js"></script>
     13  <script type="application/javascript"
     14          src="../../role.js"></script>
     15  <script type="application/javascript"
     16          src="../../events.js"></script>
     17 
     18  <script type="application/javascript">
     19    // //////////////////////////////////////////////////////////////////////////
     20    // Invokers
     21 
     22    function changeIframeSrc(aIdentifier, aURL, aTitle) {
     23      this.DOMNode = getNode(aIdentifier);
     24 
     25      function getIframeDoc() {
     26        return getAccessible(getNode(aIdentifier).contentDocument);
     27      }
     28 
     29      this.eventSeq = [
     30        new invokerChecker(EVENT_REORDER, getAccessible(this.DOMNode)),
     31        new asyncInvokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, getIframeDoc),
     32      ];
     33 
     34      this.invoke = () => (this.DOMNode.src = aURL);
     35 
     36      this.finalCheck = () =>
     37        testAccessibleTree(this.DOMNode, {
     38          role: ROLE_INTERNAL_FRAME,
     39          children: [
     40            {
     41              role: ROLE_DOCUMENT,
     42              name: aTitle,
     43            },
     44          ],
     45        });
     46 
     47      this.getID = () => `change iframe src on ${aURL}`;
     48    }
     49 
     50    // //////////////////////////////////////////////////////////////////////////
     51    // Do tests
     52 
     53    function doTests() {
     54      const gQueue = new eventQueue();
     55      gQueue.push(new changeIframeSrc("iframe", "about:license", "Licenses"));
     56      gQueue.push(new changeIframeSrc("iframe", "about:buildconfig", "Build Configuration"));
     57      gQueue.invoke(); // Will call SimpleTest.finish();
     58    }
     59 
     60    SimpleTest.waitForExplicitFinish();
     61    addA11yLoadEvent(doTests);
     62  </script>
     63 </head>
     64 
     65 <body>
     66 
     67  <a target="_blank"
     68     href="https://bugzilla.mozilla.org/show_bug.cgi?id=420845"
     69     title="Fire event_reorder on any embedded frames/iframes whos document has just loaded">
     70    Mozilla Bug 420845
     71  </a>
     72  <a target="_blank"
     73     href="https://bugzilla.mozilla.org/show_bug.cgi?id=754165"
     74     title="Fire document load events on iframes too">
     75    Mozilla Bug 754165
     76  </a>
     77 
     78  <p id="display"></p>
     79  <div id="content" style="display: none"></div>
     80  <pre id="test">
     81  </pre>
     82 
     83  <div id="testContainer"><iframe id="iframe"></iframe></div>
     84 </body>
     85 </html>