Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / autofill / autofill_bubble_controller_unittest.mm
blob58a547b5fd6a9fedfe00e1cd8fc90d6fd68dcb59
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()
16                                                           message:@"test msg"];
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.
24   [controller close];
25   chrome::testing::NSRunLoopRunAllPending();