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

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

Issue 2617113002: Handle repeated and overlapping (re)starts of mock speechrecognizer. (Closed)
Patch Set: Created 3 years, 11 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
« 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 private: 64 private:
65 DISALLOW_COPY_AND_ASSIGN(Task); 65 DISALLOW_COPY_AND_ASSIGN(Task);
66 }; 66 };
67 67
68 private: 68 private:
69 void StartTaskQueue(); 69 void StartTaskQueue();
70 void ClearTaskQueue(); 70 void ClearTaskQueue();
71 void PostRunTaskFromQueue(); 71 void PostRunTaskFromQueue();
72 void RunTaskFromQueue(); 72 void RunTaskFromQueue();
73 73
74 bool HasPendingNewContextTasks() const;
75
74 blink::WebSpeechRecognitionHandle handle_; 76 blink::WebSpeechRecognitionHandle handle_;
75 blink::WebSpeechRecognizerClient* client_; 77 blink::WebSpeechRecognizerClient* client_;
76 std::vector<blink::WebString> mock_transcripts_; 78 std::vector<blink::WebString> mock_transcripts_;
77 std::vector<float> mock_confidences_; 79 std::vector<float> mock_confidences_;
78 bool was_aborted_; 80 bool was_aborted_;
79 81
80 // Queue of tasks to be run. 82 // Queue of tasks to be run.
81 std::deque<Task*> task_queue_; 83 std::deque<Task*> task_queue_;
82 bool task_queue_running_; 84 bool task_queue_running_;
83 85
84 WebTestDelegate* delegate_; 86 WebTestDelegate* delegate_;
85 87
86 base::WeakPtrFactory<MockWebSpeechRecognizer> weak_factory_; 88 base::WeakPtrFactory<MockWebSpeechRecognizer> weak_factory_;
87 89
88 DISALLOW_COPY_AND_ASSIGN(MockWebSpeechRecognizer); 90 DISALLOW_COPY_AND_ASSIGN(MockWebSpeechRecognizer);
89 }; 91 };
90 92
91 } // namespace test_runner 93 } // namespace test_runner
92 94
93 #endif // COMPONENTS_TEST_RUNNER_MOCK_WEB_SPEECH_RECOGNIZER_H_ 95 #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