OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_TEST_RUNNER_MOCK_WEB_SPEECH_RECOGNIZER_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_MOCK_WEB_SPEECH_RECOGNIZER_H_ |
6 #define COMPONENTS_TEST_RUNNER_MOCK_WEB_SPEECH_RECOGNIZER_H_ | 6 #define COMPONENTS_TEST_RUNNER_MOCK_WEB_SPEECH_RECOGNIZER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 // Methods accessed by layout tests: | 42 // Methods accessed by layout tests: |
43 void AddMockResult(const blink::WebString& transcript, float confidence); | 43 void AddMockResult(const blink::WebString& transcript, float confidence); |
44 void SetError(const blink::WebString& error, const blink::WebString& message); | 44 void SetError(const blink::WebString& error, const blink::WebString& message); |
45 bool WasAborted() const { return was_aborted_; } | 45 bool WasAborted() const { return was_aborted_; } |
46 | 46 |
47 // Methods accessed from Task objects: | 47 // Methods accessed from Task objects: |
48 blink::WebSpeechRecognizerClient* Client() { return client_; } | 48 blink::WebSpeechRecognizerClient* Client() { return client_; } |
49 blink::WebSpeechRecognitionHandle& Handle() { return handle_; } | 49 blink::WebSpeechRecognitionHandle& Handle() { return handle_; } |
50 | 50 |
| 51 void SetClientContext(const blink::WebSpeechRecognitionHandle&, |
| 52 blink::WebSpeechRecognizerClient*); |
| 53 |
51 class Task { | 54 class Task { |
52 public: | 55 public: |
53 Task(MockWebSpeechRecognizer* recognizer) : recognizer_(recognizer) {} | 56 Task(MockWebSpeechRecognizer* recognizer) : recognizer_(recognizer) {} |
54 virtual ~Task() {} | 57 virtual ~Task() {} |
55 virtual void run() = 0; | 58 virtual void run() = 0; |
| 59 virtual bool isNewContextTask() const; |
56 | 60 |
57 protected: | 61 protected: |
58 MockWebSpeechRecognizer* recognizer_; | 62 MockWebSpeechRecognizer* recognizer_; |
59 | 63 |
60 private: | 64 private: |
61 DISALLOW_COPY_AND_ASSIGN(Task); | 65 DISALLOW_COPY_AND_ASSIGN(Task); |
62 }; | 66 }; |
63 | 67 |
64 private: | 68 private: |
65 void StartTaskQueue(); | 69 void StartTaskQueue(); |
(...skipping 14 matching lines...) Expand all Loading... |
80 WebTestDelegate* delegate_; | 84 WebTestDelegate* delegate_; |
81 | 85 |
82 base::WeakPtrFactory<MockWebSpeechRecognizer> weak_factory_; | 86 base::WeakPtrFactory<MockWebSpeechRecognizer> weak_factory_; |
83 | 87 |
84 DISALLOW_COPY_AND_ASSIGN(MockWebSpeechRecognizer); | 88 DISALLOW_COPY_AND_ASSIGN(MockWebSpeechRecognizer); |
85 }; | 89 }; |
86 | 90 |
87 } // namespace test_runner | 91 } // namespace test_runner |
88 | 92 |
89 #endif // COMPONENTS_TEST_RUNNER_MOCK_WEB_SPEECH_RECOGNIZER_H_ | 93 #endif // COMPONENTS_TEST_RUNNER_MOCK_WEB_SPEECH_RECOGNIZER_H_ |
OLD | NEW |