1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/media/webspeech/recognition/test/FakeSpeechRecognitionService.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,49 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim:set ts=2 sw=2 sts=2 et cindent: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef mozilla_dom_FakeSpeechRecognitionService_h 1.11 +#define mozilla_dom_FakeSpeechRecognitionService_h 1.12 + 1.13 +#include "nsCOMPtr.h" 1.14 +#include "nsIObserver.h" 1.15 + 1.16 +// nsISpeechRecognitionService needs these declarations 1.17 +namespace mozilla { 1.18 + class AudioSegment; 1.19 + 1.20 + namespace dom { 1.21 + class SpeechRecognition; 1.22 + class SpeechRecognitionResultList; 1.23 + } 1.24 +} 1.25 + 1.26 +#include "nsISpeechRecognitionService.h" 1.27 + 1.28 +#define NS_FAKE_SPEECH_RECOGNITION_SERVICE_CID \ 1.29 + {0x48c345e7, 0x9929, 0x4f9a, {0xa5, 0x63, 0xf4, 0x78, 0x22, 0x2d, 0xab, 0xcd}}; 1.30 + 1.31 +namespace mozilla { 1.32 + 1.33 +class FakeSpeechRecognitionService : public nsISpeechRecognitionService, 1.34 + public nsIObserver 1.35 +{ 1.36 +public: 1.37 + NS_DECL_ISUPPORTS 1.38 + NS_DECL_NSISPEECHRECOGNITIONSERVICE 1.39 + NS_DECL_NSIOBSERVER 1.40 + 1.41 + FakeSpeechRecognitionService(); 1.42 + 1.43 +private: 1.44 + virtual ~FakeSpeechRecognitionService(); 1.45 + 1.46 + WeakPtr<dom::SpeechRecognition> mRecognition; 1.47 + dom::SpeechRecognitionResultList* BuildMockResultList(); 1.48 +}; 1.49 + 1.50 +} // namespace mozilla 1.51 + 1.52 +#endif