OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "chrome/browser/ui/cocoa/autofill/autofill_overlay_controller.h" | 5 #import "chrome/browser/ui/cocoa/autofill/autofill_overlay_controller.h" |
6 | 6 |
7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
8 #include "chrome/browser/ui/autofill/mock_autofill_dialog_view_delegate.h" | 8 #include "chrome/browser/ui/autofill/mock_autofill_dialog_view_delegate.h" |
9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 base::scoped_nsobject<AutofillOverlayController> controller_; | 26 base::scoped_nsobject<AutofillOverlayController> controller_; |
27 testing::NiceMock<autofill::MockAutofillDialogViewDelegate> delegate_; | 27 testing::NiceMock<autofill::MockAutofillDialogViewDelegate> delegate_; |
28 }; | 28 }; |
29 | 29 |
30 } // namespace | 30 } // namespace |
31 | 31 |
32 TEST_VIEW(AutofillOverlayControllerTest, [controller_ view]) | 32 TEST_VIEW(AutofillOverlayControllerTest, [controller_ view]) |
33 | 33 |
34 TEST_F(AutofillOverlayControllerTest, Subviews) { | 34 TEST_F(AutofillOverlayControllerTest, Subviews) { |
35 NSView* view = [controller_ view]; | 35 NSView* view = [controller_ view]; |
36 ASSERT_EQ(1U, [[view subviews] count]); | 36 EXPECT_TRUE([view isKindOfClass:[NSBox class]]); |
37 | 37 |
38 EXPECT_TRUE([view isKindOfClass:[NSBox class]]); | 38 ASSERT_EQ(2U, [[view subviews] count]); |
39 EXPECT_TRUE([[[view subviews] objectAtIndex:0] isMemberOfClass: | 39 EXPECT_TRUE( |
40 [NSView class]]); | 40 [[[view subviews] objectAtIndex:0] isKindOfClass:[NSView class]]); |
| 41 EXPECT_TRUE( |
| 42 [[[view subviews] objectAtIndex:0] conformsToProtocol: |
| 43 @protocol(AutofillLayout)]); |
| 44 EXPECT_TRUE( |
| 45 [[[view subviews] objectAtIndex:1] isMemberOfClass:[NSImageView class]]); |
41 } | 46 } |
OLD | NEW |