Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: chrome/browser/ui/cocoa/autofill/autofill_notification_container_unittest.mm

Issue 21692002: Rename AutofillDialogController to AutofillDialogViewDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_notification_container.h" 5 #import "chrome/browser/ui/cocoa/autofill/autofill_notification_container.h"
6 6
7 #include "base/mac/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" 9 #include "chrome/browser/ui/autofill/autofill_dialog_types.h"
10 #include "chrome/browser/ui/autofill/mock_autofill_dialog_controller.h" 10 #include "chrome/browser/ui/autofill/mock_autofill_dialog_view_delegate.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #import "ui/base/test/ui_cocoa_test_helper.h" 12 #import "ui/base/test/ui_cocoa_test_helper.h"
13 13
14 namespace { 14 namespace {
15 15
16 class AutofillNotificationContainerTest : public ui::CocoaTest { 16 class AutofillNotificationContainerTest : public ui::CocoaTest {
17 public: 17 public:
18 virtual void SetUp() { 18 virtual void SetUp() {
19 CocoaTest::SetUp(); 19 CocoaTest::SetUp();
20 container_.reset([[AutofillNotificationContainer alloc] initWithController: 20 container_.reset([[AutofillNotificationContainer alloc] initWithDelegate:
21 &controller_]); 21 &delegate_]);
22 [[test_window() contentView] addSubview:[container_ view]]; 22 [[test_window() contentView] addSubview:[container_ view]];
23 } 23 }
24 24
25 protected: 25 protected:
26 base::scoped_nsobject<AutofillNotificationContainer> container_; 26 base::scoped_nsobject<AutofillNotificationContainer> container_;
27 testing::NiceMock<autofill::MockAutofillDialogController> controller_; 27 testing::NiceMock<autofill::MockAutofillDialogViewDelegate> delegate_;
28 }; 28 };
29 29
30 } // namespace 30 } // namespace
31 31
32 TEST_VIEW(AutofillNotificationContainerTest, [container_ view]) 32 TEST_VIEW(AutofillNotificationContainerTest, [container_ view])
33 33
34 TEST_F(AutofillNotificationContainerTest, Subviews) { 34 TEST_F(AutofillNotificationContainerTest, Subviews) {
35 // No subviews if there are no notifications. 35 // No subviews if there are no notifications.
36 EXPECT_EQ(0U, [[[container_ view] subviews] count]); 36 EXPECT_EQ(0U, [[[container_ view] subviews] count]);
37 37
(...skipping 13 matching lines...) Expand all
51 autofill::DialogNotification( 51 autofill::DialogNotification(
52 autofill::DialogNotification::REQUIRED_ACTION, 52 autofill::DialogNotification::REQUIRED_ACTION,
53 ASCIIToUTF16("test"))); 53 ASCIIToUTF16("test")));
54 ASSERT_FALSE(notifications[1].HasArrow()); 54 ASSERT_FALSE(notifications[1].HasArrow());
55 [container_ setNotifications:notifications]; 55 [container_ setNotifications:notifications];
56 56
57 EXPECT_EQ(2U, [[[container_ view] subviews] count]); 57 EXPECT_EQ(2U, [[[container_ view] subviews] count]);
58 58
59 // Just to exercise code path. 59 // Just to exercise code path.
60 [container_ performLayout]; 60 [container_ performLayout];
61 } 61 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698