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

Side by Side Diff: content/browser/speech/speech_recognizer_unittest.cc

Issue 11421103: Update the Speech Api to support array(s) of result items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix issue with page reloads and add a TODO. Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <vector> 5 #include <vector>
6 6
7 #include "content/browser/browser_thread_impl.h" 7 #include "content/browser/browser_thread_impl.h"
8 #include "content/browser/speech/google_one_shot_remote_engine.h" 8 #include "content/browser/speech/google_one_shot_remote_engine.h"
9 #include "content/browser/speech/speech_recognizer.h" 9 #include "content/browser/speech/speech_recognizer.h"
10 #include "content/public/browser/speech_recognition_event_listener.h" 10 #include "content/public/browser/speech_recognition_event_listener.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 virtual void OnAudioStart(int session_id) OVERRIDE { 89 virtual void OnAudioStart(int session_id) OVERRIDE {
90 audio_started_ = true; 90 audio_started_ = true;
91 CheckEventsConsistency(); 91 CheckEventsConsistency();
92 } 92 }
93 93
94 virtual void OnAudioEnd(int session_id) OVERRIDE { 94 virtual void OnAudioEnd(int session_id) OVERRIDE {
95 audio_ended_ = true; 95 audio_ended_ = true;
96 CheckEventsConsistency(); 96 CheckEventsConsistency();
97 } 97 }
98 98
99 virtual void OnRecognitionResult( 99 virtual void OnRecognitionResults(
100 int session_id, const SpeechRecognitionResult& result) OVERRIDE { 100 int session_id, const SpeechRecognitionResults& results) OVERRIDE {
101 result_received_ = true; 101 result_received_ = true;
102 } 102 }
103 103
104 virtual void OnRecognitionError( 104 virtual void OnRecognitionError(
105 int session_id, const SpeechRecognitionError& error) OVERRIDE { 105 int session_id, const SpeechRecognitionError& error) OVERRIDE {
106 EXPECT_TRUE(recognition_started_); 106 EXPECT_TRUE(recognition_started_);
107 EXPECT_FALSE(recognition_ended_); 107 EXPECT_FALSE(recognition_ended_);
108 error_ = error.code; 108 error_ = error.code;
109 } 109 }
110 110
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 488
489 EXPECT_EQ(SPEECH_RECOGNITION_ERROR_NONE, error_); 489 EXPECT_EQ(SPEECH_RECOGNITION_ERROR_NONE, error_);
490 EXPECT_FALSE(audio_ended_); 490 EXPECT_FALSE(audio_ended_);
491 EXPECT_FALSE(recognition_ended_); 491 EXPECT_FALSE(recognition_ended_);
492 recognizer_->AbortRecognition(); 492 recognizer_->AbortRecognition();
493 MessageLoop::current()->RunUntilIdle(); 493 MessageLoop::current()->RunUntilIdle();
494 CheckFinalEventsConsistency(); 494 CheckFinalEventsConsistency();
495 } 495 }
496 496
497 } // namespace content 497 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698