2012-07-10 00:42:18 +04:00
|
|
|
/* Any copyright is dedicated to the public domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
|
|
|
|
// Bug 770239 - Test that we can load pages with X-Frame-Options: Deny inside
|
|
|
|
// <iframe mozbrowser>.
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
2013-03-28 23:51:10 +04:00
|
|
|
browserElementTestHelpers.setEnabledPref(true);
|
|
|
|
browserElementTestHelpers.addPermission();
|
2012-07-10 00:42:18 +04:00
|
|
|
|
|
|
|
function runTest() {
|
|
|
|
var iframe = document.createElement('iframe');
|
2014-10-31 05:39:15 +03:00
|
|
|
iframe.setAttribute('mozbrowser', 'true');
|
2012-07-10 00:42:18 +04:00
|
|
|
|
|
|
|
// The page we load will fire an alert when it successfully loads.
|
|
|
|
iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
|
|
|
|
ok(true, "Got alert");
|
|
|
|
SimpleTest.finish();
|
|
|
|
});
|
|
|
|
|
|
|
|
document.body.appendChild(iframe);
|
|
|
|
iframe.src = 'file_browserElement_XFrameOptions.sjs?DENY';
|
|
|
|
}
|
|
|
|
|
2013-03-28 23:51:10 +04:00
|
|
|
addEventListener('testready', runTest);
|