зеркало из https://github.com/mozilla/pjs.git
Fix up recently-landed test for async and target changes to postMessage. r=orange
This commit is contained in:
Родитель
9a263e14dc
Коммит
d460f58bec
|
@ -17,9 +17,9 @@
|
|||
<script>
|
||||
onload = function() {
|
||||
nodes = document.getAnonymousNodes(document.getElementById('div1'));
|
||||
parent.postMessage(nodes ? nodes.length : 0);
|
||||
parent.postMessage(nodes ? nodes.length : 0, "http://localhost:8888");
|
||||
nodes = document.getAnonymousNodes(document.getElementById('div2'));
|
||||
parent.postMessage(nodes ? nodes.length : 0);
|
||||
parent.postMessage(nodes ? nodes.length : 0, "http://localhost:8888");
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<script>
|
||||
onload = function() {
|
||||
nodes = document.getAnonymousNodes(document.getElementById('d'));
|
||||
parent.postMessage(nodes ? nodes.length : 0);
|
||||
parent.postMessage(nodes ? nodes.length : 0, "http://localhost:8888");
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
|
|
@ -27,9 +27,14 @@ SimpleTest.waitForExplicitFinish();
|
|||
gen = runTest();
|
||||
var messages = 0;
|
||||
|
||||
document.addEventListener("message",
|
||||
function(e) { messages++; gen.send(e.data); },
|
||||
false);
|
||||
function receiveMessage(e)
|
||||
{
|
||||
is(e.origin, "http://localhost:8888", "wrong sender!");
|
||||
messages++;
|
||||
gen.send(e.data);
|
||||
}
|
||||
|
||||
window.addEventListener("message", receiveMessage, false);
|
||||
|
||||
const prefName = "layout.debug.enable_data_xbl";
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче