PageRenderTime 21ms CodeModel.GetById 10ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecureXHR.html

http://github.com/zpao/v8monkey
HTML | 49 lines | 42 code | 7 blank | 0 comment | 0 complexity | e059cdd30801dd6a39909f3deae9c7f5 MD5 | raw file
 1<!DOCTYPE HTML>
 2<html>
 3<head>
 4  <title>unsecure XHR test</title>
 5  <script type="text/javascript" src="/MochiKit/Base.js"></script>
 6  <script type="text/javascript" src="/MochiKit/DOM.js"></script>
 7  <script type="text/javascript" src="/MochiKit/Style.js"></script>
 8  <script type="text/javascript" src="/MochiKit/Signal.js"></script>
 9  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
10  <script type="text/javascript" src="mixedContentTest.js"></script>
11  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
12
13  <script class="testbody" type="text/javascript">
14
15  function runTest()
16  {
17    isSecurityState("secure");
18    window.setTimeout(function()
19    {
20      try
21      {
22        var req = new XMLHttpRequest();
23        req.open("GET", "http://example.com/tests/security/ssl/mixedcontent/alloworigin.sjs", false);
24        req.send(null);
25
26        // Change should be immediate, the request was sent synchronously
27        todoSecurityState("broken", "security broken after insecure XHR");
28      }
29      catch (ex)
30      {
31        ok(false, ex);
32      }
33
34      finish();
35    }, 0);
36  }
37
38  function afterNavigationTest()
39  {
40    isSecurityState("secure", "security full after navigation");
41    finish();
42  }
43
44  </script>
45</head>
46
47<body>
48</body>
49</html>