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

Unified Diff: chrome/browser/speech/speech_recognition_bubble_controller.h

Issue 10703141: End-to-end browser tests for speech recognition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved test to /chrome/test Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/speech/speech_recognition_bubble_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/speech/speech_recognition_bubble_controller.h
diff --git a/chrome/browser/speech/speech_recognition_bubble_controller.h b/chrome/browser/speech/speech_recognition_bubble_controller.h
index c7bac9e3be7f3566826b35b814921385d0ee96b4..238df9e51a3fbdf1a621a9f5b98d76587326f948 100644
--- a/chrome/browser/speech/speech_recognition_bubble_controller.h
+++ b/chrome/browser/speech/speech_recognition_bubble_controller.h
@@ -34,6 +34,19 @@ class SpeechRecognitionBubbleController
virtual ~Delegate() {}
};
+ // All methods of this delegate are called on the UI thread.
+ class DelegateForTests {
+ public:
+ virtual void BubbleCreated() = 0;
+ virtual void BubbleSwitchedToRecordingMode() = 0;
+ virtual void BubbleSwitchedToRecognizingMode() = 0;
+ virtual void BubbleMessageDisplayed() = 0;
+ virtual void BubbleClosed() = 0;
+ };
+
+ static void SetDelegateForTests(DelegateForTests* delegate_for_tests);
+ static SpeechRecognitionBubbleController* GetInstanceForTests();
+
explicit SpeechRecognitionBubbleController(Delegate* delegate);
// Creates and shows a new speech recognition UI bubble in warmup mode.
@@ -104,6 +117,12 @@ class SpeechRecognitionBubbleController
void InvokeDelegateFocusChanged();
void ProcessRequestInUiThread(const UIRequest& request);
+ // Instance getter for simulating button presses during tests.
+ static SpeechRecognitionBubbleController* instance_for_tests_;
+
+ // Delegate for receiving events on the UI thread during tests.
+ static DelegateForTests* delegate_for_tests_;
+
// *** The following are accessed only on the IO thread.
Delegate* delegate_;
@@ -127,6 +146,9 @@ class SpeechRecognitionBubbleController
typedef SpeechRecognitionBubbleController::Delegate
SpeechRecognitionBubbleControllerDelegate;
+typedef SpeechRecognitionBubbleController::DelegateForTests
+ SpeechRecognitionBubbleControllerDelegateForTests;
+
} // namespace speech
#endif // CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_BUBBLE_CONTROLLER_H_
« no previous file with comments | « no previous file | chrome/browser/speech/speech_recognition_bubble_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698