Index: chrome/browser/chromeos/brightness_bubble_browsertest.cc |
diff --git a/chrome/browser/chromeos/brightness_bubble_browsertest.cc b/chrome/browser/chromeos/brightness_bubble_browsertest.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..519f2f23bb6096da9d3e93e5690a3950bb49e59d |
--- /dev/null |
+++ b/chrome/browser/chromeos/brightness_bubble_browsertest.cc |
@@ -0,0 +1,34 @@ |
+// Copyright (c) 2011 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/message_loop.h" |
+#include "chrome/browser/chromeos/brightness_bubble.h" |
+#include "chrome/browser/chromeos/setting_level_bubble_view.h" |
+#include "chrome/test/base/in_process_browser_test.h" |
+#include "third_party/skia/include/core/SkBitmap.h" |
msw
2011/10/26 18:51:42
What is the SkBitmap include used for?
alicet1
2011/10/27 00:34:51
removed.
|
+#include "views/view.h" |
+ |
+typedef InProcessBrowserTest BrightnessBubbleTest; |
+ |
+namespace chromeos { |
+ |
+IN_PROC_BROWSER_TEST_F(BrightnessBubbleTest, UpdateWithoutShowing) { |
+ BrightnessBubble* bubble = BrightnessBubble::GetInstance(); |
+ bubble->UpdateWithoutShowingBubble(20, false); |
+ EXPECT_FALSE(bubble->view_ != NULL); |
msw
2011/10/26 18:51:42
Use EXPECT_EQ and EXPECT_NE for several checks in
alicet1
2011/10/27 00:34:51
Done. see response in setting_level_bubble_browser
|
+ EXPECT_EQ(20, bubble->current_percent_); |
+ bubble->UpdateWithoutShowingBubble(30, false); |
+ EXPECT_FALSE(bubble->view_ != NULL); |
+ EXPECT_EQ(20, bubble->current_percent_); |
+ EXPECT_EQ(30, bubble->target_percent_); |
+ bubble->UpdateWithoutShowingBubble(40, false); |
+ EXPECT_FALSE(bubble->view_ != NULL); |
+ EXPECT_EQ(40, bubble->target_percent_); |
+ bubble->ShowBubble(50, true); |
+ EXPECT_TRUE(bubble->view_->GetWidget()->IsVisible()); |
+ EXPECT_EQ(50, bubble->target_percent_); |
+ MessageLoop::current()->RunAllPending(); |
+} |
+ |
+} // namespace chromeos |