Bug 1239208 - Fix intermittent browser_rules_edit-property-computed.js by waiting for the correct ruleview-changed event. r=pbro

The preview also causes a ruleview-changed event to be emitted. If the frame
script happened to detect the change fast enough, the test would continue to
commit the value and start to wait for a ruleview-changed event. If the event
triggered by the preview had not been emitted, the test would continue
immediately once the event triggered by the preview was received but before
the value was actually committed and reflected in the computed rule list.

The fix is to wait for the ruleview-changed triggered by the preview before
committing the change to avoid mixing these two events.
This commit is contained in:
Sami Jaktholm 2016-01-30 15:19:59 +02:00
parent 262912967a
commit e709251ef2

View File

@ -36,6 +36,7 @@ function* editAndCheck(view) {
let onPropertyChange = waitForComputedStyleProperty("#testid", null,
"padding-top", newPaddingValue);
let onRefreshAfterPreview = once(view, "ruleview-changed");
info("Entering a new value");
EventUtils.sendString(newPaddingValue, view.styleWindow);
@ -44,6 +45,9 @@ function* editAndCheck(view) {
"changes to document");
yield onPropertyChange;
info("Waiting for ruleview-refreshed after previewValue was applied.");
yield onRefreshAfterPreview;
let onBlur = once(editor.input, "blur");
info("Entering the commit key and finishing edit");