| 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/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
| 10 #include "chrome/browser/speech/speech_input_extension_api.h" | 10 #include "chrome/browser/speech/speech_input_extension_api.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 void SetRecognitionDelay(int result_delay_ms) { | 49 void SetRecognitionDelay(int result_delay_ms) { |
| 50 result_delay_ms_ = result_delay_ms; | 50 result_delay_ms_ = result_delay_ms; |
| 51 } | 51 } |
| 52 | 52 |
| 53 // Used as delay when the corresponding call should not be dispatched. | 53 // Used as delay when the corresponding call should not be dispatched. |
| 54 static const int kDontDispatchCall = -1; | 54 static const int kDontDispatchCall = -1; |
| 55 | 55 |
| 56 // InProcessBrowserTest methods. | 56 // InProcessBrowserTest methods. |
| 57 virtual void SetUpOnMainThread() OVERRIDE { | 57 virtual void SetUpOnMainThread() OVERRIDE { |
| 58 ExtensionApiTest::SetUpOnMainThread(); |
| 58 manager_ = SpeechInputExtensionManager::GetForProfile(browser()->profile()); | 59 manager_ = SpeechInputExtensionManager::GetForProfile(browser()->profile()); |
| 59 } | 60 } |
| 60 | 61 |
| 61 // ExtensionApiTest methods. | 62 // ExtensionApiTest methods. |
| 62 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 63 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 63 ExtensionApiTest::SetUpCommandLine(command_line); | 64 ExtensionApiTest::SetUpCommandLine(command_line); |
| 64 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | 65 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
| 65 } | 66 } |
| 66 | 67 |
| 67 // SpeechInputExtensionInterface methods. | 68 // SpeechInputExtensionInterface methods. |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 SetRecognitionResult(result); | 217 SetRecognitionResult(result); |
| 217 ASSERT_TRUE(RunExtensionTest("speech_input/recognition")) << message_; | 218 ASSERT_TRUE(RunExtensionTest("speech_input/recognition")) << message_; |
| 218 } | 219 } |
| 219 | 220 |
| 220 IN_PROC_BROWSER_TEST_F(SpeechInputExtensionApiTest, RecognitionError) { | 221 IN_PROC_BROWSER_TEST_F(SpeechInputExtensionApiTest, RecognitionError) { |
| 221 AutoManagerHook hook(this); | 222 AutoManagerHook hook(this); |
| 222 | 223 |
| 223 SetRecognitionError(content::SPEECH_RECOGNITION_ERROR_NETWORK); | 224 SetRecognitionError(content::SPEECH_RECOGNITION_ERROR_NETWORK); |
| 224 ASSERT_TRUE(RunExtensionTest("speech_input/recognition_error")) << message_; | 225 ASSERT_TRUE(RunExtensionTest("speech_input/recognition_error")) << message_; |
| 225 } | 226 } |
| OLD | NEW |