| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
| 9 #include "chrome/browser/extensions/extension_tts_api.h" | 9 #include "chrome/browser/extensions/extension_tts_api.h" |
| 10 #include "chrome/browser/extensions/extension_tts_api_controller.h" | 10 #include "chrome/browser/extensions/extension_tts_api_controller.h" |
| 11 #include "chrome/browser/extensions/extension_tts_api_platform.h" | 11 #include "chrome/browser/extensions/extension_tts_api_platform.h" |
| 12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
| 13 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 15 |
| 16 // Needed for CreateFunctor. | 16 // Needed for CreateFunctor. |
| 17 #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING | 17 #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
| 18 #include "testing/gmock_mutant.h" | 18 #include "testing/gmock_mutant.h" |
| 19 | 19 |
| 20 #if defined(OS_CHROMEOS) | |
| 21 #include "chrome/browser/chromeos/cros/cros_mock.h" | |
| 22 #endif | |
| 23 | |
| 24 using ::testing::AnyNumber; | 20 using ::testing::AnyNumber; |
| 25 using ::testing::CreateFunctor; | 21 using ::testing::CreateFunctor; |
| 26 using ::testing::DoAll; | 22 using ::testing::DoAll; |
| 27 using ::testing::InSequence; | 23 using ::testing::InSequence; |
| 28 using ::testing::InvokeWithoutArgs; | 24 using ::testing::InvokeWithoutArgs; |
| 29 using ::testing::Return; | 25 using ::testing::Return; |
| 30 using ::testing::StrictMock; | 26 using ::testing::StrictMock; |
| 31 using ::testing::_; | 27 using ::testing::_; |
| 32 | 28 |
| 33 class MockExtensionTtsPlatformImpl : public ExtensionTtsPlatformImpl { | 29 class MockExtensionTtsPlatformImpl : public ExtensionTtsPlatformImpl { |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 | 294 |
| 299 ASSERT_TRUE(RunExtensionTest("tts_engine/engine_error")) << message_; | 295 ASSERT_TRUE(RunExtensionTest("tts_engine/engine_error")) << message_; |
| 300 } | 296 } |
| 301 | 297 |
| 302 IN_PROC_BROWSER_TEST_F(TtsApiTest, EngineWordCallbacks) { | 298 IN_PROC_BROWSER_TEST_F(TtsApiTest, EngineWordCallbacks) { |
| 303 EXPECT_CALL(mock_platform_impl_, StopSpeaking()) | 299 EXPECT_CALL(mock_platform_impl_, StopSpeaking()) |
| 304 .WillRepeatedly(Return(true)); | 300 .WillRepeatedly(Return(true)); |
| 305 | 301 |
| 306 ASSERT_TRUE(RunExtensionTest("tts_engine/engine_word_callbacks")) << message_; | 302 ASSERT_TRUE(RunExtensionTest("tts_engine/engine_word_callbacks")) << message_; |
| 307 } | 303 } |
| 308 | |
| 309 #if defined(OS_CHROMEOS) | |
| 310 // Fails since v8 roll at r96374: http://crbug.com/92482 | |
| 311 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FAILS_TtsChromeOs) { | |
| 312 CommandLine::ForCurrentProcess()->AppendSwitch( | |
| 313 switches::kEnableExperimentalExtensionApis); | |
| 314 | |
| 315 chromeos::CrosMock crosMock; | |
| 316 crosMock.InitMockSpeechSynthesisLibrary(); | |
| 317 crosMock.SetSpeechSynthesisLibraryExpectations(); | |
| 318 | |
| 319 ASSERT_TRUE(RunExtensionTest("tts/chromeos")) << message_; | |
| 320 } | |
| 321 #endif | |
| OLD | NEW |