Bug 1283705 - wait for popuphidden to fix intermittent test browser_tableWidget_mouse_interaction;r=miker

MozReview-Commit-ID: GFyH7f1bXpR

--HG--
extra : rebase_source : f5712a5b12a298b0d026d1b4a6ce42087c1d43bb
This commit is contained in:
Julian Descottes 2016-07-15 11:23:14 +02:00
Родитель 81175bdafe
Коммит ba686b64ad
1 изменённых файлов: 8 добавлений и 0 удалений

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

@ -202,6 +202,7 @@ var testMouseInteraction = Task.async(function* () {
"Which is the unique column");
// popup should be open now
// clicking on second column label
let onPopupHidden = once(table.menupopup, "popuphidden");
event = table.once(TableWidget.EVENTS.HEADER_CONTEXT_MENU);
node = table.menupopup.querySelector("[data-id='col2']");
info("selecting to hide the second column");
@ -209,6 +210,7 @@ var testMouseInteraction = Task.async(function* () {
"Column is not hidden before hiding it");
click(node);
id = yield event;
yield onPopupHidden;
is(id, "col2", "Correct column was triggered to be hidden");
is(table.tbody.children[2].getAttribute("hidden"), "true",
"Column is hidden after hiding it");
@ -225,6 +227,7 @@ var testMouseInteraction = Task.async(function* () {
"Only 1 menuitem is disabled");
// popup should be open now
// clicking on second column label
onPopupHidden = once(table.menupopup, "popuphidden");
event = table.once(TableWidget.EVENTS.HEADER_CONTEXT_MENU);
node = table.menupopup.querySelector("[data-id='col3']");
info("selecting to hide the second column");
@ -232,6 +235,7 @@ var testMouseInteraction = Task.async(function* () {
"Column is not hidden before hiding it");
click(node);
id = yield event;
yield onPopupHidden;
is(id, "col3", "Correct column was triggered to be hidden");
is(table.tbody.children[4].getAttribute("hidden"), "true",
"Column is hidden after hiding it");
@ -256,6 +260,7 @@ var testMouseInteraction = Task.async(function* () {
// showing back 2nd column
// popup should be open now
// clicking on second column label
onPopupHidden = once(table.menupopup, "popuphidden");
event = table.once(TableWidget.EVENTS.HEADER_CONTEXT_MENU);
node = table.menupopup.querySelector("[data-id='col2']");
info("selecting to hide the second column");
@ -263,6 +268,7 @@ var testMouseInteraction = Task.async(function* () {
"Column is hidden before unhiding it");
click(node);
id = yield event;
yield onPopupHidden;
is(id, "col2", "Correct column was triggered to be hidden");
ok(!table.tbody.children[2].hasAttribute("hidden"),
"Column is not hidden after unhiding it");
@ -277,6 +283,7 @@ var testMouseInteraction = Task.async(function* () {
// popup should be open now
// clicking on second column label
onPopupHidden = once(table.menupopup, "popuphidden");
event = table.once(TableWidget.EVENTS.HEADER_CONTEXT_MENU);
node = table.menupopup.querySelector("[data-id='col3']");
info("selecting to hide the second column");
@ -284,6 +291,7 @@ var testMouseInteraction = Task.async(function* () {
"Column is hidden before unhiding it");
click(node);
id = yield event;
yield onPopupHidden;
is(id, "col3", "Correct column was triggered to be hidden");
ok(!table.tbody.children[4].hasAttribute("hidden"),
"Column is not hidden after unhiding it");