diff --git a/common/brave_switches.cc b/common/brave_switches.cc index 05d15cec9243..1e28eca14dc3 100644 --- a/common/brave_switches.cc +++ b/common/brave_switches.cc @@ -29,8 +29,9 @@ const char kDisableTorClientUpdaterExtension[] = "disable-tor-client-updater-ext // Allows disabling the WebTorrent extension. const char kDisableWebTorrentExtension[] = "disable-webtorrent-extension"; -// Allows disabling Brave Sync. -const char kDisableBraveSync[] = "disable-brave-sync"; +// Enables Brave Sync. For now it is targeted to staging for QA tests, so +// is disabled by default for a while. +const char kEnableBraveSync[] = "enable-brave-sync"; // Contains all flags that we use for rewards const char kRewards[] = "rewards"; diff --git a/common/brave_switches.h b/common/brave_switches.h index 7fa09a8211fa..afbb544a8ede 100644 --- a/common/brave_switches.h +++ b/common/brave_switches.h @@ -23,7 +23,7 @@ extern const char kDisableTorClientUpdaterExtension[]; extern const char kDisableWebTorrentExtension[]; -extern const char kDisableBraveSync[]; +extern const char kEnableBraveSync[]; extern const char kRewards[]; diff --git a/components/brave_sync/brave_sync_service.cc b/components/brave_sync/brave_sync_service.cc index 4612a7491c30..e4e682e295d5 100644 --- a/components/brave_sync/brave_sync_service.cc +++ b/components/brave_sync/brave_sync_service.cc @@ -24,10 +24,10 @@ void BraveSyncService::RemoveObserver(BraveSyncServiceObserver* observer) { bool BraveSyncService::is_enabled() { const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); - if (command_line.HasSwitch(switches::kDisableBraveSync)) - return false; - else + if (command_line.HasSwitch(switches::kEnableBraveSync)) return true; + else + return false; } } // namespace brave_sync diff --git a/components/brave_sync/brave_sync_service_unittest.cc b/components/brave_sync/brave_sync_service_unittest.cc index 5cc2e70a56da..4dfbe4af1622 100644 --- a/components/brave_sync/brave_sync_service_unittest.cc +++ b/components/brave_sync/brave_sync_service_unittest.cc @@ -2,8 +2,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include "base/command_line.h" #include "base/files/scoped_temp_dir.h" #include "base/strings/utf_string_conversions.h" +#include "brave/common/brave_switches.h" #include "brave/components/brave_sync/client/bookmark_change_processor.h" #include "brave/components/brave_sync/client/brave_sync_client_impl.h" #include "brave/components/brave_sync/client/client_ext_impl_data.h" @@ -312,6 +314,8 @@ TEST_F(BraveSyncServiceTest, OnConnectionChanged_After_OnSetupSyncNewToSync) { } TEST_F(BraveSyncServiceTest, GetSettingsAndDevices) { + base::CommandLine::ForCurrentProcess()->AppendSwitch( + switches::kEnableBraveSync); // The test absorbs OnSetupSyncNewToSync test auto callback1 = base::BindRepeating( [](std::unique_ptr settings,