| 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 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/memory/weak_ptr.h" | 7 #include "base/memory/weak_ptr.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
| 10 #include "chrome/browser/speech/extension_api/tts_extension_api.h" | 10 #include "chrome/browser/speech/extension_api/tts_extension_api.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 | 43 |
| 44 | 44 |
| 45 MOCK_METHOD4(Speak, | 45 MOCK_METHOD4(Speak, |
| 46 bool(int utterance_id, | 46 bool(int utterance_id, |
| 47 const std::string& utterance, | 47 const std::string& utterance, |
| 48 const std::string& lang, | 48 const std::string& lang, |
| 49 const UtteranceContinuousParameters& params)); | 49 const UtteranceContinuousParameters& params)); |
| 50 MOCK_METHOD0(StopSpeaking, bool(void)); | 50 MOCK_METHOD0(StopSpeaking, bool(void)); |
| 51 | 51 |
| 52 MOCK_METHOD0(IsSpeaking, bool(void)); |
| 53 |
| 52 void SetErrorToEpicFail() { | 54 void SetErrorToEpicFail() { |
| 53 set_error("epic fail"); | 55 set_error("epic fail"); |
| 54 } | 56 } |
| 55 | 57 |
| 56 void SendEndEvent(int utterance_id, | 58 void SendEndEvent(int utterance_id, |
| 57 const std::string& utterance, | 59 const std::string& utterance, |
| 58 const std::string& lang, | 60 const std::string& lang, |
| 59 const UtteranceContinuousParameters& params) { | 61 const UtteranceContinuousParameters& params) { |
| 60 MessageLoop::current()->PostDelayedTask( | 62 MessageLoop::current()->PostDelayedTask( |
| 61 FROM_HERE, base::Bind( | 63 FROM_HERE, base::Bind( |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 292 |
| 291 ASSERT_TRUE(RunExtensionTest("tts_engine/engine_error")) << message_; | 293 ASSERT_TRUE(RunExtensionTest("tts_engine/engine_error")) << message_; |
| 292 } | 294 } |
| 293 | 295 |
| 294 IN_PROC_BROWSER_TEST_F(TtsApiTest, EngineWordCallbacks) { | 296 IN_PROC_BROWSER_TEST_F(TtsApiTest, EngineWordCallbacks) { |
| 295 EXPECT_CALL(mock_platform_impl_, StopSpeaking()) | 297 EXPECT_CALL(mock_platform_impl_, StopSpeaking()) |
| 296 .WillRepeatedly(Return(true)); | 298 .WillRepeatedly(Return(true)); |
| 297 | 299 |
| 298 ASSERT_TRUE(RunExtensionTest("tts_engine/engine_word_callbacks")) << message_; | 300 ASSERT_TRUE(RunExtensionTest("tts_engine/engine_word_callbacks")) << message_; |
| 299 } | 301 } |
| OLD | NEW |