| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <map> | 5 #include <map> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/guid.h" | 9 #include "base/guid.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 2445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2456 EXPECT_FALSE(controller()->ShouldShowSpinner()); | 2456 EXPECT_FALSE(controller()->ShouldShowSpinner()); |
| 2457 EXPECT_FALSE(controller()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); | 2457 EXPECT_FALSE(controller()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); |
| 2458 | 2458 |
| 2459 // End the submit button delay. | 2459 // End the submit button delay. |
| 2460 controller()->SimulateSubmitButtonDelayEnd(); | 2460 controller()->SimulateSubmitButtonDelayEnd(); |
| 2461 | 2461 |
| 2462 EXPECT_FALSE(controller()->ShouldShowSpinner()); | 2462 EXPECT_FALSE(controller()->ShouldShowSpinner()); |
| 2463 EXPECT_TRUE(controller()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); | 2463 EXPECT_TRUE(controller()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); |
| 2464 } | 2464 } |
| 2465 | 2465 |
| 2466 TEST_F(AutofillDialogControllerTest, IconDependentField) { |
| 2467 EXPECT_TRUE( |
| 2468 controller()->IsIconDependentField(CREDIT_CARD_VERIFICATION_CODE)); |
| 2469 EXPECT_FALSE(controller()->IsIconDependentField(CREDIT_CARD_NUMBER)); |
| 2470 EXPECT_FALSE(controller()->IsIconDependentField(CREDIT_CARD_NAME)); |
| 2471 EXPECT_FALSE(controller()->IsIconDependentField(NAME_BILLING_FULL)); |
| 2472 } |
| 2473 |
| 2474 TEST_F(AutofillDialogControllerTest, IconDependencyField) { |
| 2475 ServerFieldType dependent_type = UNKNOWN_TYPE; |
| 2476 EXPECT_TRUE( |
| 2477 controller()->IsIconDependencyField(CREDIT_CARD_NUMBER, &dependent_type)); |
| 2478 EXPECT_EQ(CREDIT_CARD_VERIFICATION_CODE, dependent_type); |
| 2479 dependent_type = UNKNOWN_TYPE; |
| 2480 |
| 2481 EXPECT_FALSE(controller()->IsIconDependencyField( |
| 2482 CREDIT_CARD_VERIFICATION_CODE, &dependent_type)); |
| 2483 EXPECT_EQ(UNKNOWN_TYPE, dependent_type); |
| 2484 |
| 2485 EXPECT_FALSE( |
| 2486 controller()->IsIconDependencyField(CREDIT_CARD_NAME, &dependent_type)); |
| 2487 EXPECT_EQ(UNKNOWN_TYPE, dependent_type); |
| 2488 |
| 2489 EXPECT_FALSE( |
| 2490 controller()->IsIconDependencyField(NAME_BILLING_FULL, &dependent_type)); |
| 2491 EXPECT_EQ(UNKNOWN_TYPE, dependent_type); |
| 2492 } |
| 2493 |
| 2466 } // namespace autofill | 2494 } // namespace autofill |
| OLD | NEW |