Bug 1160844 - Only initialize pico tts when not in mochitest and speech synth is enabled. r=smaug

This commit is contained in:
Eitan Isaacson 2015-05-12 13:24:58 -07:00
parent da86cbdc59
commit ddfe6e8d53
2 changed files with 9 additions and 1 deletions

View File

@ -17,7 +17,7 @@
#include "nsIFile.h"
#include "nsThreadUtils.h"
#include "prenv.h"
#include "mozilla/Preferences.h"
#include "mozilla/DebugOnly.h"
#include <dlfcn.h>
@ -453,6 +453,11 @@ nsPicoService::Observe(nsISupports* aSubject, const char* aTopic,
MOZ_ASSERT(NS_IsMainThread());
NS_ENSURE_TRUE(!strcmp(aTopic, "profile-after-change"), NS_ERROR_UNEXPECTED);
if (!Preferences::GetBool("media.webspeech.synth.enabled") ||
Preferences::GetBool("media.webspeech.synth.test")) {
return NS_OK;
}
DebugOnly<nsresult> rv = NS_NewNamedThread("Pico Worker", getter_AddRefs(mThread));
MOZ_ASSERT(NS_SUCCEEDED(rv));
return mThread->Dispatch(

View File

@ -318,3 +318,6 @@ user_pref("browser.devedition.theme.enabled", false);
// Disable periodic updates of service workers.
user_pref("dom.serviceWorkers.periodic-updates.enabled", false);
// Enable speech synth test service, and disable built in platform services.
user_pref("media.webspeech.synth.test", true);