OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Unit tests for the TTS Controller. | 5 // Unit tests for the TTS Controller. |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/speech/tts_controller.h" | 8 #include "chrome/browser/speech/tts_controller.h" |
9 #include "chrome/browser/speech/tts_platform.h" | 9 #include "chrome/browser/speech/tts_platform.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 virtual bool Speak( | 21 virtual bool Speak( |
22 int utterance_id, | 22 int utterance_id, |
23 const std::string& utterance, | 23 const std::string& utterance, |
24 const std::string& lang, | 24 const std::string& lang, |
25 const VoiceData& voice, | 25 const VoiceData& voice, |
26 const UtteranceContinuousParameters& params) OVERRIDE { | 26 const UtteranceContinuousParameters& params) OVERRIDE { |
27 return true; | 27 return true; |
28 } | 28 } |
29 virtual bool IsSpeaking() OVERRIDE { return false; } | 29 virtual bool IsSpeaking() OVERRIDE { return false; } |
30 virtual bool StopSpeaking() OVERRIDE { return true; } | 30 virtual bool StopSpeaking() OVERRIDE { return true; } |
| 31 virtual void Pause() OVERRIDE {} |
| 32 virtual void Resume() OVERRIDE {} |
31 virtual void GetVoices(std::vector<VoiceData>* out_voices) OVERRIDE {} | 33 virtual void GetVoices(std::vector<VoiceData>* out_voices) OVERRIDE {} |
32 virtual std::string error() OVERRIDE { return std::string(); } | 34 virtual std::string error() OVERRIDE { return std::string(); } |
33 virtual void clear_error() OVERRIDE {} | 35 virtual void clear_error() OVERRIDE {} |
34 virtual void set_error(const std::string& error) OVERRIDE {} | 36 virtual void set_error(const std::string& error) OVERRIDE {} |
35 }; | 37 }; |
36 | 38 |
37 // Subclass of TtsController with a public ctor and dtor. | 39 // Subclass of TtsController with a public ctor and dtor. |
38 class TestableTtsController : public TtsController { | 40 class TestableTtsController : public TtsController { |
39 public: | 41 public: |
40 TestableTtsController() {} | 42 TestableTtsController() {} |
(...skipping 13 matching lines...) Expand all Loading... |
54 | 56 |
55 Utterance* utterance2 = new Utterance(NULL); | 57 Utterance* utterance2 = new Utterance(NULL); |
56 utterance2->set_can_enqueue(true); | 58 utterance2->set_can_enqueue(true); |
57 utterance2->set_src_id(2); | 59 utterance2->set_src_id(2); |
58 controller->SpeakOrEnqueue(utterance2); | 60 controller->SpeakOrEnqueue(utterance2); |
59 | 61 |
60 // Make sure that deleting the controller when there are pending | 62 // Make sure that deleting the controller when there are pending |
61 // utterances doesn't cause a crash. | 63 // utterances doesn't cause a crash. |
62 delete controller; | 64 delete controller; |
63 } | 65 } |
OLD | NEW |