Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(793)

Side by Side Diff: components/test_runner/mock_web_speech_recognizer.h

Issue 2525933002: Handle overlapping uses of MockWebSpeechRecognizer (Closed)
Patch Set: address style issues Created 4 years 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
« no previous file with comments | « no previous file | components/test_runner/mock_web_speech_recognizer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | components/test_runner/mock_web_speech_recognizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698