Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Merge pull request #943 from brave/sync-prod-unlock" #1116

Merged
merged 1 commit into from
Dec 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions common/brave_switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion common/brave_switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern const char kDisableTorClientUpdaterExtension[];

extern const char kDisableWebTorrentExtension[];

extern const char kDisableBraveSync[];
extern const char kEnableBraveSync[];

extern const char kRewards[];

Expand Down
6 changes: 3 additions & 3 deletions components/brave_sync/brave_sync_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions components/brave_sync/brave_sync_service_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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<brave_sync::Settings> settings,
Expand Down