|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=710231 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 710231</title> |
|
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
9 <script type="application/javascript" src="browserElementTestHelpers.js"></script> |
|
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
11 </head> |
|
12 <body> |
|
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=710231">Mozilla Bug 710231</a> |
|
14 |
|
15 <!-- |
|
16 Test that an iframe with the |mozbrowser| attribute does not emit |
|
17 mozbrowserX events when they're globally pref'ed off. |
|
18 --> |
|
19 |
|
20 <script type="application/javascript;version=1.7"> |
|
21 "use strict"; |
|
22 |
|
23 SimpleTest.waitForExplicitFinish(); |
|
24 |
|
25 function runTest() { |
|
26 |
|
27 var iframe = document.createElement('iframe'); |
|
28 SpecialPowers.wrap(iframe).mozbrowser = true; |
|
29 document.body.appendChild(iframe); |
|
30 |
|
31 iframe.addEventListener('mozbrowserloadstart', function() { |
|
32 ok(false, 'Should not send mozbrowserloadstart event.'); |
|
33 }); |
|
34 |
|
35 iframe.addEventListener('load', function() { |
|
36 ok(true, 'Got iframe load event.'); |
|
37 SimpleTest.finish(); |
|
38 }); |
|
39 |
|
40 iframe.src = browserElementTestHelpers.emptyPage1; |
|
41 } |
|
42 |
|
43 browserElementTestHelpers.setEnabledPref(false); |
|
44 addEventListener('testready', runTest); |
|
45 |
|
46 </script> |
|
47 |
|
48 </body> |
|
49 </html> |