Bug 1051146 - Part 4: Introduce build system changes for the MOZ_WEBSPEECH_TEST_BACKEND flag. r=smaug, r=gps

This commit is contained in:
Kelly Davis 2015-05-21 07:40:00 -04:00
parent 60bc7baa75
commit 4c2072f510
3 changed files with 29 additions and 9 deletions

View File

@ -19,9 +19,13 @@ EXPORTS.mozilla.dom += [
'SpeechRecognitionResult.h',
'SpeechRecognitionResultList.h',
'SpeechStreamListener.h',
'test/FakeSpeechRecognitionService.h',
]
if CONFIG['MOZ_WEBSPEECH_TEST_BACKEND']:
EXPORTS.mozilla.dom += [
'test/FakeSpeechRecognitionService.h',
]
UNIFIED_SOURCES += [
'endpointer.cc',
'energy_endpointer.cc',
@ -33,9 +37,13 @@ UNIFIED_SOURCES += [
'SpeechRecognitionResult.cpp',
'SpeechRecognitionResultList.cpp',
'SpeechStreamListener.cpp',
'test/FakeSpeechRecognitionService.cpp',
]
if CONFIG['MOZ_WEBSPEECH_TEST_BACKEND']:
UNIFIED_SOURCES += [
'test/FakeSpeechRecognitionService.cpp',
]
LOCAL_INCLUDES += [
'/dom/base',
]

View File

@ -33,10 +33,14 @@ if CONFIG['MOZ_WEBSPEECH']:
'SpeechSynthesis.cpp',
'SpeechSynthesisUtterance.cpp',
'SpeechSynthesisVoice.cpp',
'test/FakeSynthModule.cpp',
'test/nsFakeSynthServices.cpp'
]
if CONFIG['MOZ_WEBSPEECH_TEST_BACKEND']:
UNIFIED_SOURCES += [
'test/FakeSynthModule.cpp',
'test/nsFakeSynthServices.cpp'
]
if CONFIG['MOZ_SYNTH_PICO']:
DIRS = ['pico']

View File

@ -96,8 +96,10 @@
#include "mozilla/OSFileConstants.h"
#include "mozilla/Services.h"
#ifdef MOZ_WEBSPEECH
#ifdef MOZ_WEBSPEECH_TEST_BACKEND
#include "mozilla/dom/FakeSpeechRecognitionService.h"
#endif
#ifdef MOZ_WEBSPEECH
#include "mozilla/dom/nsSynthVoiceRegistry.h"
#endif
@ -630,7 +632,7 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(AudioChannelService, AudioChannelServic
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(DataStoreService, DataStoreService::GetOrCreate)
#ifdef MOZ_WEBSPEECH
#ifdef MOZ_WEBSPEECH_TEST_BACKEND
NS_GENERIC_FACTORY_CONSTRUCTOR(FakeSpeechRecognitionService)
#endif
@ -826,8 +828,10 @@ NS_DEFINE_NAMED_CID(NS_MEDIAMANAGERSERVICE_CID);
#ifdef MOZ_GAMEPAD
NS_DEFINE_NAMED_CID(NS_GAMEPAD_TEST_CID);
#endif
#ifdef MOZ_WEBSPEECH
#ifdef MOZ_WEBSPEECH_TEST_BACKEND
NS_DEFINE_NAMED_CID(NS_FAKE_SPEECH_RECOGNITION_SERVICE_CID);
#endif
#ifdef MOZ_WEBSPEECH
NS_DEFINE_NAMED_CID(NS_SYNTHVOICEREGISTRY_CID);
#endif
@ -1081,8 +1085,10 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
{ &kNS_AUDIOCHANNEL_SERVICE_CID, false, nullptr, AudioChannelServiceConstructor },
{ &kNS_DATASTORE_SERVICE_CID, false, nullptr, DataStoreServiceConstructor },
{ &kNS_FOCUSMANAGER_CID, false, nullptr, CreateFocusManager },
#ifdef MOZ_WEBSPEECH
#ifdef MOZ_WEBSPEECH_TEST_BACKEND
{ &kNS_FAKE_SPEECH_RECOGNITION_SERVICE_CID, false, nullptr, FakeSpeechRecognitionServiceConstructor },
#endif
#ifdef MOZ_WEBSPEECH
{ &kNS_SYNTHVOICEREGISTRY_CID, true, nullptr, nsSynthVoiceRegistryConstructor },
#endif
{ &kCSPSERVICE_CID, false, nullptr, CSPServiceConstructor },
@ -1243,8 +1249,10 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
{ "@mozilla.org/audiochannel/service;1", &kNS_AUDIOCHANNEL_SERVICE_CID },
{ "@mozilla.org/datastore-service;1", &kNS_DATASTORE_SERVICE_CID },
{ "@mozilla.org/focus-manager;1", &kNS_FOCUSMANAGER_CID },
#ifdef MOZ_WEBSPEECH
#ifdef MOZ_WEBSPEECH_TEST_BACKEND
{ NS_SPEECH_RECOGNITION_SERVICE_CONTRACTID_PREFIX "fake", &kNS_FAKE_SPEECH_RECOGNITION_SERVICE_CID },
#endif
#ifdef MOZ_WEBSPEECH
{ NS_SYNTHVOICEREGISTRY_CONTRACTID, &kNS_SYNTHVOICEREGISTRY_CID },
#endif
{ CSPSERVICE_CONTRACTID, &kCSPSERVICE_CID },