1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #import "chrome/browser/ui/cocoa/autofill/autofill_bubble_controller.h"
7 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
8 #include "chrome/browser/ui/cocoa/run_loop_testing.h"
10 class AutofillBubbleControllerTest : public CocoaTest {
13 TEST_F(AutofillBubbleControllerTest, ShowAndClose) {
14 AutofillBubbleController* controller =
15 [[AutofillBubbleController alloc] initWithParentWindow:test_window()
17 EXPECT_FALSE([[controller window] isVisible]);
19 [controller showWindow:nil];
20 EXPECT_TRUE([[controller window] isVisible]);
22 // Close will self-delete, but all pending messages must be processed so the
23 // deallocation happens.
25 chrome::testing::NSRunLoopRunAllPending();