Chromium Code Reviews| Index: chrome/browser/chromeos/volume_bubble_browsertest.cc |
| diff --git a/chrome/browser/chromeos/volume_bubble_browsertest.cc b/chrome/browser/chromeos/volume_bubble_browsertest.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e53a77951eada254689647c43d0aa38b339bd8d6 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/volume_bubble_browsertest.cc |
| @@ -0,0 +1,32 @@ |
| +// 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/volume_bubble.h" |
| +#include "chrome/test/base/in_process_browser_test.h" |
| +#include "chrome/browser/chromeos/setting_level_bubble_view.h" |
| +#include "third_party/skia/include/core/SkBitmap.h" |
|
msw
2011/10/26 18:51:42
Is SkBitmap needed here?
Please keep includes to w
alicet1
2011/10/27 00:34:51
Done.
|
| +#include "views/view.h" |
| + |
| +typedef InProcessBrowserTest VolumeBubbleTest; |
| + |
| +namespace chromeos { |
| + |
| +IN_PROC_BROWSER_TEST_F(VolumeBubbleTest, GetInstanceAndShow) { |
| + VolumeBubble* bubble1 = VolumeBubble::GetInstance(); |
| + VolumeBubble* bubble2 = VolumeBubble::GetInstance(); |
| + ASSERT_EQ(bubble1, bubble2); |
| + |
| + bubble1->ShowBubble(20, true); |
| + EXPECT_TRUE(bubble1->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_TRUE(bubble1->view_->IsVisible()); |
| + views::View* saved_view = bubble1->view_; |
| + bubble1->HideBubble(); |
| + EXPECT_TRUE(bubble1->view_ == NULL); |
| + bubble1->ShowBubble(20, true); |
| + EXPECT_TRUE(bubble1->view_ != NULL); |
| + EXPECT_FALSE(bubble1->view_ == saved_view); |
|
msw
2011/10/26 18:51:42
EXPECT_NE
alicet1
2011/10/27 00:34:51
Done.
|
| +} |
| + |
| +} // namespace chromeos |