|
1 /* Any copyright is dedicated to the public domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 // Bug 764718 - Test that clicking a link with _target=blank works. |
|
5 |
|
6 "use strict"; |
|
7 |
|
8 SimpleTest.waitForExplicitFinish(); |
|
9 browserElementTestHelpers.setEnabledPref(true); |
|
10 browserElementTestHelpers.addPermission(); |
|
11 |
|
12 function runTest() { |
|
13 var iframe = document.createElement('iframe'); |
|
14 SpecialPowers.wrap(iframe).mozbrowser = true; |
|
15 |
|
16 iframe.addEventListener('mozbrowseropenwindow', function(e) { |
|
17 is(e.detail.url, 'http://example.com/'); |
|
18 e.preventDefault(); |
|
19 SimpleTest.finish(); |
|
20 }); |
|
21 |
|
22 iframe.src = "file_browserElement_TargetBlank.html"; |
|
23 document.body.appendChild(iframe); |
|
24 } |
|
25 |
|
26 addEventListener('testready', runTest); |