Closed Bug 676394 Opened 13 years ago Closed 13 years ago

Simpletest.finish needs to be wrapped in a settimeout after changing a pref

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: martijn.martijn, Unassigned)

References

Details

Attachments

(2 files)

Attached patch patchSplinter Review
Test_bug580685.html is failing for me in Fennec.
test_bug401046.html is one of the causes, see testcase here:
http://people.mozilla.com/~mwargers/mochitestjs/parent580685.html
You need to have the specialpowers extension installed for this testcase:
http://people.mozilla.com/~mwargers/mochitestjs/specialpowers.xpi

This testcase works in Firefox desktop, but not in Fennec. I guess because of e10s. Specialpowers.setIntPref, etc is apparently really async there.

The attached patch fixes the cases where Specialpowers prefs are set and where Simpletest.finish() is called immediately after that.

This makes test_pixel_lengths.html also pass in Fennec mochitest, where it was failing previously.
After these changes, test_bug580685.html is passing for me in Fennec mochitest.
On Firefox mochitest, these mochitests keep passing for me.
This was test on Windows.
Attachment #550527 - Flags: review?(dbaron)
I suspect this is related to bug 621363
Attached patch patch2Splinter Review
test_dont_use_document_colors.html also needs a similar treatment.

This was the first test where I really had to use the double timer.
setTimeout(part2, 0); was causing failures, after changing it to:
setTimeout(setTimeout, 0, part2, 0);
all the tests passed on Fennec.

To be sure, I changed the other timer too in this patch.
Attachment #550665 - Flags: review?(dbaron)
It seems like we need a function that sets a preference (or maybe a set of preferences) and calls a callback function when the preference change has taken effect.  I'd think such a function would be quite useful for other things in tests that use preferences as well.  That would also be much clearer than these setTimeout tricks.
There is some talk about something in bug 621363, not sure what, but that would fix this in a different way. So let's close it out as invalid then.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
So I guess, instead of adding timers to preference setting, the current timers to preference setting should be removed, once bug 621363 is fixed.
Depends on: 621363
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: