diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/tests/mochitest/sessionstorage/test_sessionStorageHttpHttps.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/tests/mochitest/sessionstorage/test_sessionStorageHttpHttps.html')
-rw-r--r-- | dom/tests/mochitest/sessionstorage/test_sessionStorageHttpHttps.html | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/dom/tests/mochitest/sessionstorage/test_sessionStorageHttpHttps.html b/dom/tests/mochitest/sessionstorage/test_sessionStorageHttpHttps.html new file mode 100644 index 000000000..e145ee16b --- /dev/null +++ b/dom/tests/mochitest/sessionstorage/test_sessionStorageHttpHttps.html @@ -0,0 +1,59 @@ +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>sessionStorage replace test</title> + +<!-- + This test checks that sessionStorage values set in an https page + are not readable from a non-https page from the same domain. +--> + +<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> +<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> + +<script type="text/javascript"> + +window.addEventListener("message", onMessageReceived, false); + +var messages = []; + +function onMessageReceived(event) +{ + if (event.data == "the end") { + is(messages.length, 4, "Wrong number of messages."); + is(messages[0], "insecure", "Wrong message from insecure page"); + is(messages[1], "secure", "Wrong message from secure page"); + is(messages[2], "insecure", "Wrong second message from insecure page"); + is(messages[3], null, "Insecure page got secure message?"); + + SimpleTest.finish(); + + return; + } + + messages.push(event.data); + + if (event.data == "insecure" && messages.length == 1) { + window.httpsframe.location = "https://test1.example.com/tests/dom/tests/mochitest/sessionstorage/file_https.html"; + } + + if (event.data == "secure") { + window.httpframe.postMessage("check", "http://test1.example.com"); + } +} + +function startTest() +{ + window.httpframe.location = "http://test1.example.com/tests/dom/tests/mochitest/sessionstorage/file_http.html"; +} + +SimpleTest.waitForExplicitFinish(); + +</script> + +</head> + +<body onload="startTest();"> + <iframe src="" name="httpframe"></iframe> + <iframe src="" name="httpsframe"></iframe> +</body> +</html> |