Bug 1092580 - Wait for a pass through the event loop before trying to poll for prefs in testOSLocale. r=margaret

This commit is contained in:
Richard Newman 2014-11-06 17:54:51 -08:00
Родитель e3656f558a
Коммит 035db48ecd
1 изменённых файлов: 4 добавлений и 1 удалений

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

@ -7,6 +7,8 @@ package org.mozilla.gecko.tests;
import java.util.Locale;
import org.mozilla.gecko.BrowserLocaleManager;
import org.mozilla.gecko.GeckoAppShell;
import org.mozilla.gecko.GeckoEvent;
import org.mozilla.gecko.GeckoSharedPrefs;
import org.mozilla.gecko.PrefsHelper;
@ -42,6 +44,8 @@ public class testOSLocale extends BaseTest {
private final Object waiter = new Object();
public void fetch() throws InterruptedException {
// Wait for any pending changes to have taken. Bug 1092580.
GeckoAppShell.sendEventToGeckoSync(GeckoEvent.createNoOpEvent());
synchronized (waiter) {
PrefsHelper.getPrefs(TO_FETCH, this);
waiter.wait(MAX_WAIT_MS);
@ -113,7 +117,6 @@ public class testOSLocale extends BaseTest {
// This never changes.
final String SELECTED_LOCALES = "es-es,fr,";
// Expected, from es-ES's intl.properties:
final String EXPECTED = SELECTED_LOCALES +
(isMultiLocaleBuild ? "es,en-us,en" : // Expected, from es-ES's intl.properties.