Skip to content

Commit

Permalink
Merge pull request #4565 from brave/disable-sync-temp
Browse files Browse the repository at this point in the history
Append --disable-sync swtich to disable sync temporarily
.
  • Loading branch information
darkdh authored and bbondy committed Feb 8, 2020
1 parent e2d90c7 commit caf7ba3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions app/brave_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ bool BraveMainDelegate::BasicStartupComplete(int* exit_code) {
command_line.AppendSwitchASCII(switches::kSyncServiceURL,
"https://no-thanks.invalid");

// Disable sync temporarily
command_line.AppendSwitch(switches::kDisableSync);

// Enabled features.
const std::unordered_set<const char*> enabled_features = {
password_manager::features::kPasswordImport.name,
Expand Down
11 changes: 8 additions & 3 deletions browser/brave_content_browser_client_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "chrome/test/base/ui_test_utils.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/prefs/pref_service.h"
#include "components/sync/driver/sync_driver_switches.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_navigation_observer.h"
Expand Down Expand Up @@ -154,10 +155,11 @@ IN_PROC_BROWSER_TEST_F(BraveContentBrowserClientTest, CanLoadCustomBravePages) {
#if BUILDFLAG(BRAVE_REWARDS_ENABLED)
"rewards",
#endif
};
#if BUILDFLAG(ENABLE_BRAVE_SYNC)
chrome::kChromeUISyncHost,
if (switches::IsSyncAllowedByFlag())
pages.push_back(chrome::kChromeUISyncHost);
#endif
};

std::vector<std::string> schemes {
"brave://",
Expand Down Expand Up @@ -221,7 +223,10 @@ IN_PROC_BROWSER_TEST_F(BraveContentBrowserClientTest,
browser()->tab_strip_model()->GetActiveWebContents();
ui_test_utils::NavigateToURL(
browser(), GURL(scheme + chrome::kChromeUISyncInternalsHost));
ASSERT_TRUE(WaitForLoadStop(contents));
if (switches::IsSyncAllowedByFlag())
ASSERT_TRUE(WaitForLoadStop(contents));
else
ASSERT_FALSE(WaitForLoadStop(contents));

EXPECT_STREQ(base::UTF16ToUTF8(browser()->location_bar_model()
->GetFormattedFullURL()).c_str(),
Expand Down

0 comments on commit caf7ba3

Please sign in to comment.