This source file includes following definitions.
- TEST_F
#include "chrome/browser/ui/views/confirm_bubble_views.h"
#include "chrome/browser/ui/confirm_bubble.h"
#include "chrome/browser/ui/test/test_confirm_bubble_model.h"
#include "chrome/browser/ui/views/constrained_window_views.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/views/test/views_test_base.h"
#include "ui/views/widget/widget.h"
using views::Widget;
typedef views::ViewsTestBase ConfirmBubbleViewsTest;
TEST_F(ConfirmBubbleViewsTest, CreateAndClose) {
Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_WINDOW);
params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
scoped_ptr<views::Widget> parent_widget(new Widget);
parent_widget->Init(params);
parent_widget->Show();
bool model_deleted = false;
TestConfirmBubbleModel* model =
new TestConfirmBubbleModel(&model_deleted, NULL, NULL, NULL);
ConfirmBubbleViews* bubble = new ConfirmBubbleViews(model);
gfx::NativeView parent = parent_widget->GetNativeView();
CreateBrowserModalDialogViews(bubble, parent)->Show();
bubble->GetWidget()->CloseNow();
parent_widget->CloseNow();
EXPECT_TRUE(model_deleted);
}