summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/volume_bubble_browsertest.cc
blob: 3c3d371b9213c53e61eb770d1d0d87c6339e5291 (plain)
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
// 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 "chrome/browser/chromeos/setting_level_bubble_view.h"
#include "chrome/browser/chromeos/volume_bubble.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "ui/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);
  EXPECT_TRUE(bubble1->view_->visible());
  views::View* saved_view = bubble1->view_;
  bubble1->HideBubble();
  EXPECT_EQ(NULL, bubble1->view_);
  bubble1->ShowBubble(20, true);
  EXPECT_TRUE(bubble1->view_ != NULL);
  EXPECT_NE(saved_view, bubble1->view_);
}

}  // namespace chromeos