Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* Any copyright is dedicated to the public domain. |
michael@0 | 2 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | // Bug 771273 - Check that window.open(url, '_top') works properly with <iframe |
michael@0 | 5 | // mozbrowser>. |
michael@0 | 6 | "use strict"; |
michael@0 | 7 | |
michael@0 | 8 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 9 | browserElementTestHelpers.setEnabledPref(true); |
michael@0 | 10 | browserElementTestHelpers.addPermission(); |
michael@0 | 11 | |
michael@0 | 12 | function runTest() { |
michael@0 | 13 | var iframe = document.createElement('iframe'); |
michael@0 | 14 | SpecialPowers.wrap(iframe).mozbrowser = true; |
michael@0 | 15 | |
michael@0 | 16 | iframe.addEventListener('mozbrowseropenwindow', function(e) { |
michael@0 | 17 | ok(false, 'Not expecting an openwindow event.'); |
michael@0 | 18 | }); |
michael@0 | 19 | |
michael@0 | 20 | iframe.addEventListener('mozbrowserlocationchange', function(e) { |
michael@0 | 21 | if (/file_browserElement_TargetTop.html\?2$/.test(e.detail)) { |
michael@0 | 22 | ok(true, 'Got the locationchange we were looking for.'); |
michael@0 | 23 | SimpleTest.finish(); |
michael@0 | 24 | } |
michael@0 | 25 | }); |
michael@0 | 26 | |
michael@0 | 27 | document.body.appendChild(iframe); |
michael@0 | 28 | iframe.src = 'file_browserElement_TargetTop.html'; |
michael@0 | 29 | } |
michael@0 | 30 | |
michael@0 | 31 | addEventListener('testready', runTest); |