2012-01-20 09:02:48 -08:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=710231
|
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<title>Test for Bug 710231</title>
|
|
|
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
2012-06-10 16:44:50 -07:00
|
|
|
<script type="application/javascript" src="browserElementTestHelpers.js"></script>
|
2012-01-20 09:02:48 -08:00
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=710231">Mozilla Bug 710231</a>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
Test that an iframe with the |mozbrowser| attribute does not emit
|
2014-02-25 19:38:32 -08:00
|
|
|
mozbrowserX events when this page does not have the "browser" permission.
|
2012-01-20 09:02:48 -08:00
|
|
|
-->
|
|
|
|
|
|
|
|
<script type="application/javascript;version=1.7">
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
|
|
|
|
function runTest() {
|
2012-01-26 15:03:22 -08:00
|
|
|
var iframe = document.createElement('iframe');
|
2013-02-26 18:26:10 -08:00
|
|
|
SpecialPowers.wrap(iframe).mozbrowser = true;
|
2012-01-26 15:03:22 -08:00
|
|
|
document.body.appendChild(iframe);
|
|
|
|
|
2012-01-20 09:02:48 -08:00
|
|
|
iframe.addEventListener('mozbrowserloadstart', function() {
|
|
|
|
ok(false, 'Should not send mozbrowserloadstart event.');
|
|
|
|
});
|
|
|
|
|
2012-01-20 22:44:19 -08:00
|
|
|
iframe.addEventListener('load', function() {
|
|
|
|
ok(true, 'Got iframe load event.');
|
|
|
|
SimpleTest.finish();
|
|
|
|
});
|
2012-01-20 09:02:48 -08:00
|
|
|
|
2012-06-10 16:44:50 -07:00
|
|
|
iframe.src = browserElementTestHelpers.emptyPage1;
|
2012-01-20 09:02:48 -08:00
|
|
|
}
|
|
|
|
|
2014-02-25 19:38:32 -08:00
|
|
|
browserElementTestHelpers.setEnabledPref(true);
|
|
|
|
SpecialPowers.removePermission("browser", document);
|
2014-02-19 18:25:14 -08:00
|
|
|
addEventListener('testready', runTest);
|
2012-01-20 09:02:48 -08:00
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|