Backed out changeset 0ac161595496 (bug 1276738)

--HG--
extra : rebase_source : d08ff4ed252c847b83ecba484a235cb2504fe9db
This commit is contained in:
Carsten "Tomcat" Book 2016-06-02 08:12:32 +02:00
Родитель 1273c5e897
Коммит c9f7f417f6
3 изменённых файлов: 0 добавлений и 61 удалений

Просмотреть файл

@ -1,13 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
This page is opened in a new window by test_storage_copied.html.
We need to return the sessionStorage value for the item "test-item",
by way of postMessage.
-->
<head>
<body>Opened!</body>
<script>
window.postMessage(window.sessionStorage.getItem("test-item"), "*");
</script>
</html>

Просмотреть файл

@ -3,6 +3,3 @@ tags = openwindow
[test_blank_named_window.html]
[test_named_window.html]
[test_storage_copied.html]
support-files =
file_storage_copied.html

Просмотреть файл

@ -1,45 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
Test sessionStorage is copied over when a new window opens to the
same domain as the opener.
-->
<head>
<meta charset="utf-8">
<title>Test storage copied</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
<script src="head.js" type="application/javascript;version=1.8"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<script type="application/javascript">
"use strict";
function waitForMessage(win) {
return new Promise(resolve => {
win.addEventListener("message", function onMessage(event) {
win.removeEventListener("message", onMessage);
resolve(event.data);
});
});
}
add_task(function*() {
const TEST_VALUE = "test-value";
// This magic value of 2 means that by default, when content tries
// to open a new window, it'll actually open in a new window instead
// of a new tab.
yield SpecialPowers.pushPrefEnv({"set": [
["browser.link.open_newwindow", 2],
]});
window.sessionStorage.setItem("test-item", TEST_VALUE);
let win = window.open("file_storage_copied.html", "my_window");
let data = yield waitForMessage(win);
is(data, TEST_VALUE, "Should have cloned the test value");
win.close();
});
</script>
</body>
</html>