OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_details_container.h" | 5 #import "chrome/browser/ui/cocoa/autofill/autofill_details_container.h" |
6 | 6 |
7 #include "base/memory/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
8 #include "chrome/browser/ui/autofill/mock_autofill_dialog_controller.h" | 8 #include "chrome/browser/ui/autofill/mock_autofill_dialog_controller.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "testing/platform_test.h" | 10 #include "testing/platform_test.h" |
11 #import "ui/base/test/ui_cocoa_test_helper.h" | 11 #import "ui/base/test/ui_cocoa_test_helper.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 class AutofillDetailsContainerTest : public ui::CocoaTest { | 15 class AutofillDetailsContainerTest : public ui::CocoaTest { |
16 public: | 16 public: |
17 AutofillDetailsContainerTest() { | 17 AutofillDetailsContainerTest() { |
18 container_.reset([[AutofillDetailsContainer alloc] initWithController: | 18 container_.reset([[AutofillDetailsContainer alloc] initWithController: |
19 &controller_]); | 19 &controller_]); |
20 [[test_window() contentView] addSubview:[container_ view]]; | 20 [[test_window() contentView] addSubview:[container_ view]]; |
21 } | 21 } |
22 | 22 |
23 protected: | 23 protected: |
24 scoped_nsobject<AutofillDetailsContainer> container_; | 24 base::scoped_nsobject<AutofillDetailsContainer> container_; |
25 testing::NiceMock<autofill::MockAutofillDialogController> controller_; | 25 testing::NiceMock<autofill::MockAutofillDialogController> controller_; |
26 }; | 26 }; |
27 | 27 |
28 } // namespace | 28 } // namespace |
29 | 29 |
30 TEST_VIEW(AutofillDetailsContainerTest, [container_ view]) | 30 TEST_VIEW(AutofillDetailsContainerTest, [container_ view]) |
31 | 31 |
32 TEST_F(AutofillDetailsContainerTest, BasicProperties) { | 32 TEST_F(AutofillDetailsContainerTest, BasicProperties) { |
33 EXPECT_GT([[[container_ view] subviews] count], 0U); | 33 EXPECT_GT([[[container_ view] subviews] count], 0U); |
34 EXPECT_GT(NSHeight([[container_ view] frame]), 0); | 34 EXPECT_GT(NSHeight([[container_ view] frame]), 0); |
35 EXPECT_GT(NSWidth([[container_ view] frame]), 0); | 35 EXPECT_GT(NSWidth([[container_ view] frame]), 0); |
36 } | 36 } |
OLD | NEW |