| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "base/command_line.h" | 4 #include "base/command_line.h" |
| 5 #include "chrome/browser/extensions/extension_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
| 6 #include "chrome/browser/extensions/extension_tts_api.h" | 6 #include "chrome/browser/extensions/extension_tts_api.h" |
| 7 #include "chrome/common/chrome_switches.h" | 7 #include "chrome/common/chrome_switches.h" |
| 8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 Return(false))); | 173 Return(false))); |
| 174 EXPECT_CALL(mock_platform_impl_, StopSpeaking()) | 174 EXPECT_CALL(mock_platform_impl_, StopSpeaking()) |
| 175 .WillOnce(Return(true)); | 175 .WillOnce(Return(true)); |
| 176 EXPECT_CALL(mock_platform_impl_, Speak(_, _, _, _, _, _)) | 176 EXPECT_CALL(mock_platform_impl_, Speak(_, _, _, _, _, _)) |
| 177 .WillOnce(Return(true)); | 177 .WillOnce(Return(true)); |
| 178 EXPECT_CALL(mock_platform_impl_, IsSpeaking()) | 178 EXPECT_CALL(mock_platform_impl_, IsSpeaking()) |
| 179 .WillOnce(Return(false)); | 179 .WillOnce(Return(false)); |
| 180 ASSERT_TRUE(RunExtensionTest("tts/speak_error")) << message_; | 180 ASSERT_TRUE(RunExtensionTest("tts/speak_error")) << message_; |
| 181 } | 181 } |
| 182 | 182 |
| 183 IN_PROC_BROWSER_TEST_F(TtsApiTest, Provide) { | 183 #if defined(OS_WIN) |
| 184 // Flakily fails on Windows: http://crbug.com/70198 |
| 185 #define MAYBE_Provide FLAKY_Provide |
| 186 #else |
| 187 #define MAYBE_Provide Provide |
| 188 #endif |
| 189 IN_PROC_BROWSER_TEST_F(TtsApiTest, MAYBE_Provide) { |
| 184 EXPECT_CALL(mock_platform_impl_, StopSpeaking()) | 190 EXPECT_CALL(mock_platform_impl_, StopSpeaking()) |
| 185 .WillRepeatedly(Return(true)); | 191 .WillRepeatedly(Return(true)); |
| 186 EXPECT_CALL(mock_platform_impl_, IsSpeaking()) | 192 EXPECT_CALL(mock_platform_impl_, IsSpeaking()) |
| 187 .WillRepeatedly(Return(false)); | 193 .WillRepeatedly(Return(false)); |
| 188 | 194 |
| 189 { | 195 { |
| 190 InSequence s; | 196 InSequence s; |
| 191 EXPECT_CALL(mock_platform_impl_, Speak("native speech", _, _, _, _, _)) | 197 EXPECT_CALL(mock_platform_impl_, Speak("native speech", _, _, _, _, _)) |
| 192 .WillOnce(Return(true)); | 198 .WillOnce(Return(true)); |
| 193 EXPECT_CALL(mock_platform_impl_, Speak("native speech 2", _, _, _, _, _)) | 199 EXPECT_CALL(mock_platform_impl_, Speak("native speech 2", _, _, _, _, _)) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 204 CommandLine::ForCurrentProcess()->AppendSwitch( | 210 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 205 switches::kEnableExperimentalExtensionApis); | 211 switches::kEnableExperimentalExtensionApis); |
| 206 | 212 |
| 207 chromeos::CrosMock crosMock; | 213 chromeos::CrosMock crosMock; |
| 208 crosMock.InitMockSpeechSynthesisLibrary(); | 214 crosMock.InitMockSpeechSynthesisLibrary(); |
| 209 crosMock.SetSpeechSynthesisLibraryExpectations(); | 215 crosMock.SetSpeechSynthesisLibraryExpectations(); |
| 210 | 216 |
| 211 ASSERT_TRUE(RunExtensionTest("tts/chromeos")) << message_; | 217 ASSERT_TRUE(RunExtensionTest("tts/chromeos")) << message_; |
| 212 } | 218 } |
| 213 #endif | 219 #endif |
| OLD | NEW |