PageRenderTime 15ms CodeModel.GetById 10ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/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<!--
 4https://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
13<iframe id="testFrame"></iframe>
14
15<pre id="test">
16<script class="testbody" type="text/javascript">
17
18/** Test for Bug 403331 **/
19
20SimpleTest.waitForExplicitFinish();
21
22function runTest() {
23  var testFrame = document.getElementById('testFrame');
24
25  // Try a redirected load from another domain to this one.
26
27  testFrame.onload = function() {
28    // If properly redirected, we'll be able to access elements in the loaded
29    // document.
30    var item = testFrame.contentDocument.getElementById('testitem');
31    is(item.textContent, "testcontents", "Should be able to access the child document");
32
33    SimpleTest.finish();
34  }
35
36  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";
37}
38
39addLoadEvent(runTest);
40
41</script>
42</pre>
43
44</body>
45</html>