dom/browser-element/mochitest/file_browserElement_XFrameOptionsAllowFrom.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 <html>
michael@0 2 <body>
michael@0 3
michael@0 4 <!-- Try to load in a frame a cross-origin page which sends:
michael@0 5 "X-Frame-Options: Allow-From http://mochi.test:8888/",
michael@0 6 and a cross-origin page which sends
michael@0 7 "X-Frame-Options: Allow-From http://example.com/". -->
michael@0 8
michael@0 9 <script>
michael@0 10
michael@0 11 // Make sure these iframes aren't too tall; they both need to fit inside the
michael@0 12 // iframe this page is contained in, without scrolling, in order for the test's
michael@0 13 // screenshots to work properly.
michael@0 14
michael@0 15 var frame_src = 'http://example.com/tests/dom/browser-element/mochitest/file_browserElement_XFrameOptionsAllowFrom.sjs';
michael@0 16
michael@0 17 var iframe1 = document.createElement('iframe');
michael@0 18 iframe1.height = '300px';
michael@0 19 var iframe2 = document.createElement('iframe');
michael@0 20 iframe2.height = '300px';
michael@0 21 document.body.appendChild(iframe1);
michael@0 22 document.body.appendChild(iframe2);
michael@0 23
michael@0 24 iframe1.addEventListener('load', function iframe1Load() {
michael@0 25 iframe1.removeEventListener('load', iframe1Load);
michael@0 26 // This causes our embedder to take a screenshot (and blocks until the
michael@0 27 // screenshot is completed).
michael@0 28 var iframe2Loaded = false;
michael@0 29 iframe2.addEventListener('load', function iframe2Load() {
michael@0 30 iframe2.removeEventListener('load', iframe2Load);
michael@0 31 iframe2Loaded = true;
michael@0 32 alert('finish');
michael@0 33 });
michael@0 34
michael@0 35 setTimeout(function() { iframe2.src = frame_src; }, 1000);
michael@0 36 });
michael@0 37
michael@0 38
michael@0 39 iframe1.src = frame_src + '?iframe1';
michael@0 40 </script>
michael@0 41
michael@0 42 </body>
michael@0 43 </html>

mercurial