Bug 1261715 - Avoid promise rejections in browser_rules_add-rule_05.js; r=jryans

This test simulates a context click in the rule view and selects the
"add rule" item in order to add a new rule.
Adding a rule triggers a ruleview-changed event, and so this test should
start listening for this event before triggering the action, which it
did not do.

MozReview-Commit-ID: BPO8Fgwsq5M

--HG--
extra : rebase_source : e975e57148850c41cfae4d9748809d1f6672aa84
This commit is contained in:
Patrick Brosset 2016-04-07 11:35:48 +02:00
Родитель e710d0b812
Коммит 01d7e9bf57
1 изменённых файлов: 3 добавлений и 4 удалений

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

@ -59,12 +59,11 @@ function* addNewRuleFromContextMenu(inspector, view) {
ok(!view._contextmenu.menuitemAddRule.hidden, "Add rule is visible");
info("Adding the new rule");
info("Adding the new rule and expecting a ruleview-changed event");
let onRuleViewChanged = view.once("ruleview-changed");
view._contextmenu.menuitemAddRule.click();
view._contextmenu._menupopup.hidePopup();
info("Waiting for rule view to change");
yield view.once("ruleview-changed");
yield onRuleViewChanged;
}
function* testNewRule(view, expected, index) {