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

Side by Side Diff: chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc

Issue 816403003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years 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
OLDNEW
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 #include <utility> 6 #include <utility>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 2510 matching lines...) Expand 10 before | Expand all | Expand 10 after
2521 controller()->OnDidGetFullWallet(wallet::GetTestFullWalletInstrumentOnly()); 2521 controller()->OnDidGetFullWallet(wallet::GetTestFullWalletInstrumentOnly());
2522 controller()->ForceFinishSubmit(); 2522 controller()->ForceFinishSubmit();
2523 EXPECT_TRUE(form_structure()); 2523 EXPECT_TRUE(form_structure());
2524 } 2524 }
2525 2525
2526 TEST_F(AutofillDialogControllerTest, NotProdNotification) { 2526 TEST_F(AutofillDialogControllerTest, NotProdNotification) {
2527 // To make IsPayingWithWallet() true. 2527 // To make IsPayingWithWallet() true.
2528 controller()->OnDidGetWalletItems( 2528 controller()->OnDidGetWalletItems(
2529 wallet::GetTestWalletItems(wallet::AMEX_DISALLOWED)); 2529 wallet::GetTestWalletItems(wallet::AMEX_DISALLOWED));
2530 2530
2531 CommandLine* command_line = CommandLine::ForCurrentProcess(); 2531 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
2532 ASSERT_EQ( 2532 ASSERT_EQ(
2533 "", 2533 "",
2534 command_line->GetSwitchValueASCII(switches::kWalletServiceUseSandbox)); 2534 command_line->GetSwitchValueASCII(switches::kWalletServiceUseSandbox));
2535 2535
2536 command_line->AppendSwitchASCII(switches::kWalletServiceUseSandbox, "1"); 2536 command_line->AppendSwitchASCII(switches::kWalletServiceUseSandbox, "1");
2537 EXPECT_EQ(1U, 2537 EXPECT_EQ(1U,
2538 NotificationsOfType(DialogNotification::DEVELOPER_WARNING).size()); 2538 NotificationsOfType(DialogNotification::DEVELOPER_WARNING).size());
2539 } 2539 }
2540 2540
2541 TEST_F(AutofillDialogControllerTest, NoNotProdNotification) { 2541 TEST_F(AutofillDialogControllerTest, NoNotProdNotification) {
2542 // To make IsPayingWithWallet() true. 2542 // To make IsPayingWithWallet() true.
2543 controller()->OnDidGetWalletItems( 2543 controller()->OnDidGetWalletItems(
2544 wallet::GetTestWalletItems(wallet::AMEX_DISALLOWED)); 2544 wallet::GetTestWalletItems(wallet::AMEX_DISALLOWED));
2545 2545
2546 CommandLine* command_line = CommandLine::ForCurrentProcess(); 2546 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
2547 ASSERT_EQ( 2547 ASSERT_EQ(
2548 "", 2548 "",
2549 command_line->GetSwitchValueASCII(switches::kWalletServiceUseSandbox)); 2549 command_line->GetSwitchValueASCII(switches::kWalletServiceUseSandbox));
2550 2550
2551 command_line->AppendSwitchASCII(switches::kWalletServiceUseSandbox, "0"); 2551 command_line->AppendSwitchASCII(switches::kWalletServiceUseSandbox, "0");
2552 EXPECT_EQ(0U, 2552 EXPECT_EQ(0U,
2553 NotificationsOfType(DialogNotification::DEVELOPER_WARNING).size()); 2553 NotificationsOfType(DialogNotification::DEVELOPER_WARNING).size());
2554 } 2554 }
2555 2555
2556 // Ensure Wallet instruments marked expired by the server are shown as invalid. 2556 // Ensure Wallet instruments marked expired by the server are shown as invalid.
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after
3647 EXPECT_EQ(ASCIIToUTF16("United States"), form_structure()->field(2)->value); 3647 EXPECT_EQ(ASCIIToUTF16("United States"), form_structure()->field(2)->value);
3648 EXPECT_EQ(ADDRESS_HOME_COUNTRY, 3648 EXPECT_EQ(ADDRESS_HOME_COUNTRY,
3649 form_structure()->field(3)->Type().GetStorableType()); 3649 form_structure()->field(3)->Type().GetStorableType());
3650 EXPECT_EQ(ASCIIToUTF16("US"), form_structure()->field(3)->value); 3650 EXPECT_EQ(ASCIIToUTF16("US"), form_structure()->field(3)->value);
3651 EXPECT_EQ(ADDRESS_HOME_COUNTRY, 3651 EXPECT_EQ(ADDRESS_HOME_COUNTRY,
3652 form_structure()->field(4)->Type().GetStorableType()); 3652 form_structure()->field(4)->Type().GetStorableType());
3653 EXPECT_EQ(ASCIIToUTF16("United States"), form_structure()->field(4)->value); 3653 EXPECT_EQ(ASCIIToUTF16("United States"), form_structure()->field(4)->value);
3654 } 3654 }
3655 3655
3656 } // namespace autofill 3656 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698