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 | const ICON_URL = "moz-anno:favicon:http://example.com/browser/browser/components/tabview/test/test_bug678374_icon16.png"; |
michael@0 | 5 | const TEST_URL = "http://example.com/browser/browser/components/tabview/test/test_bug678374.html"; |
michael@0 | 6 | |
michael@0 | 7 | function test() { |
michael@0 | 8 | Services.prefs.setBoolPref("browser.chrome.favicons", false); |
michael@0 | 9 | |
michael@0 | 10 | waitForExplicitFinish(); |
michael@0 | 11 | |
michael@0 | 12 | newWindowWithTabView(function(win) { |
michael@0 | 13 | is(win.gBrowser.tabs.length, 3, "There are 3 tabs") |
michael@0 | 14 | |
michael@0 | 15 | let newTabOne = win.gBrowser.tabs[1]; |
michael@0 | 16 | let newTabTwo = win.gBrowser.tabs[2]; |
michael@0 | 17 | let cw = win.TabView.getContentWindow(); |
michael@0 | 18 | let groupItem = cw.GroupItems.groupItems[0]; |
michael@0 | 19 | |
michael@0 | 20 | // test tab item |
michael@0 | 21 | let newTabItemOne = newTabOne._tabViewTabItem; |
michael@0 | 22 | |
michael@0 | 23 | newTabItemOne.addSubscriber("iconUpdated", function onIconUpdated() { |
michael@0 | 24 | newTabItemOne.removeSubscriber("iconUpdated", onIconUpdated); |
michael@0 | 25 | is(newTabItemOne.$favImage[0].src, ICON_URL, "The tab item is showing the right icon."); |
michael@0 | 26 | |
michael@0 | 27 | // test pin tab |
michael@0 | 28 | whenAppTabIconAdded(groupItem, function() { |
michael@0 | 29 | let icon = cw.iQ(".appTabIcon", groupItem.$appTabTray)[0]; |
michael@0 | 30 | is(icon.src, ICON_URL, "The app tab is showing the right icon"); |
michael@0 | 31 | |
michael@0 | 32 | finish(); |
michael@0 | 33 | }); |
michael@0 | 34 | win.gBrowser.pinTab(newTabTwo); |
michael@0 | 35 | }); |
michael@0 | 36 | }, function(win) { |
michael@0 | 37 | registerCleanupFunction(function() { |
michael@0 | 38 | Services.prefs.clearUserPref("browser.chrome.favicons"); |
michael@0 | 39 | win.close(); |
michael@0 | 40 | }); |
michael@0 | 41 | |
michael@0 | 42 | win.gBrowser.loadOneTab(TEST_URL); |
michael@0 | 43 | win.gBrowser.loadOneTab(TEST_URL); |
michael@0 | 44 | }); |
michael@0 | 45 | } |