| 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/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 | 92 |
| 93 int caller_id_; | 93 int caller_id_; |
| 94 Delegate* delegate_; | 94 Delegate* delegate_; |
| 95 std::string grammar_; | 95 std::string grammar_; |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 class SpeechInputBrowserTest : public InProcessBrowserTest { | 98 class SpeechInputBrowserTest : public InProcessBrowserTest { |
| 99 public: | 99 public: |
| 100 // InProcessBrowserTest methods | 100 // InProcessBrowserTest methods |
| 101 virtual void SetUpCommandLine(CommandLine* command_line) { |
| 102 EXPECT_TRUE(!command_line->HasSwitch(switches::kDisableSpeechInput)); |
| 103 } |
| 104 |
| 101 GURL testUrl(const FilePath::CharType* filename) { | 105 GURL testUrl(const FilePath::CharType* filename) { |
| 102 const FilePath kTestDir(FILE_PATH_LITERAL("speech")); | 106 const FilePath kTestDir(FILE_PATH_LITERAL("speech")); |
| 103 return ui_test_utils::GetTestUrl(kTestDir, FilePath(filename)); | 107 return ui_test_utils::GetTestUrl(kTestDir, FilePath(filename)); |
| 104 } | 108 } |
| 105 | 109 |
| 106 protected: | 110 protected: |
| 107 void LoadAndRunSpeechInputTest(const FilePath::CharType* filename) { | 111 void LoadAndRunSpeechInputTest(const FilePath::CharType* filename) { |
| 108 // The test page calculates the speech button's coordinate in the page on | 112 // 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 | 113 // load & sets that coordinate in the URL fragment. We send mouse down & up |
| 110 // events at that coordinate to trigger speech recognition. | 114 // events at that coordinate to trigger speech recognition. |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 #else | 202 #else |
| 199 #define MAYBE_GrammarAttribute GrammarAttribute | 203 #define MAYBE_GrammarAttribute GrammarAttribute |
| 200 #endif | 204 #endif |
| 201 IN_PROC_BROWSER_TEST_F(SpeechInputBrowserTest, MAYBE_GrammarAttribute) { | 205 IN_PROC_BROWSER_TEST_F(SpeechInputBrowserTest, MAYBE_GrammarAttribute) { |
| 202 LoadAndRunSpeechInputTest(FILE_PATH_LITERAL("grammar_attribute.html")); | 206 LoadAndRunSpeechInputTest(FILE_PATH_LITERAL("grammar_attribute.html")); |
| 203 EXPECT_EQ("http://example.com/grammar.xml", | 207 EXPECT_EQ("http://example.com/grammar.xml", |
| 204 fake_speech_input_manager_.grammar()); | 208 fake_speech_input_manager_.grammar()); |
| 205 } | 209 } |
| 206 | 210 |
| 207 } // namespace speech_input | 211 } // namespace speech_input |
| OLD | NEW |