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: content/test/mock_google_streaming_server.h

Issue 1891543002: Devirtualize SpeechRecognitionEngine (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@kill_one_shot_engine
Patch Set: drop an include Created 4 years, 8 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CONTENT_TEST_MOCK_GOOGLE_STREAMING_SERVER_H_ 5 #ifndef CONTENT_TEST_MOCK_GOOGLE_STREAMING_SERVER_H_
6 #define CONTENT_TEST_MOCK_GOOGLE_STREAMING_SERVER_H_ 6 #define CONTENT_TEST_MOCK_GOOGLE_STREAMING_SERVER_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "content/public/common/speech_recognition_result.h" 10 #include "content/public/common/speech_recognition_result.h"
11 #include "net/url_request/test_url_fetcher_factory.h" 11 #include "net/url_request/test_url_fetcher_factory.h"
12 12
13 namespace content { 13 namespace content {
14 14
15 struct SpeechRecognitionResult; 15 struct SpeechRecognitionResult;
16 16
17 // Provides a mock implementation of the Google remote streaming speech 17 // Provides a mock implementation of the Google remote streaming speech
18 // recognition webservice, exploiting the TestURLFetcher to extract request 18 // recognition webservice, exploiting the TestURLFetcher to extract request
19 // parameters and provide forged JSON responses back to the client. 19 // parameters and provide forged JSON responses back to the client.
20 // It is intended for closing the server-side loop in speech tests that involve 20 // It is intended for closing the server-side loop in speech tests that involve
21 // the GoogleStreamingRemoteEngine client. 21 // the SpeechRecognitionEngine client.
22 class MockGoogleStreamingServer : public net::TestURLFetcherDelegateForTests { 22 class MockGoogleStreamingServer : public net::TestURLFetcherDelegateForTests {
23 public: 23 public:
24 class Delegate { 24 class Delegate {
25 public: 25 public:
26 virtual void OnClientConnected() = 0; 26 virtual void OnClientConnected() = 0;
27 virtual void OnClientAudioUpload() = 0; 27 virtual void OnClientAudioUpload() = 0;
28 virtual void OnClientAudioUploadComplete() = 0; 28 virtual void OnClientAudioUploadComplete() = 0;
29 virtual void OnClientDisconnected() = 0; 29 virtual void OnClientDisconnected() = 0;
30 }; 30 };
31 31
(...skipping 27 matching lines...) Expand all
59 // Request arguments extracted by the HTTP query string. 59 // Request arguments extracted by the HTTP query string.
60 std::string request_language; 60 std::string request_language;
61 std::string request_grammar; 61 std::string request_grammar;
62 62
63 DISALLOW_COPY_AND_ASSIGN(MockGoogleStreamingServer); 63 DISALLOW_COPY_AND_ASSIGN(MockGoogleStreamingServer);
64 }; 64 };
65 65
66 } // namespace content 66 } // namespace content
67 67
68 #endif // CONTENT_TEST_MOCK_GOOGLE_STREAMING_SERVER_H_ 68 #endif // CONTENT_TEST_MOCK_GOOGLE_STREAMING_SERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698