| 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_section_container.h" | 5 #import "chrome/browser/ui/cocoa/autofill/autofill_section_container.h" |
| 6 | 6 |
| 7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
| 8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" | 10 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" |
| 11 #include "chrome/browser/ui/autofill/mock_autofill_dialog_view_delegate.h" | 11 #include "chrome/browser/ui/autofill/mock_autofill_dialog_view_delegate.h" |
| 12 #import "chrome/browser/ui/cocoa/autofill/autofill_input_field.h" | 12 #import "chrome/browser/ui/cocoa/autofill/autofill_input_field.h" |
| 13 #import "chrome/browser/ui/cocoa/autofill/layout_view.h" | 13 #import "chrome/browser/ui/cocoa/autofill/layout_view.h" |
| 14 #import "chrome/browser/ui/cocoa/menu_button.h" | 14 #import "chrome/browser/ui/cocoa/menu_button.h" |
| 15 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "testing/gtest_mac.h" | 17 #include "testing/gtest_mac.h" |
| 18 #include "testing/platform_test.h" | 18 #include "testing/platform_test.h" |
| 19 #include "ui/base/models/combobox_model.h" | 19 #include "ui/base/models/combobox_model.h" |
| 20 #include "ui/base/models/simple_menu_model.h" | 20 #include "ui/base/models/simple_menu_model.h" |
| 21 #import "ui/base/test/ui_cocoa_test_helper.h" | 21 #import "ui/base/test/ui_cocoa_test_helper.h" |
| 22 | 22 |
| 23 using base::ASCIIToUTF16; |
| 24 |
| 23 namespace { | 25 namespace { |
| 24 | 26 |
| 25 class AutofillSectionContainerTest : public ui::CocoaTest { | 27 class AutofillSectionContainerTest : public ui::CocoaTest { |
| 26 public: | 28 public: |
| 27 AutofillSectionContainerTest() : section_(autofill::SECTION_BILLING) {} | 29 AutofillSectionContainerTest() : section_(autofill::SECTION_BILLING) {} |
| 28 virtual void SetUp() { | 30 virtual void SetUp() { |
| 29 CocoaTest::SetUp(); | 31 CocoaTest::SetUp(); |
| 30 ResetContainer(); | 32 ResetContainer(); |
| 31 } | 33 } |
| 32 | 34 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 EXPECT_TRUE([field invalid]); | 248 EXPECT_TRUE([field invalid]); |
| 247 field = [container_ getField:CREDIT_CARD_EXP_MONTH]; | 249 field = [container_ getField:CREDIT_CARD_EXP_MONTH]; |
| 248 EXPECT_FALSE([field invalid]); | 250 EXPECT_FALSE([field invalid]); |
| 249 | 251 |
| 250 [container_ validateFor:VALIDATE_FINAL]; | 252 [container_ validateFor:VALIDATE_FINAL]; |
| 251 field = [container_ getField:EMAIL_ADDRESS]; | 253 field = [container_ getField:EMAIL_ADDRESS]; |
| 252 EXPECT_FALSE([field invalid]); | 254 EXPECT_FALSE([field invalid]); |
| 253 field = [container_ getField:CREDIT_CARD_EXP_MONTH]; | 255 field = [container_ getField:CREDIT_CARD_EXP_MONTH]; |
| 254 EXPECT_TRUE([field invalid]); | 256 EXPECT_TRUE([field invalid]); |
| 255 } | 257 } |
| OLD | NEW |