tor-browser

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

file_bug1018265.xhtml (1678B)


      1 <?xml version="1.0"?>
      2 <?xml-stylesheet type="text/css" href="chrome://global/skin"?>
      3 <?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
      4 <!--
      5 https://bugzilla.mozilla.org/show_bug.cgi?id=1018265
      6 -->
      7 <window title="Mozilla Bug 1018265"
      8        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
      9        onload="setTimeout(run, 0);">
     10 
     11  <!-- test code goes here -->
     12  <script type="application/javascript">
     13  <![CDATA[
     14 
     15  /** Test for Bug 1018265 */
     16 
     17  var testcontent = null;
     18 
     19  function run() {
     20    testcontent = document.getElementById("testcontent");
     21    shouldHaveTwoNonHiddenDocumentViewers();
     22    testcontent.setAttribute("src", "foobarpage");
     23    setTimeout(errorPageLoaded, 2500)
     24  }
     25 
     26  function errorPageLoaded() {
     27    testcontent.addEventListener("pageshow", didGoBack, true);
     28    setTimeout(function() {testcontent.contentWindow.history.back();}, 0);
     29  }
     30 
     31  function didGoBack(e) {
     32    testcontent.removeEventListener("pageshow", didGoBack, true);
     33    shouldHaveTwoNonHiddenDocumentViewers();
     34    window.arguments[0].done();
     35    window.close();
     36  }
     37 
     38  function getDocumentViewer(win) {
     39    return win.docShell.docViewer;
     40  }
     41 
     42  function shouldHaveTwoNonHiddenDocumentViewers() {
     43    window.arguments[0].is(getDocumentViewer(testcontent.contentWindow).isHidden, false, "Top level DocumentViewer should not be hidden.");
     44    window.arguments[0].is(getDocumentViewer(testcontent.contentWindow.frames[0]).isHidden, false, " Iframe's DocumentViewer should not be hidden.");
     45  }
     46  ]]>
     47  </script>
     48 
     49  <browser type="content" id="testcontent" flex="1" src="data:text/html,&lt;iframe&gt;&lt;/iframe&gt;"/>
     50 </window>