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 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | let testPage = "data:text/plain,test bug 491431 Page"; |
michael@0 | 6 | |
michael@0 | 7 | function test() { |
michael@0 | 8 | waitForExplicitFinish(); |
michael@0 | 9 | |
michael@0 | 10 | let newWin, tabA, tabB; |
michael@0 | 11 | |
michael@0 | 12 | // test normal close |
michael@0 | 13 | tabA = gBrowser.addTab(testPage); |
michael@0 | 14 | gBrowser.tabContainer.addEventListener("TabClose", function(aEvent) { |
michael@0 | 15 | gBrowser.tabContainer.removeEventListener("TabClose", arguments.callee, true); |
michael@0 | 16 | ok(!aEvent.detail, "This was a normal tab close"); |
michael@0 | 17 | |
michael@0 | 18 | // test tab close by moving |
michael@0 | 19 | tabB = gBrowser.addTab(testPage); |
michael@0 | 20 | gBrowser.tabContainer.addEventListener("TabClose", function(aEvent) { |
michael@0 | 21 | gBrowser.tabContainer.removeEventListener("TabClose", arguments.callee, true); |
michael@0 | 22 | executeSoon(function() { |
michael@0 | 23 | ok(aEvent.detail, "This was a tab closed by moving"); |
michael@0 | 24 | |
michael@0 | 25 | // cleanup |
michael@0 | 26 | newWin.close(); |
michael@0 | 27 | executeSoon(finish); |
michael@0 | 28 | }); |
michael@0 | 29 | }, true); |
michael@0 | 30 | newWin = gBrowser.replaceTabWithWindow(tabB); |
michael@0 | 31 | }, true); |
michael@0 | 32 | gBrowser.removeTab(tabA); |
michael@0 | 33 | } |
michael@0 | 34 |