1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
// 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/tabs/tab_strip_model.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) OVERRIDE {
}
virtual void InfoBubbleFocusChanged() OVERRIDE {}
protected:
};
IN_PROC_BROWSER_TEST_F(SpeechRecognitionBubbleTest, CreateAndDestroy) {
gfx::Rect element_rect(100, 100, 100, 100);
scoped_ptr<SpeechRecognitionBubble> bubble(SpeechRecognitionBubble::Create(
browser()->tab_strip_model()->GetActiveWebContents(),
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()->tab_strip_model()->GetActiveWebContents(),
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()->tab_strip_model()->GetActiveWebContents(),
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()->tab_strip_model()->GetActiveWebContents(),
this, element_rect));
EXPECT_TRUE(bubble.get());
bubble->Show();
bubble->Hide();
bubble->Show();
bubble->Hide();
}
|