| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 class SingleClientWalletSyncTest : public SyncTest { | 71 class SingleClientWalletSyncTest : public SyncTest { |
| 72 public: | 72 public: |
| 73 SingleClientWalletSyncTest() : SyncTest(SINGLE_CLIENT) {} | 73 SingleClientWalletSyncTest() : SyncTest(SINGLE_CLIENT) {} |
| 74 ~SingleClientWalletSyncTest() override {} | 74 ~SingleClientWalletSyncTest() override {} |
| 75 | 75 |
| 76 void TriggerSyncCycle() { | 76 void TriggerSyncCycle() { |
| 77 // Note: we use the experiments type here as we want to be able to trigger a | 77 // Note: we use the experiments type here as we want to be able to trigger a |
| 78 // sync cycle even when wallet is not enabled yet. | 78 // sync cycle even when wallet is not enabled yet. |
| 79 const syncer::ModelTypeSet kExperimentsType(syncer::EXPERIMENTS); | 79 const syncer::ModelTypeSet kExperimentsType(syncer::EXPERIMENTS); |
| 80 content::NotificationService::current()->Notify( | 80 TriggerSyncForModelTypes(0, kExperimentsType); |
| 81 chrome::NOTIFICATION_SYNC_REFRESH_LOCAL, | |
| 82 content::Source<Profile>(GetProfile(0)), | |
| 83 content::Details<const syncer::ModelTypeSet>(&kExperimentsType)); | |
| 84 } | 81 } |
| 85 | 82 |
| 86 private: | 83 private: |
| 87 DISALLOW_COPY_AND_ASSIGN(SingleClientWalletSyncTest); | 84 DISALLOW_COPY_AND_ASSIGN(SingleClientWalletSyncTest); |
| 88 }; | 85 }; |
| 89 | 86 |
| 90 // Checker that will wait until an asynchronous Wallet datatype enable event | 87 // Checker that will wait until an asynchronous Wallet datatype enable event |
| 91 // happens, or times out. | 88 // happens, or times out. |
| 92 class WalletEnabledChecker : public SingleClientStatusChangeChecker { | 89 class WalletEnabledChecker : public SingleClientStatusChangeChecker { |
| 93 public: | 90 public: |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 std::vector<autofill::CreditCard*> cards = pdm->GetCreditCards(); | 266 std::vector<autofill::CreditCard*> cards = pdm->GetCreditCards(); |
| 270 ASSERT_EQ(1uL, cards.size()); | 267 ASSERT_EQ(1uL, cards.size()); |
| 271 | 268 |
| 272 // Turn off the wallet autofill pref, the card should be gone as a side | 269 // Turn off the wallet autofill pref, the card should be gone as a side |
| 273 // effect of the wallet data type controller noticing. | 270 // effect of the wallet data type controller noticing. |
| 274 GetProfile(0)->GetPrefs()->SetBoolean( | 271 GetProfile(0)->GetPrefs()->SetBoolean( |
| 275 autofill::prefs::kAutofillWalletImportEnabled, false); | 272 autofill::prefs::kAutofillWalletImportEnabled, false); |
| 276 cards = pdm->GetCreditCards(); | 273 cards = pdm->GetCreditCards(); |
| 277 ASSERT_EQ(0uL, cards.size()); | 274 ASSERT_EQ(0uL, cards.size()); |
| 278 } | 275 } |
| OLD | NEW |