1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/browser-element/mochitest/browserElement_XFrameOptionsSameOrigin.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,28 @@ 1.4 +/* Any copyright is dedicated to the public domain. 1.5 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +// Bug 770239 - Load an X-Frame-Options: SAMEORIGIN page inside an <iframe> 1.8 +// inside <iframe mozbrowser>. The two iframes will have the same origin, but 1.9 +// this page will be of a different origin. The load should succeed. 1.10 + 1.11 +"use strict"; 1.12 + 1.13 +SimpleTest.waitForExplicitFinish(); 1.14 +browserElementTestHelpers.setEnabledPref(true); 1.15 +browserElementTestHelpers.addPermission(); 1.16 + 1.17 +function runTest() { 1.18 + var iframe = document.createElement('iframe'); 1.19 + SpecialPowers.wrap(iframe).mozbrowser = true; 1.20 + 1.21 + // The innermost page we load will fire an alert when it successfully loads. 1.22 + iframe.addEventListener('mozbrowsershowmodalprompt', function(e) { 1.23 + ok(true, "Got alert"); 1.24 + SimpleTest.finish(); 1.25 + }); 1.26 + 1.27 + document.body.appendChild(iframe); 1.28 + iframe.src = 'http://example.com/tests/dom/browser-element/mochitest/file_browserElement_XFrameOptionsSameOrigin.html'; 1.29 +} 1.30 + 1.31 +addEventListener('testready', runTest);