Bug 969443 - Update CustomizableUI tests to yield on CustomizeMode.reset; r=Gijs

MozReview-Commit-ID: 93fLK4thrgH

--HG--
extra : rebase_source : 8db50229beb2e099f1e47169a53d4e7107dbef0f
This commit is contained in:
gasolin 2016-03-29 15:55:58 +08:00
Родитель 481a70b111
Коммит 569b24a16f
4 изменённых файлов: 8 добавлений и 13 удалений

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

@ -8,8 +8,7 @@ add_task(function* () {
ok(historyButton && devButton, "Draggable elements should exist");
simulateItemDrag(historyButton, devButton);
gCustomizeMode.reset();
yield waitForCondition(() => !gCustomizeMode.resetting);
yield gCustomizeMode.reset();
ok(CustomizableUI.inDefaultState, "Should be back in default state");
historyButton = document.getElementById("wrapper-history-panelmenu");

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

@ -14,8 +14,7 @@ add_task(function*() {
ok(devButton && downloadsButton && searchBox && palette, "Stuff should exist");
simulateItemDrag(devButton, downloadsButton);
simulateItemDrag(searchBox, palette);
gCustomizeMode.reset();
yield waitForCondition(() => !gCustomizeMode.resetting);
yield gCustomizeMode.reset();
ok(CustomizableUI.inDefaultState, "Should be back in default state");
yield endCustomizing();
});

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

@ -37,8 +37,7 @@ add_task(function*() {
is(CustomizableUI.inDefaultState, false, "Should no longer be in default state");
yield startCustomizing();
gCustomizeMode.reset();
yield waitForCondition(() => !gCustomizeMode.resetting);
yield gCustomizeMode.reset();
yield endCustomizing();
is(bookmarksToolbar.collapsed, true, "Customization reset should restore collapsed-state to the bookmarks toolbar");
@ -61,8 +60,7 @@ add_task(function*() {
isnot(menubar.getBoundingClientRect().height, 0, "menubar should be visible now");
yield startCustomizing();
gCustomizeMode.reset();
yield waitForCondition(() => !gCustomizeMode.resetting);
yield gCustomizeMode.reset();
is(menubar.getAttribute("autohide"), "true", "The menubar should have autohide=true after reset in customization mode");
is(menubar.getBoundingClientRect().height, 0, "The menubar should have height=0 after reset in customization mode");
@ -89,8 +87,7 @@ add_task(function*() {
ok(!navbar.collapsed, "The navbar should be visible before reset");
ok(!tabsToolbar.collapsed, "TabsToolbar should not be collapsed");
gCustomizeMode.reset();
yield waitForCondition(() => !gCustomizeMode.resetting);
yield gCustomizeMode.reset();
ok(bookmarksToolbar.collapsed, "The bookmarksToolbar should be collapsed after reset");
ok(!tabsToolbar.collapsed, "TabsToolbar should not be collapsed");

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

@ -21,9 +21,9 @@ add_task(function*() {
ok(CustomizableUI.inDefaultState, "In default state after reset");
is(undoResetButton.hidden, false, "The undo button is visible after reset");
undoResetButton.click();
yield waitForCondition(() => !gCustomizeMode.resetting);
ok(!CustomizableUI.inDefaultState, "Not in default state after reset-undo");
yield gCustomizeMode.undoReset()
ok(!CustomizableUI.inDefaultState, "Not in default state after undo-reset");
is(undoResetButton.hidden, true, "The undo button is hidden after clicking on the undo button");
is(CustomizableUI.getPlacementOfWidget(homeButtonId), null, "Home button is in palette");