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/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
6 #include "chrome/common/net/test_url_fetcher_factory.h" | |
7 #include "content/browser/speech/speech_recognition_request.h" | 6 #include "content/browser/speech/speech_recognition_request.h" |
| 7 #include "content/common/test_url_fetcher_factory.h" |
8 #include "net/url_request/url_request_context_getter.h" | 8 #include "net/url_request/url_request_context_getter.h" |
9 #include "net/url_request/url_request_status.h" | 9 #include "net/url_request/url_request_status.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 namespace speech_input { | 12 namespace speech_input { |
13 | 13 |
14 class SpeechRecognitionRequestTest : public SpeechRecognitionRequestDelegate, | 14 class SpeechRecognitionRequestTest : public SpeechRecognitionRequestDelegate, |
15 public testing::Test { | 15 public testing::Test { |
16 public: | 16 public: |
17 SpeechRecognitionRequestTest() : error_(false) { } | 17 SpeechRecognitionRequestTest() : error_(false) { } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 EXPECT_TRUE(error_); | 90 EXPECT_TRUE(error_); |
91 EXPECT_EQ(0U, result_.size()); | 91 EXPECT_EQ(0U, result_.size()); |
92 | 92 |
93 // Malformed JSON case. | 93 // Malformed JSON case. |
94 CreateAndTestRequest(true, "{\"hypotheses\":[{\"unknownkey\":\"hello\"}]}"); | 94 CreateAndTestRequest(true, "{\"hypotheses\":[{\"unknownkey\":\"hello\"}]}"); |
95 EXPECT_TRUE(error_); | 95 EXPECT_TRUE(error_); |
96 EXPECT_EQ(0U, result_.size()); | 96 EXPECT_EQ(0U, result_.size()); |
97 } | 97 } |
98 | 98 |
99 } // namespace speech_input | 99 } // namespace speech_input |
OLD | NEW |