1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/browser-element/mochitest/browserElement_TargetBlank.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,26 @@ 1.4 +/* Any copyright is dedicated to the public domain. 1.5 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +// Bug 764718 - Test that clicking a link with _target=blank works. 1.8 + 1.9 +"use strict"; 1.10 + 1.11 +SimpleTest.waitForExplicitFinish(); 1.12 +browserElementTestHelpers.setEnabledPref(true); 1.13 +browserElementTestHelpers.addPermission(); 1.14 + 1.15 +function runTest() { 1.16 + var iframe = document.createElement('iframe'); 1.17 + SpecialPowers.wrap(iframe).mozbrowser = true; 1.18 + 1.19 + iframe.addEventListener('mozbrowseropenwindow', function(e) { 1.20 + is(e.detail.url, 'http://example.com/'); 1.21 + e.preventDefault(); 1.22 + SimpleTest.finish(); 1.23 + }); 1.24 + 1.25 + iframe.src = "file_browserElement_TargetBlank.html"; 1.26 + document.body.appendChild(iframe); 1.27 +} 1.28 + 1.29 +addEventListener('testready', runTest);