/modules/libjar/test/mochitest/test_bug403331.html

http://github.com/zpao/v8monkey · HTML · 45 lines · 30 code · 12 blank · 3 comment · 0 complexity · 9219c0c718088c8c0e60acb332bf3336 MD5 · raw file

  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=403331
  5. -->
  6. <head>
  7. <title>Test for Bug 403331</title>
  8. <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  9. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
  10. </head>
  11. <body>
  12. <iframe id="testFrame"></iframe>
  13. <pre id="test">
  14. <script class="testbody" type="text/javascript">
  15. /** Test for Bug 403331 **/
  16. SimpleTest.waitForExplicitFinish();
  17. function runTest() {
  18. var testFrame = document.getElementById('testFrame');
  19. // Try a redirected load from another domain to this one.
  20. testFrame.onload = function() {
  21. // If properly redirected, we'll be able to access elements in the loaded
  22. // document.
  23. var item = testFrame.contentDocument.getElementById('testitem');
  24. is(item.textContent, "testcontents", "Should be able to access the child document");
  25. SimpleTest.finish();
  26. }
  27. testFrame.src = "jar:http://example.org:80/tests/modules/libjar/test/mochitest/openredirect.sjs?http://mochi.test:8888/tests/modules/libjar/test/mochitest/bug403331.zip!/test.html";
  28. }
  29. addLoadEvent(runTest);
  30. </script>
  31. </pre>
  32. </body>
  33. </html>