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