diff --git a/dom/media/webspeech/synth/pico/nsPicoService.cpp b/dom/media/webspeech/synth/pico/nsPicoService.cpp index 2e2e2820e92..718cfd1edea 100644 --- a/dom/media/webspeech/synth/pico/nsPicoService.cpp +++ b/dom/media/webspeech/synth/pico/nsPicoService.cpp @@ -17,7 +17,7 @@ #include "nsIFile.h" #include "nsThreadUtils.h" #include "prenv.h" - +#include "mozilla/Preferences.h" #include "mozilla/DebugOnly.h" #include @@ -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 rv = NS_NewNamedThread("Pico Worker", getter_AddRefs(mThread)); MOZ_ASSERT(NS_SUCCEEDED(rv)); return mThread->Dispatch( diff --git a/testing/profiles/prefs_general.js b/testing/profiles/prefs_general.js index 033ccba9264..64aed3c2769 100644 --- a/testing/profiles/prefs_general.js +++ b/testing/profiles/prefs_general.js @@ -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);