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

Unified Diff: chrome/browser/ui/cocoa/autofill/autofill_section_container_unittest.mm

Issue 14704004: [Autofill] Add Details Section (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/autofill/autofill_section_container_unittest.mm
diff --git a/chrome/browser/ui/cocoa/autofill/autofill_section_container_unittest.mm b/chrome/browser/ui/cocoa/autofill/autofill_section_container_unittest.mm
new file mode 100644
index 0000000000000000000000000000000000000000..1cea428dd0aa1ea2a3be7107968d446f7acd4d99
--- /dev/null
+++ b/chrome/browser/ui/cocoa/autofill/autofill_section_container_unittest.mm
@@ -0,0 +1,51 @@
+// Copyright (c) 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_section_container.h"
+
+#include "base/memory/scoped_nsobject.h"
+#include "chrome/browser/ui/autofill/mock_autofill_dialog_controller.h"
+#import "chrome/browser/ui/cocoa/autofill/autofill_layout_view.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "testing/platform_test.h"
+#import "ui/base/test/ui_cocoa_test_helper.h"
+
+namespace {
+
+class AutofillSectionContainerTest : public ui::CocoaTest {
+ public:
+ virtual void SetUp() {
+ CocoaTest::SetUp();
+ container_.reset(
+ [[AutofillSectionContainer alloc]
+ initWithController:&controller_
+ forSection:autofill::SECTION_CC]);
+ [[test_window() contentView] addSubview:[container_ view]];
+ }
+
+ protected:
+ scoped_nsobject<AutofillSectionContainer> container_;
+ testing::NiceMock<autofill::MockAutofillDialogController> controller_;
+};
+
+} // namespace
+
+TEST_VIEW(AutofillSectionContainerTest, [container_ view])
+
+TEST_F(AutofillSectionContainerTest, HasSubviews) {
+ ASSERT_EQ(2U, [[[container_ view] subviews] count]);
+
+ bool hasLayoutView = false;
+ bool hasTextField = false;
+ for (NSView* view in [[container_ view] subviews]) {
+ if ([view isKindOfClass:[NSTextField class]]) {
+ hasTextField = true;
+ } else if ([view isKindOfClass:[AutofillLayoutView class]]) {
+ hasLayoutView = true;
+ }
+ }
+
+ EXPECT_TRUE(hasLayoutView);
+ EXPECT_TRUE(hasTextField);
+}

Powered by Google App Engine
This is Rietveld 408576698