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 2152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2163 TEST_F(AutofillDialogControllerTest, NotProdNotification) { | 2163 TEST_F(AutofillDialogControllerTest, NotProdNotification) { |
2164 // To make IsPayingWithWallet() true. | 2164 // To make IsPayingWithWallet() true. |
2165 controller()->OnDidGetWalletItems( | 2165 controller()->OnDidGetWalletItems( |
2166 wallet::GetTestWalletItems(wallet::AMEX_DISALLOWED)); | 2166 wallet::GetTestWalletItems(wallet::AMEX_DISALLOWED)); |
2167 | 2167 |
2168 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 2168 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
2169 ASSERT_EQ( | 2169 ASSERT_EQ( |
2170 "", | 2170 "", |
2171 command_line->GetSwitchValueASCII(switches::kWalletServiceUseSandbox)); | 2171 command_line->GetSwitchValueASCII(switches::kWalletServiceUseSandbox)); |
2172 | 2172 |
2173 #if defined(OS_MACOSX) | 2173 // Default everywhere is to use prod (no warning). |
2174 // Default on Mac is to use sandbox (which shows a warning). | |
2175 EXPECT_EQ(1U, | |
2176 NotificationsOfType(DialogNotification::DEVELOPER_WARNING).size()); | |
2177 #else | |
2178 // Default everywhere else is to use prod (no warning). | |
2179 EXPECT_EQ(0U, | 2174 EXPECT_EQ(0U, |
2180 NotificationsOfType(DialogNotification::DEVELOPER_WARNING).size()); | 2175 NotificationsOfType(DialogNotification::DEVELOPER_WARNING).size()); |
2181 #endif | |
2182 | 2176 |
2183 command_line->AppendSwitchASCII(switches::kWalletServiceUseSandbox, "1"); | 2177 command_line->AppendSwitchASCII(switches::kWalletServiceUseSandbox, "1"); |
2184 EXPECT_EQ(1U, | 2178 EXPECT_EQ(1U, |
2185 NotificationsOfType(DialogNotification::DEVELOPER_WARNING).size()); | 2179 NotificationsOfType(DialogNotification::DEVELOPER_WARNING).size()); |
2186 } | 2180 } |
2187 | 2181 |
2188 // Ensure Wallet instruments marked expired by the server are shown as invalid. | 2182 // Ensure Wallet instruments marked expired by the server are shown as invalid. |
2189 TEST_F(AutofillDialogControllerTest, WalletExpiredCard) { | 2183 TEST_F(AutofillDialogControllerTest, WalletExpiredCard) { |
2190 scoped_ptr<wallet::WalletItems> wallet_items = | 2184 scoped_ptr<wallet::WalletItems> wallet_items = |
2191 wallet::GetTestWalletItems(wallet::AMEX_DISALLOWED); | 2185 wallet::GetTestWalletItems(wallet::AMEX_DISALLOWED); |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2698 controller()->OnDidGetWalletItems( | 2692 controller()->OnDidGetWalletItems( |
2699 wallet::GetTestWalletItemsWithRequiredAction( | 2693 wallet::GetTestWalletItemsWithRequiredAction( |
2700 wallet::PASSIVE_GAIA_AUTH)); | 2694 wallet::PASSIVE_GAIA_AUTH)); |
2701 EXPECT_TRUE(controller()->ShouldShowSpinner()); | 2695 EXPECT_TRUE(controller()->ShouldShowSpinner()); |
2702 controller()->OnPassiveSigninFailure(GoogleServiceAuthError( | 2696 controller()->OnPassiveSigninFailure(GoogleServiceAuthError( |
2703 GoogleServiceAuthError::NONE)); | 2697 GoogleServiceAuthError::NONE)); |
2704 EXPECT_FALSE(controller()->ShouldShowSpinner()); | 2698 EXPECT_FALSE(controller()->ShouldShowSpinner()); |
2705 } | 2699 } |
2706 | 2700 |
2707 } // namespace autofill | 2701 } // namespace autofill |
OLD | NEW |