| Index: components/test_runner/mock_web_speech_recognizer.cc
|
| diff --git a/components/test_runner/mock_web_speech_recognizer.cc b/components/test_runner/mock_web_speech_recognizer.cc
|
| index f2527c1e8d44a82ff69a7235fb53d65c40c28473..88570b862668c305c0f3e544eda0340c4967819e 100644
|
| --- a/components/test_runner/mock_web_speech_recognizer.cc
|
| +++ b/components/test_runner/mock_web_speech_recognizer.cc
|
| @@ -183,7 +183,7 @@ void MockWebSpeechRecognizer::start(
|
| const blink::WebSpeechRecognitionParams& params,
|
| blink::WebSpeechRecognizerClient* client) {
|
| was_aborted_ = false;
|
| - if (!client_) {
|
| + if (!client_ && !HasPendingNewContextTasks()) {
|
| handle_ = handle;
|
| client_ = client;
|
| } else {
|
| @@ -318,4 +318,12 @@ void MockWebSpeechRecognizer::RunTaskFromQueue() {
|
| PostRunTaskFromQueue();
|
| }
|
|
|
| +bool MockWebSpeechRecognizer::HasPendingNewContextTasks() const {
|
| + for (const auto& task : task_queue_) {
|
| + if (task->isNewContextTask())
|
| + return true;
|
| + }
|
| + return false;
|
| +}
|
| +
|
| } // namespace test_runner
|
|
|