dom/browser-element/mochitest/file_browserElement_XFrameOptionsAllowFrom.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/browser-element/mochitest/file_browserElement_XFrameOptionsAllowFrom.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,43 @@
     1.4 +<html>
     1.5 +<body>
     1.6 +
     1.7 +  <!-- Try to load in a frame a cross-origin page which sends:
     1.8 +     "X-Frame-Options: Allow-From http://mochi.test:8888/",
     1.9 +       and a cross-origin page which sends
    1.10 +     "X-Frame-Options: Allow-From http://example.com/". -->
    1.11 +
    1.12 +<script>
    1.13 +
    1.14 +// Make sure these iframes aren't too tall; they both need to fit inside the
    1.15 +// iframe this page is contained in, without scrolling, in order for the test's
    1.16 +// screenshots to work properly.
    1.17 +
    1.18 +var frame_src = 'http://example.com/tests/dom/browser-element/mochitest/file_browserElement_XFrameOptionsAllowFrom.sjs';
    1.19 +
    1.20 +var iframe1 = document.createElement('iframe');
    1.21 +iframe1.height = '300px';
    1.22 +var iframe2 = document.createElement('iframe');
    1.23 +iframe2.height = '300px';
    1.24 +document.body.appendChild(iframe1);
    1.25 +document.body.appendChild(iframe2);
    1.26 +
    1.27 +iframe1.addEventListener('load', function iframe1Load() {
    1.28 +  iframe1.removeEventListener('load', iframe1Load);
    1.29 +  // This causes our embedder to take a screenshot (and blocks until the
    1.30 +  // screenshot is completed).
    1.31 +  var iframe2Loaded = false;
    1.32 +  iframe2.addEventListener('load', function iframe2Load() {
    1.33 +    iframe2.removeEventListener('load', iframe2Load);
    1.34 +    iframe2Loaded = true;
    1.35 +    alert('finish');
    1.36 +  });
    1.37 +
    1.38 +  setTimeout(function() { iframe2.src = frame_src; }, 1000);
    1.39 +});
    1.40 +
    1.41 +
    1.42 +iframe1.src = frame_src + '?iframe1';
    1.43 +</script>
    1.44 +
    1.45 +</body>
    1.46 +</html>

mercurial