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

Unified Diff: chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc

Issue 1785923010: Remove kAutofillWalletSyncExperimentEnabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mark wallet_sync as obsolete, remove wallet_sync_enabled. Created 4 years, 9 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc
diff --git a/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc b/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc
index d2ad62fdba7ba1f6617e41805d13f084d4fd49ee..14f443771aa988b64b9a6649017def59cae6647e 100644
--- a/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc
@@ -29,13 +29,6 @@ using sync_integration_test_util::AwaitCommitActivityCompletion;
namespace {
-// Setting the Preferences files contents to this string (before Profile is
-// created) will bypass the Sync experiment logic for enabling this feature.
-const char kWalletSyncEnabledPreferencesContents[] =
- "{\"autofill\": { \"wallet_import_sync_experiment_enabled\": true } }";
-
-const char kWalletSyncExperimentTag[] = "wallet_sync";
-
const char kDefaultCardID[] = "wallet entity ID";
const int kDefaultCardExpMonth = 8;
const int kDefaultCardExpYear = 2087;
@@ -73,13 +66,6 @@ class SingleClientWalletSyncTest : public SyncTest {
SingleClientWalletSyncTest() : SyncTest(SINGLE_CLIENT) {}
~SingleClientWalletSyncTest() override {}
- void TriggerSyncCycle() {
- // Note: we use the experiments type here as we want to be able to trigger a
- // sync cycle even when wallet is not enabled yet.
- const syncer::ModelTypeSet kExperimentsType(syncer::EXPERIMENTS);
- TriggerSyncForModelTypes(0, kExperimentsType);
- }
-
private:
DISALLOW_COPY_AND_ASSIGN(SingleClientWalletSyncTest);
};
@@ -120,19 +106,8 @@ class WalletDisabledChecker : public SingleClientStatusChangeChecker {
}
};
-IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest, DisabledByDefault) {
- ASSERT_TRUE(SetupSync()) << "SetupSync() failed";
- // The type should not be enabled without the experiment enabled.
- ASSERT_FALSE(GetClient(0)->service()->GetActiveDataTypes().Has(
- syncer::AUTOFILL_WALLET_DATA));
- ASSERT_FALSE(GetClient(0)->service()->GetActiveDataTypes().Has(
- syncer::AUTOFILL_WALLET_METADATA));
-}
-
-IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest, EnabledViaPreference) {
- SetPreexistingPreferencesFileContents(kWalletSyncEnabledPreferencesContents);
+IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest, EnabledByDefault) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed";
- // The type should not be enabled without the experiment enabled.
ASSERT_TRUE(GetClient(0)->service()->GetActiveDataTypes().Has(
syncer::AUTOFILL_WALLET_DATA));
// TODO(pvalenzuela): Assert that the local root node for AUTOFILL_WALLET_DATA
@@ -141,71 +116,7 @@ IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest, EnabledViaPreference) {
syncer::AUTOFILL_WALLET_METADATA));
}
-// Tests that an experiment received at sync startup time (during sign-in)
-// enables the wallet datatype.
-IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest,
- EnabledViaExperimentStartup) {
- sync_pb::EntitySpecifics experiment_entity;
- sync_pb::ExperimentsSpecifics* experiment_specifics =
- experiment_entity.mutable_experiments();
- experiment_specifics->mutable_wallet_sync()->set_enabled(true);
- GetFakeServer()->InjectEntity(
- fake_server::UniqueClientEntity::CreateForInjection(
- kWalletSyncExperimentTag,
- experiment_entity));
-
- ASSERT_TRUE(SetupSync()) << "SetupSync() failed";
- ASSERT_TRUE(GetClient(0)->service()->GetActiveDataTypes().Has(
- syncer::AUTOFILL_WALLET_DATA));
- ASSERT_TRUE(GetClient(0)->service()->GetActiveDataTypes().Has(
- syncer::AUTOFILL_WALLET_METADATA));
-}
-
-// Tests receiving an enable experiment at runtime, followed by a disabled
-// experiment, and verifies the datatype is enabled/disabled as necessary.
-IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest,
- EnabledDisabledViaExperiment) {
- ASSERT_TRUE(SetupSync()) << "SetupSync() failed";
- ASSERT_FALSE(GetClient(0)->service()->GetActiveDataTypes().
- Has(syncer::AUTOFILL_WALLET_DATA));
-
- sync_pb::EntitySpecifics experiment_entity;
- sync_pb::ExperimentsSpecifics* experiment_specifics =
- experiment_entity.mutable_experiments();
-
- // First enable the experiment.
- experiment_specifics->mutable_wallet_sync()->set_enabled(true);
- GetFakeServer()->InjectEntity(
- fake_server::UniqueClientEntity::CreateForInjection(
- kWalletSyncExperimentTag, experiment_entity));
- TriggerSyncCycle();
-
- WalletEnabledChecker enabled_checker;
- enabled_checker.Wait();
- ASSERT_FALSE(enabled_checker.TimedOut());
- ASSERT_TRUE(GetClient(0)->service()->GetActiveDataTypes().Has(
- syncer::AUTOFILL_WALLET_DATA));
- ASSERT_TRUE(GetClient(0)->service()->GetActiveDataTypes().Has(
- syncer::AUTOFILL_WALLET_METADATA));
-
- // Then disable the experiment.
- experiment_specifics->mutable_wallet_sync()->set_enabled(false);
- GetFakeServer()->InjectEntity(
- fake_server::UniqueClientEntity::CreateForInjection(
- kWalletSyncExperimentTag, experiment_entity));
- TriggerSyncCycle();
-
- WalletDisabledChecker disable_checker;
- disable_checker.Wait();
- ASSERT_FALSE(disable_checker.TimedOut());
- ASSERT_FALSE(GetClient(0)->service()->GetActiveDataTypes().
- Has(syncer::AUTOFILL_WALLET_DATA));
- ASSERT_FALSE(GetClient(0)->service()->GetActiveDataTypes().Has(
- syncer::AUTOFILL_WALLET_METADATA));
-}
-
IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest, Download) {
- SetPreexistingPreferencesFileContents(kWalletSyncEnabledPreferencesContents);
AddDefaultCard(GetFakeServer());
ASSERT_TRUE(SetupSync()) << "SetupSync() failed";
@@ -227,7 +138,6 @@ IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest, Download) {
// Wallet data should get cleared from the database when sync is disabled.
IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest, ClearOnDisableSync) {
- SetPreexistingPreferencesFileContents(kWalletSyncEnabledPreferencesContents);
AddDefaultCard(GetFakeServer());
ASSERT_TRUE(SetupSync()) << "SetupSync() failed";
@@ -246,7 +156,6 @@ IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest, ClearOnDisableSync) {
// Wallet data should get cleared from the database when the wallet sync type
// flag is disabled.
IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest, ClearOnDisableWalletSync) {
- SetPreexistingPreferencesFileContents(kWalletSyncEnabledPreferencesContents);
AddDefaultCard(GetFakeServer());
ASSERT_TRUE(SetupSync()) << "SetupSync() failed";
@@ -266,7 +175,6 @@ IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest, ClearOnDisableWalletSync) {
// integration flag is disabled.
IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest,
ClearOnDisableWalletAutofill) {
- SetPreexistingPreferencesFileContents(kWalletSyncEnabledPreferencesContents);
AddDefaultCard(GetFakeServer());
ASSERT_TRUE(SetupSync()) << "SetupSync() failed";
« no previous file with comments | « chrome/browser/autofill/options_util.cc ('k') | chrome/browser/ui/webui/options/autofill_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698