summaryrefslogtreecommitdiffstats
path: root/chrome/browser/speech/speech_recognition_bubble_browsertest.cc
diff options
context:
space:
mode:
authorprimiano@chromium.org <primiano@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-07 11:01:02 +0000
committerprimiano@chromium.org <primiano@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-07 11:01:02 +0000
commitc52b28964090204b87634b396823c3709855079c (patch)
tree1e8e20c58dd735baa7f8312dc115fff224e4e5cd /chrome/browser/speech/speech_recognition_bubble_browsertest.cc
parent9104f7e80f0bd0c2353254ec5c354199d965f44d (diff)
downloadchromium_src-c52b28964090204b87634b396823c3709855079c.zip
chromium_src-c52b28964090204b87634b396823c3709855079c.tar.gz
chromium_src-c52b28964090204b87634b396823c3709855079c.tar.bz2
Renamed speech recognition code in preparation for introducing a new speech implementation.
- The general-purpose speech recognition classes (that will be needed also by future code) have been renamed to SpeechRecognition*; - The IPC Messages and dispatcher(host) classes that are only related to the current input tag (x-webkit-speech) support have been renamed to InputTagSpeech*; - The namespace has been renamed from speech_input to speech; BUG=116954 TEST= Review URL: https://chromiumcodereview.appspot.com/9568002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125378 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/speech/speech_recognition_bubble_browsertest.cc')
-rw-r--r--chrome/browser/speech/speech_recognition_bubble_browsertest.cc57
1 files changed, 57 insertions, 0 deletions
diff --git a/chrome/browser/speech/speech_recognition_bubble_browsertest.cc b/chrome/browser/speech/speech_recognition_bubble_browsertest.cc
new file mode 100644
index 0000000..7b1bec9
--- /dev/null
+++ b/chrome/browser/speech/speech_recognition_bubble_browsertest.cc
@@ -0,0 +1,57 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/speech/speech_recognition_bubble.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
+#include "chrome/test/base/in_process_browser_test.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gfx/rect.h"
+
+class SpeechRecognitionBubbleTest : public SpeechRecognitionBubbleDelegate,
+ public InProcessBrowserTest {
+ public:
+ // SpeechRecognitionBubble::Delegate methods.
+ virtual void InfoBubbleButtonClicked(SpeechRecognitionBubble::Button button) {
+ }
+ virtual void InfoBubbleFocusChanged() {}
+
+ protected:
+};
+
+IN_PROC_BROWSER_TEST_F(SpeechRecognitionBubbleTest, CreateAndDestroy) {
+ gfx::Rect element_rect(100, 100, 100, 100);
+ scoped_ptr<SpeechRecognitionBubble> bubble(SpeechRecognitionBubble::Create(
+ browser()->GetSelectedWebContents(), this, element_rect));
+ EXPECT_TRUE(bubble.get());
+}
+
+IN_PROC_BROWSER_TEST_F(SpeechRecognitionBubbleTest, ShowAndDestroy) {
+ gfx::Rect element_rect(100, 100, 100, 100);
+ scoped_ptr<SpeechRecognitionBubble> bubble(SpeechRecognitionBubble::Create(
+ browser()->GetSelectedWebContents(), this, element_rect));
+ EXPECT_TRUE(bubble.get());
+ bubble->Show();
+}
+
+IN_PROC_BROWSER_TEST_F(SpeechRecognitionBubbleTest, ShowAndHide) {
+ gfx::Rect element_rect(100, 100, 100, 100);
+ scoped_ptr<SpeechRecognitionBubble> bubble(SpeechRecognitionBubble::Create(
+ browser()->GetSelectedWebContents(), this, element_rect));
+ EXPECT_TRUE(bubble.get());
+ bubble->Show();
+ bubble->Hide();
+}
+
+IN_PROC_BROWSER_TEST_F(SpeechRecognitionBubbleTest, ShowAndHideTwice) {
+ gfx::Rect element_rect(100, 100, 100, 100);
+ scoped_ptr<SpeechRecognitionBubble> bubble(SpeechRecognitionBubble::Create(
+ browser()->GetSelectedWebContents(), this, element_rect));
+ EXPECT_TRUE(bubble.get());
+ bubble->Show();
+ bubble->Hide();
+ bubble->Show();
+ bubble->Hide();
+}