summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/cocoa/autofill/autofill_bubble_controller_unittest.mm
blob: 58a547b5fd6a9fedfe00e1cd8fc90d6fd68dcb59 (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
// Copyright 2013 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.

#import "chrome/browser/ui/cocoa/autofill/autofill_bubble_controller.h"

#import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
#include "chrome/browser/ui/cocoa/run_loop_testing.h"

class AutofillBubbleControllerTest : public CocoaTest {
};

TEST_F(AutofillBubbleControllerTest, ShowAndClose) {
  AutofillBubbleController* controller =
      [[AutofillBubbleController alloc] initWithParentWindow:test_window()
                                                          message:@"test msg"];
  EXPECT_FALSE([[controller window] isVisible]);

  [controller showWindow:nil];
  EXPECT_TRUE([[controller window] isVisible]);

  // Close will self-delete, but all pending messages must be processed so the
  // deallocation happens.
  [controller close];
  chrome::testing::NSRunLoopRunAllPending();
}