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 #include "chrome/browser/ui/app_list/speech_recognizer.h" | 5 #include "chrome/browser/ui/app_list/speech_recognizer.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 SpeechRecognizer recognizer(mock_speech_delegate_->GetWeakPtr(), | 82 SpeechRecognizer recognizer(mock_speech_delegate_->GetWeakPtr(), |
83 browser()->profile()->GetRequestContext(), | 83 browser()->profile()->GetRequestContext(), |
84 "en"); | 84 "en"); |
85 | 85 |
86 base::RunLoop run_loop; | 86 base::RunLoop run_loop; |
87 EXPECT_CALL(*mock_speech_delegate_, | 87 EXPECT_CALL(*mock_speech_delegate_, |
88 OnSpeechResult(base::ASCIIToUTF16("Pictures of the moon"), true)); | 88 OnSpeechResult(base::ASCIIToUTF16("Pictures of the moon"), true)); |
89 EXPECT_CALL(*mock_speech_delegate_, | 89 EXPECT_CALL(*mock_speech_delegate_, |
90 OnSpeechRecognitionStateChanged(SPEECH_RECOGNITION_READY)) | 90 OnSpeechRecognitionStateChanged(SPEECH_RECOGNITION_READY)) |
91 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); | 91 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); |
92 recognizer.Start(); | 92 recognizer.Start(nullptr); |
93 run_loop.Run(); | 93 run_loop.Run(); |
94 } | 94 } |
95 | 95 |
96 } // namespace app_list | 96 } // namespace app_list |
97 | 97 |
98 | 98 |
OLD | NEW |