OLD | NEW |
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 MockWebSpeechRecognizer_h | 5 #ifndef MockWebSpeechRecognizer_h |
6 #define MockWebSpeechRecognizer_h | 6 #define MockWebSpeechRecognizer_h |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
| 11 #include "base/basictypes.h" |
11 #include "content/shell/renderer/test_runner/TestCommon.h" | 12 #include "content/shell/renderer/test_runner/TestCommon.h" |
12 #include "content/shell/renderer/test_runner/WebTask.h" | 13 #include "content/shell/renderer/test_runner/WebTask.h" |
13 #include "third_party/WebKit/public/platform/WebNonCopyable.h" | |
14 #include "third_party/WebKit/public/web/WebSpeechRecognizer.h" | 14 #include "third_party/WebKit/public/web/WebSpeechRecognizer.h" |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 class WebSpeechRecognitionHandle; | 17 class WebSpeechRecognitionHandle; |
18 class WebSpeechRecognitionParams; | 18 class WebSpeechRecognitionParams; |
19 class WebSpeechRecognizerClient; | 19 class WebSpeechRecognizerClient; |
20 } | 20 } |
21 | 21 |
22 namespace WebTestRunner { | 22 namespace WebTestRunner { |
23 | 23 |
24 class WebTestDelegate; | 24 class WebTestDelegate; |
25 | 25 |
26 class MockWebSpeechRecognizer : public blink::WebSpeechRecognizer, public blink:
:WebNonCopyable { | 26 class MockWebSpeechRecognizer : public blink::WebSpeechRecognizer { |
27 public: | 27 public: |
28 MockWebSpeechRecognizer(); | 28 MockWebSpeechRecognizer(); |
29 ~MockWebSpeechRecognizer(); | 29 ~MockWebSpeechRecognizer(); |
30 | 30 |
31 void setDelegate(WebTestDelegate*); | 31 void setDelegate(WebTestDelegate*); |
32 | 32 |
33 // WebSpeechRecognizer implementation: | 33 // WebSpeechRecognizer implementation: |
34 virtual void start(const blink::WebSpeechRecognitionHandle&, const blink::We
bSpeechRecognitionParams&, blink::WebSpeechRecognizerClient*) OVERRIDE; | 34 virtual void start(const blink::WebSpeechRecognitionHandle&, const blink::We
bSpeechRecognitionParams&, blink::WebSpeechRecognizerClient*) OVERRIDE; |
35 virtual void stop(const blink::WebSpeechRecognitionHandle&, blink::WebSpeech
RecognizerClient*) OVERRIDE; | 35 virtual void stop(const blink::WebSpeechRecognitionHandle&, blink::WebSpeech
RecognizerClient*) OVERRIDE; |
36 virtual void abort(const blink::WebSpeechRecognitionHandle&, blink::WebSpeec
hRecognizerClient*) OVERRIDE; | 36 virtual void abort(const blink::WebSpeechRecognitionHandle&, blink::WebSpeec
hRecognizerClient*) OVERRIDE; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 bool m_taskQueueRunning; | 70 bool m_taskQueueRunning; |
71 | 71 |
72 WebTestDelegate* m_delegate; | 72 WebTestDelegate* m_delegate; |
73 | 73 |
74 // Task for stepping the queue. | 74 // Task for stepping the queue. |
75 class StepTask : public WebMethodTask<MockWebSpeechRecognizer> { | 75 class StepTask : public WebMethodTask<MockWebSpeechRecognizer> { |
76 public: | 76 public: |
77 StepTask(MockWebSpeechRecognizer* object) : WebMethodTask<MockWebSpeechR
ecognizer>(object) { } | 77 StepTask(MockWebSpeechRecognizer* object) : WebMethodTask<MockWebSpeechR
ecognizer>(object) { } |
78 virtual void runIfValid() OVERRIDE; | 78 virtual void runIfValid() OVERRIDE; |
79 }; | 79 }; |
| 80 |
| 81 DISALLOW_COPY_AND_ASSIGN(MockWebSpeechRecognizer); |
80 }; | 82 }; |
81 | 83 |
82 } | 84 } |
83 | 85 |
84 #endif // MockWebSpeechRecognizer_h | 86 #endif // MockWebSpeechRecognizer_h |
OLD | NEW |