dom/tests/mochitest/beacon/beacon-frame.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/tests/mochitest/beacon/beacon-frame.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,24 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title>Inner frame performing a basic sendBeacon from within an iframe</title>
     1.8 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     1.9 +</head>
    1.10 +<body>
    1.11 +<script type="text/javascript">
    1.12 +
    1.13 +function sendBeacon()
    1.14 +{
    1.15 +    var frame = window.parent.document.getElementById("frame");
    1.16 +    var data = window.parent.beaconConvert(frame.getAttribute("data"));
    1.17 +
    1.18 +    var result = navigator.sendBeacon("http://mochi.test:8888/tests/dom/tests/mochitest/beacon/beacon-handler.sjs", data);
    1.19 +    window.parent.beaconSent(result);
    1.20 +}
    1.21 +
    1.22 +window.addEventListener("load", function() { setTimeout(sendBeacon, 0); }, false);
    1.23 +
    1.24 +</script>
    1.25 +</body>
    1.26 +</html>
    1.27 +

mercurial