Bug 628061 - Panorama button should reflect the number of groups before Panorama has launched r=ian

This commit is contained in:
Raymond Lee 2011-06-07 11:52:30 +08:00
Родитель 8921c7f13e
Коммит 80ef8fb687
3 изменённых файлов: 19 добавлений и 3 удалений

Просмотреть файл

@ -191,7 +191,7 @@
<broadcaster id="isFrameImage"/>
<broadcaster id="singleFeedMenuitemState" disabled="true"/>
<broadcaster id="multipleFeedsMenuState" hidden="true"/>
<broadcaster id="tabviewGroupsNumber" groups="0"/>
<broadcaster id="tabviewGroupsNumber" groups="1"/>
#ifdef MOZ_SERVICES_SYNC
<broadcaster id="sync-setup-state"/>
<broadcaster id="sync-syncnow-state"/>

Просмотреть файл

@ -105,7 +105,7 @@ let TabView = {
data = sessionstore.getWindowValue(window, this.GROUPS_IDENTIFIER);
if (data) {
let parsedData = JSON.parse(data);
this.updateGroupNumberBroadcaster(parsedData.totalNumber || 0);
this.updateGroupNumberBroadcaster(parsedData.totalNumber || 1);
}
} catch (e) { }

Просмотреть файл

@ -26,11 +26,27 @@ let state = {
function test() {
waitForExplicitFinish();
testOne();
}
function testOne() {
newWindowWithTabView(
function(win) {
testTwo();
win.close();
},
function(win) {
registerCleanupFunction(function() win.close());
is(win.document.getElementById("tabviewGroupsNumber").getAttribute("groups"),
"1", "There is one group");
});
}
function testTwo() {
newWindowWithState(state, function(win) {
registerCleanupFunction(function() win.close());
is(win.document.getElementById("tabviewGroupsNumber").getAttribute("groups"),
is(win.document.getElementById("tabviewGroupsNumber").getAttribute("groups"),
"2", "There are two groups");
waitForFocus(finish);
});