Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: chrome/browser/extensions/extension_tts_apitest.cc

Issue 8334018: Move the code in libcros' chromeos_speech_synthesis.cc into Chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comments and copyright, cleaned up includes Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/task.h" 6 #include "base/task.h"
7 #include "chrome/browser/extensions/extension_apitest.h" 7 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "chrome/browser/extensions/extension_tts_api.h" 8 #include "chrome/browser/extensions/extension_tts_api.h"
9 #include "chrome/browser/extensions/extension_tts_api_controller.h" 9 #include "chrome/browser/extensions/extension_tts_api_controller.h"
10 #include "chrome/browser/extensions/extension_tts_api_platform.h" 10 #include "chrome/browser/extensions/extension_tts_api_platform.h"
11 #include "chrome/common/chrome_switches.h" 11 #include "chrome/common/chrome_switches.h"
12 #include "testing/gmock/include/gmock/gmock.h" 12 #include "testing/gmock/include/gmock/gmock.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 // Needed for CreateFunctor. 15 // Needed for CreateFunctor.
16 #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING 16 #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
17 #include "testing/gmock_mutant.h" 17 #include "testing/gmock_mutant.h"
18 18
19 #if defined(OS_CHROMEOS)
20 #include "chrome/browser/chromeos/cros/cros_mock.h"
21 #endif
22
23 using ::testing::AnyNumber; 19 using ::testing::AnyNumber;
24 using ::testing::CreateFunctor; 20 using ::testing::CreateFunctor;
25 using ::testing::DoAll; 21 using ::testing::DoAll;
26 using ::testing::InSequence; 22 using ::testing::InSequence;
27 using ::testing::InvokeWithoutArgs; 23 using ::testing::InvokeWithoutArgs;
28 using ::testing::Return; 24 using ::testing::Return;
29 using ::testing::StrictMock; 25 using ::testing::StrictMock;
30 using ::testing::_; 26 using ::testing::_;
31 27
32 class MockExtensionTtsPlatformImpl : public ExtensionTtsPlatformImpl { 28 class MockExtensionTtsPlatformImpl : public ExtensionTtsPlatformImpl {
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 289
294 ASSERT_TRUE(RunExtensionTest("tts_engine/engine_error")) << message_; 290 ASSERT_TRUE(RunExtensionTest("tts_engine/engine_error")) << message_;
295 } 291 }
296 292
297 IN_PROC_BROWSER_TEST_F(TtsApiTest, EngineWordCallbacks) { 293 IN_PROC_BROWSER_TEST_F(TtsApiTest, EngineWordCallbacks) {
298 EXPECT_CALL(mock_platform_impl_, StopSpeaking()) 294 EXPECT_CALL(mock_platform_impl_, StopSpeaking())
299 .WillRepeatedly(Return(true)); 295 .WillRepeatedly(Return(true));
300 296
301 ASSERT_TRUE(RunExtensionTest("tts_engine/engine_word_callbacks")) << message_; 297 ASSERT_TRUE(RunExtensionTest("tts_engine/engine_word_callbacks")) << message_;
302 } 298 }
303
304 #if defined(OS_CHROMEOS)
305 // Fails since v8 roll at r96374: http://crbug.com/92482
306 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FAILS_TtsChromeOs) {
307 CommandLine::ForCurrentProcess()->AppendSwitch(
308 switches::kEnableExperimentalExtensionApis);
309
310 chromeos::CrosMock crosMock;
311 crosMock.InitMockSpeechSynthesisLibrary();
312 crosMock.SetSpeechSynthesisLibraryExpectations();
313
314 ASSERT_TRUE(RunExtensionTest("tts/chromeos")) << message_;
315 }
316 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698