OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "chrome/browser/chromeos/brightness_bubble.h" | 6 #include "chrome/browser/chromeos/brightness_bubble.h" |
7 #include "chrome/browser/chromeos/setting_level_bubble_view.h" | 7 #include "chrome/browser/chromeos/setting_level_bubble_view.h" |
8 #include "chrome/test/base/in_process_browser_test.h" | 8 #include "chrome/test/base/in_process_browser_test.h" |
9 #include "views/view.h" | 9 #include "ui/views/view.h" |
10 | 10 |
11 typedef InProcessBrowserTest BrightnessBubbleTest; | 11 typedef InProcessBrowserTest BrightnessBubbleTest; |
12 | 12 |
13 namespace chromeos { | 13 namespace chromeos { |
14 | 14 |
15 IN_PROC_BROWSER_TEST_F(BrightnessBubbleTest, UpdateWithoutShowing) { | 15 IN_PROC_BROWSER_TEST_F(BrightnessBubbleTest, UpdateWithoutShowing) { |
16 BrightnessBubble* bubble = BrightnessBubble::GetInstance(); | 16 BrightnessBubble* bubble = BrightnessBubble::GetInstance(); |
17 bubble->UpdateWithoutShowingBubble(20, false); | 17 bubble->UpdateWithoutShowingBubble(20, false); |
18 EXPECT_EQ(NULL, bubble->view_); | 18 EXPECT_EQ(NULL, bubble->view_); |
19 EXPECT_EQ(20, bubble->current_percent_); | 19 EXPECT_EQ(20, bubble->current_percent_); |
20 bubble->UpdateWithoutShowingBubble(30, false); | 20 bubble->UpdateWithoutShowingBubble(30, false); |
21 EXPECT_EQ(NULL, bubble->view_); | 21 EXPECT_EQ(NULL, bubble->view_); |
22 EXPECT_EQ(20, bubble->current_percent_); | 22 EXPECT_EQ(20, bubble->current_percent_); |
23 EXPECT_EQ(30, bubble->target_percent_); | 23 EXPECT_EQ(30, bubble->target_percent_); |
24 bubble->UpdateWithoutShowingBubble(40, false); | 24 bubble->UpdateWithoutShowingBubble(40, false); |
25 EXPECT_EQ(NULL, bubble->view_); | 25 EXPECT_EQ(NULL, bubble->view_); |
26 EXPECT_EQ(40, bubble->target_percent_); | 26 EXPECT_EQ(40, bubble->target_percent_); |
27 bubble->ShowBubble(50, true); | 27 bubble->ShowBubble(50, true); |
28 EXPECT_TRUE(bubble->view_->GetWidget()->IsVisible()); | 28 EXPECT_TRUE(bubble->view_->GetWidget()->IsVisible()); |
29 EXPECT_EQ(50, bubble->target_percent_); | 29 EXPECT_EQ(50, bubble->target_percent_); |
30 MessageLoop::current()->RunAllPending(); | 30 MessageLoop::current()->RunAllPending(); |
31 } | 31 } |
32 | 32 |
33 } // namespace chromeos | 33 } // namespace chromeos |
OLD | NEW |