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_pop_up_button.h"
7 #import "base/mac/scoped_nsobject.h"
8 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "testing/platform_test.h"
12 class AutofillPopUpButtonTest : public CocoaTest {
14 AutofillPopUpButtonTest() {
15 NSRect frame = NSMakeRect(0, 0, 50, 30);
16 button_.reset([[AutofillPopUpButton alloc] initWithFrame:frame]);
18 [[test_window() contentView] addSubview:button_];
22 base::scoped_nsobject<AutofillPopUpButton> button_;
24 DISALLOW_COPY_AND_ASSIGN(AutofillPopUpButtonTest);
27 TEST_VIEW(AutofillPopUpButtonTest, button_)
29 // Test invalid, mostly to ensure nothing leaks or crashes.
30 TEST_F(AutofillPopUpButtonTest, DisplayWithInvalid) {
31 [button_ setValidityMessage:nil];
33 [button_ setValidityMessage:@"Something is rotten in the state of Denmark"];