summaryrefslogtreecommitdiffstats
path: root/components/autofill/core
diff options
context:
space:
mode:
authorestade <estade@chromium.org>2015-04-22 07:41:45 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-22 14:42:03 +0000
commit423d45cbeb758ac43ad1456ae76987ba67a196e8 (patch)
tree8aceabdef4da40cb1555fd2ce4b3606d4384f33c /components/autofill/core
parentf6c09395474c82e35afebd2e247f80a6cb17e282 (diff)
downloadchromium_src-423d45cbeb758ac43ad1456ae76987ba67a196e8.zip
chromium_src-423d45cbeb758ac43ad1456ae76987ba67a196e8.tar.gz
chromium_src-423d45cbeb758ac43ad1456ae76987ba67a196e8.tar.bz2
Actually disable Wallet card saving on Linux.
This isn't the ideal solution because I'd like to be able to pass a gyp-time flag to re-enable it (for testing purposes), but it's the smallest patch for merging. BUG=468045 Review URL: https://codereview.chromium.org/1099993002 Cr-Commit-Position: refs/heads/master@{#326296}
Diffstat (limited to 'components/autofill/core')
-rw-r--r--components/autofill/core/browser/BUILD.gn6
-rw-r--r--components/autofill/core/browser/personal_data_manager_unittest.cc21
2 files changed, 23 insertions, 4 deletions
diff --git a/components/autofill/core/browser/BUILD.gn b/components/autofill/core/browser/BUILD.gn
index 17ca7fd..6c2d3d1 100644
--- a/components/autofill/core/browser/BUILD.gn
+++ b/components/autofill/core/browser/BUILD.gn
@@ -120,10 +120,8 @@ static_library("browser") {
]
# Controls whether Wallet cards can be saved to the local instance of chrome.
- if (is_desktop_linux) {
- defines = [ "ENABLE_SAVE_WALLET_CARDS_LOCALLY=0" ]
- } else {
- defines = [ "ENABLE_SAVE_WALLET_CARDS_LOCALLY=1" ]
+ if (!is_desktop_linux) {
+ defines = [ "ENABLE_SAVE_WALLET_CARDS_LOCALLY" ]
}
deps = [
diff --git a/components/autofill/core/browser/personal_data_manager_unittest.cc b/components/autofill/core/browser/personal_data_manager_unittest.cc
index 9771e88..5780908 100644
--- a/components/autofill/core/browser/personal_data_manager_unittest.cc
+++ b/components/autofill/core/browser/personal_data_manager_unittest.cc
@@ -15,6 +15,7 @@
#include "base/prefs/pref_service.h"
#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/waitable_event.h"
+#include "components/autofill/core/browser/autofill_experiments.h"
#include "components/autofill/core/browser/autofill_profile.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/form_structure.h"
@@ -494,6 +495,16 @@ TEST_F(PersonalDataManagerTest, UpdateServerCreditCards) {
base::MessageLoop::current()->Run();
ASSERT_EQ(3U, personal_data_->GetCreditCards().size());
+
+ if (!OfferStoreUnmaskedCards()) {
+ for (CreditCard* card : personal_data_->GetCreditCards()) {
+ EXPECT_EQ(CreditCard::MASKED_SERVER_CARD, card->record_type());
+ }
+ // The rest of this test doesn't work if we're force-masking all unmasked
+ // cards.
+ return;
+ }
+
// The GUIDs will be different, so just compare the data.
for (size_t i = 0; i < 3; ++i)
EXPECT_EQ(0, server_cards[i].Compare(*personal_data_->GetCreditCards()[i]));
@@ -3143,6 +3154,16 @@ TEST_F(PersonalDataManagerTest, UpdateServerCreditCardUsageStats) {
base::MessageLoop::current()->Run();
ASSERT_EQ(3U, personal_data_->GetCreditCards().size());
+
+ if (!OfferStoreUnmaskedCards()) {
+ for (CreditCard* card : personal_data_->GetCreditCards()) {
+ EXPECT_EQ(CreditCard::MASKED_SERVER_CARD, card->record_type());
+ }
+ // The rest of this test doesn't work if we're force-masking all unmasked
+ // cards.
+ return;
+ }
+
// The GUIDs will be different, so just compare the data.
for (size_t i = 0; i < 3; ++i)
EXPECT_EQ(0, server_cards[i].Compare(*personal_data_->GetCreditCards()[i]));