| 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 | 4 |
| 5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/renderer_host/render_view_host.h" | 9 #include "chrome/browser/renderer_host/render_view_host.h" |
| 10 #include "chrome/browser/speech/speech_input_dispatcher_host.h" | 10 #include "chrome/browser/speech/speech_input_dispatcher_host.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 } | 87 } |
| 88 | 88 |
| 89 int caller_id_; | 89 int caller_id_; |
| 90 Delegate* delegate_; | 90 Delegate* delegate_; |
| 91 std::string grammar_; | 91 std::string grammar_; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 class SpeechInputBrowserTest : public InProcessBrowserTest { | 94 class SpeechInputBrowserTest : public InProcessBrowserTest { |
| 95 public: | 95 public: |
| 96 // InProcessBrowserTest methods | 96 // InProcessBrowserTest methods |
| 97 virtual void SetUpCommandLine(CommandLine* command_line) { | |
| 98 EXPECT_TRUE(!command_line->HasSwitch(switches::kDisableSpeechInput)); | |
| 99 } | |
| 100 | |
| 101 GURL testUrl(const FilePath::CharType* filename) { | 97 GURL testUrl(const FilePath::CharType* filename) { |
| 102 const FilePath kTestDir(FILE_PATH_LITERAL("speech")); | 98 const FilePath kTestDir(FILE_PATH_LITERAL("speech")); |
| 103 return ui_test_utils::GetTestUrl(kTestDir, FilePath(filename)); | 99 return ui_test_utils::GetTestUrl(kTestDir, FilePath(filename)); |
| 104 } | 100 } |
| 105 | 101 |
| 106 protected: | 102 protected: |
| 107 void LoadAndRunSpeechInputTest(const FilePath::CharType* filename) { | 103 void LoadAndRunSpeechInputTest(const FilePath::CharType* filename) { |
| 108 // The test page calculates the speech button's coordinate in the page on | 104 // The test page calculates the speech button's coordinate in the page on |
| 109 // load & sets that coordinate in the URL fragment. We send mouse down & up | 105 // load & sets that coordinate in the URL fragment. We send mouse down & up |
| 110 // events at that coordinate to trigger speech recognition. | 106 // events at that coordinate to trigger speech recognition. |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 #else | 182 #else |
| 187 #define MAYBE_GrammarAttribute GrammarAttribute | 183 #define MAYBE_GrammarAttribute GrammarAttribute |
| 188 #endif | 184 #endif |
| 189 IN_PROC_BROWSER_TEST_F(SpeechInputBrowserTest, MAYBE_GrammarAttribute) { | 185 IN_PROC_BROWSER_TEST_F(SpeechInputBrowserTest, MAYBE_GrammarAttribute) { |
| 190 LoadAndRunSpeechInputTest(FILE_PATH_LITERAL("grammar_attribute.html")); | 186 LoadAndRunSpeechInputTest(FILE_PATH_LITERAL("grammar_attribute.html")); |
| 191 EXPECT_EQ("http://example.com/grammar.xml", | 187 EXPECT_EQ("http://example.com/grammar.xml", |
| 192 fake_speech_input_manager_.grammar()); | 188 fake_speech_input_manager_.grammar()); |
| 193 } | 189 } |
| 194 | 190 |
| 195 } // namespace speech_input | 191 } // namespace speech_input |
| OLD | NEW |