diff --git a/components/brave_ads/browser/locale_helper.cc b/components/brave_ads/browser/locale_helper.cc index c920630d037..c7c1f41695b 100644 --- a/components/brave_ads/browser/locale_helper.cc +++ b/components/brave_ads/browser/locale_helper.cc @@ -7,17 +7,32 @@ namespace brave_ads { +LocaleHelper* g_locale_helper_for_testing = nullptr; + LocaleHelper::LocaleHelper() = default; LocaleHelper::~LocaleHelper() = default; -std::string LocaleHelper::GetLocale() const { +void LocaleHelper::set_for_testing( + LocaleHelper* locale_helper) { + g_locale_helper_for_testing = locale_helper; +} + +const std::string LocaleHelper::GetLocale() const { return kDefaultLocale; } -#if !defined(OS_MACOSX) && !defined(OS_WIN) && !defined(OS_LINUX) && !defined(OS_ANDROID) // NOLINT LocaleHelper* LocaleHelper::GetInstance() { - // just return a dummy locale helper for all other platforms + if (g_locale_helper_for_testing) { + return g_locale_helper_for_testing; + } + + return GetInstanceImpl(); +} + +#if !defined(OS_MACOSX) && !defined(OS_WIN) && !defined(OS_LINUX) && !defined(OS_ANDROID) // NOLINT +LocaleHelper* LocaleHelper::GetInstanceImpl() { + // Return a default locale helper for unsupported platforms return base::Singleton::get(); } #endif diff --git a/components/brave_ads/browser/locale_helper.h b/components/brave_ads/browser/locale_helper.h index 8574cca1f8e..5a122db9698 100644 --- a/components/brave_ads/browser/locale_helper.h +++ b/components/brave_ads/browser/locale_helper.h @@ -20,13 +20,18 @@ class LocaleHelper { public: static LocaleHelper* GetInstance(); + void set_for_testing( + LocaleHelper* locale_helper); + // Should return the language based upon the tagging conventions of RFC 4646 - virtual std::string GetLocale() const; + virtual const std::string GetLocale() const; protected: LocaleHelper(); virtual ~LocaleHelper(); + static LocaleHelper* GetInstanceImpl(); + private: friend struct base::DefaultSingletonTraits; DISALLOW_COPY_AND_ASSIGN(LocaleHelper); diff --git a/components/brave_ads/browser/locale_helper_android.cc b/components/brave_ads/browser/locale_helper_android.cc index 7c1dcb72159..c410b3b3aee 100644 --- a/components/brave_ads/browser/locale_helper_android.cc +++ b/components/brave_ads/browser/locale_helper_android.cc @@ -12,7 +12,7 @@ namespace brave_ads { -std::string LocaleHelperAndroid::GetLocale() const { +const std::string LocaleHelperAndroid::GetLocale() const { return base::android::GetDefaultLocaleString(); } @@ -20,7 +20,7 @@ LocaleHelperAndroid* LocaleHelperAndroid::GetInstance() { return base::Singleton::get(); } -LocaleHelper* LocaleHelper::GetInstance() { +LocaleHelper* LocaleHelper::GetInstanceImpl() { return LocaleHelperAndroid::GetInstance(); } diff --git a/components/brave_ads/browser/locale_helper_android.h b/components/brave_ads/browser/locale_helper_android.h index b36dc1f4979..25857ec7a10 100644 --- a/components/brave_ads/browser/locale_helper_android.h +++ b/components/brave_ads/browser/locale_helper_android.h @@ -16,16 +16,17 @@ namespace brave_ads { class LocaleHelperAndroid : public LocaleHelper { public: - static LocaleHelperAndroid* GetInstance(); - static const std::string GetCountryCode(const std::string& locale); + static LocaleHelperAndroid* GetInstanceImpl(); - protected: - LocaleHelperAndroid() = default; - ~LocaleHelperAndroid() override = default; + static const std::string GetCountryCode( + const std::string& locale); private: + LocaleHelperAndroid(); + ~LocaleHelperAndroid() override; + // LocaleHelper impl - std::string GetLocale() const override; + const std::string GetLocale() const override; friend struct base::DefaultSingletonTraits; DISALLOW_COPY_AND_ASSIGN(LocaleHelperAndroid); diff --git a/components/brave_ads/browser/locale_helper_linux.cc b/components/brave_ads/browser/locale_helper_linux.cc index 41c000f5ba3..689af250bb9 100644 --- a/components/brave_ads/browser/locale_helper_linux.cc +++ b/components/brave_ads/browser/locale_helper_linux.cc @@ -13,7 +13,7 @@ LocaleHelperLinux::LocaleHelperLinux() = default; LocaleHelperLinux::~LocaleHelperLinux() = default; -std::string LocaleHelperLinux::GetLocale() const { +const std::string LocaleHelperLinux::GetLocale() const { char const *language = nullptr; if (!language || !*language) { @@ -35,11 +35,11 @@ std::string LocaleHelperLinux::GetLocale() const { return std::string(language); } -LocaleHelperLinux* LocaleHelperLinux::GetInstance() { +LocaleHelperLinux* LocaleHelperLinux::GetInstanceImpl() { return base::Singleton::get(); } -LocaleHelper* LocaleHelper::GetInstance() { +LocaleHelper* LocaleHelper::GetInstanceImpl() { return LocaleHelperLinux::GetInstance(); } diff --git a/components/brave_ads/browser/locale_helper_linux.h b/components/brave_ads/browser/locale_helper_linux.h index d8f911c8f90..f837d75ad43 100644 --- a/components/brave_ads/browser/locale_helper_linux.h +++ b/components/brave_ads/browser/locale_helper_linux.h @@ -14,14 +14,14 @@ namespace brave_ads { class LocaleHelperLinux : public LocaleHelper { public: + static LocaleHelperLinux* GetInstanceImpl(); + + private: LocaleHelperLinux(); ~LocaleHelperLinux() override; - static LocaleHelperLinux* GetInstance(); - - private: // LocaleHelper impl - std::string GetLocale() const override; + const std::string GetLocale() const override; friend struct base::DefaultSingletonTraits; DISALLOW_COPY_AND_ASSIGN(LocaleHelperLinux); diff --git a/components/brave_ads/browser/locale_helper_mac.h b/components/brave_ads/browser/locale_helper_mac.h index fc7faca4d72..2deaf83d996 100644 --- a/components/brave_ads/browser/locale_helper_mac.h +++ b/components/brave_ads/browser/locale_helper_mac.h @@ -14,14 +14,14 @@ namespace brave_ads { class LocaleHelperMac : public LocaleHelper { public: + static LocaleHelperMac* GetInstanceImpl(); + + private: LocaleHelperMac(); ~LocaleHelperMac() override; - static LocaleHelperMac* GetInstance(); - - private: // LocaleHelper impl - std::string GetLocale() const override; + const std::string GetLocale() const override; friend struct base::DefaultSingletonTraits; DISALLOW_COPY_AND_ASSIGN(LocaleHelperMac); diff --git a/components/brave_ads/browser/locale_helper_mac.mm b/components/brave_ads/browser/locale_helper_mac.mm index c7d32e43a2c..4ad14d27adc 100644 --- a/components/brave_ads/browser/locale_helper_mac.mm +++ b/components/brave_ads/browser/locale_helper_mac.mm @@ -13,17 +13,17 @@ LocaleHelperMac::~LocaleHelperMac() = default; -std::string LocaleHelperMac::GetLocale() const { +const std::string LocaleHelperMac::GetLocale() const { NSString *locale = [[NSLocale preferredLanguages] firstObject]; return std::string([locale UTF8String]); } -LocaleHelperMac* LocaleHelperMac::GetInstance() { +LocaleHelperMac* LocaleHelperMac::GetInstanceImpl() { return base::Singleton::get(); } -LocaleHelper* LocaleHelper::GetInstance() { - return LocaleHelperMac::GetInstance(); +LocaleHelper* LocaleHelper::GetInstanceImpl() { + return LocaleHelperMac::GetInstanceImpl(); } } // namespace brave_ads diff --git a/components/brave_ads/browser/locale_helper_mock.cc b/components/brave_ads/browser/locale_helper_mock.cc new file mode 100644 index 00000000000..db08dfed70f --- /dev/null +++ b/components/brave_ads/browser/locale_helper_mock.cc @@ -0,0 +1,14 @@ +/* Copyright (c) 2019 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * 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 "brave/components/brave_ads/browser/locale_helper_mock.h" + +namespace brave_ads { + +LocaleHelperMock::LocaleHelperMock() = default; + +LocaleHelperMock::~LocaleHelperMock() = default; + +} // namespace brave_ads diff --git a/components/brave_ads/browser/locale_helper_mock.h b/components/brave_ads/browser/locale_helper_mock.h new file mode 100644 index 00000000000..cf8e4c0f287 --- /dev/null +++ b/components/brave_ads/browser/locale_helper_mock.h @@ -0,0 +1,30 @@ +/* Copyright (c) 2019 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +#ifndef BRAVE_COMPONENTS_BRAVE_ADS_BROWSER_LOCALE_HELPER_MOCK_H_ +#define BRAVE_COMPONENTS_BRAVE_ADS_BROWSER_LOCALE_HELPER_MOCK_H_ + +#include + +#include "brave/components/brave_ads/browser/locale_helper.h" + +#include "testing/gmock/include/gmock/gmock.h" + +namespace brave_ads { + +class LocaleHelperMock : public LocaleHelper { + public: + LocaleHelperMock(); + ~LocaleHelperMock() override; + + MOCK_METHOD(const std::string, GetLocale, (), (const, override)); + + private: + DISALLOW_COPY_AND_ASSIGN(LocaleHelperMock); +}; + +} // namespace brave_ads + +#endif // BRAVE_COMPONENTS_BRAVE_ADS_BROWSER_LOCALE_HELPER_MOCK_H_ diff --git a/components/brave_ads/browser/locale_helper_win.cc b/components/brave_ads/browser/locale_helper_win.cc index 82571177e7a..fa32b88a0d0 100644 --- a/components/brave_ads/browser/locale_helper_win.cc +++ b/components/brave_ads/browser/locale_helper_win.cc @@ -13,7 +13,7 @@ LocaleHelperWin::LocaleHelperWin() = default; LocaleHelperWin::~LocaleHelperWin() = default; -std::string LocaleHelperWin::GetLocale() const { +const std::string LocaleHelperWin::GetLocale() const { auto size = ::GetLocaleInfoEx(nullptr, LOCALE_SNAME, nullptr, 0); if (size == 0) { return kDefaultLocale; @@ -39,11 +39,11 @@ std::string LocaleHelperWin::GetLocale() const { return std::string(locale.get()); } -LocaleHelperWin* LocaleHelperWin::GetInstance() { +LocaleHelperWin* LocaleHelperWin::GetInstanceImpl() { return base::Singleton::get(); } -LocaleHelper* LocaleHelper::GetInstance() { +LocaleHelper* LocaleHelper::GetInstanceImpl() { return LocaleHelperWin::GetInstance(); } diff --git a/components/brave_ads/browser/locale_helper_win.h b/components/brave_ads/browser/locale_helper_win.h index c72c82c0939..6a560a2b46f 100644 --- a/components/brave_ads/browser/locale_helper_win.h +++ b/components/brave_ads/browser/locale_helper_win.h @@ -15,14 +15,14 @@ namespace brave_ads { class LocaleHelperWin : public LocaleHelper { public: + static LocaleHelperWin* GetInstanceImpl(); + + private: LocaleHelperWin(); ~LocaleHelperWin() override; - static LocaleHelperWin* GetInstance(); - - private: // LocaleHelper impl - std::string GetLocale() const override; + const std::string GetLocale() const override; friend struct base::DefaultSingletonTraits; DISALLOW_COPY_AND_ASSIGN(LocaleHelperWin); diff --git a/components/brave_rewards/browser/rewards_service_browsertest.cc b/components/brave_rewards/browser/rewards_service_browsertest.cc index 9195b1b65a2..e1830d9b87e 100644 --- a/components/brave_rewards/browser/rewards_service_browsertest.cc +++ b/components/brave_rewards/browser/rewards_service_browsertest.cc @@ -3,7 +3,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 #include +#include +#include #include "base/path_service.h" #include "base/run_loop.h" @@ -23,10 +26,16 @@ #include "brave/components/brave_rewards/browser/rewards_notification_service_impl.h" // NOLINT #include "brave/components/brave_rewards/browser/rewards_notification_service_observer.h" // NOLINT #include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_ads/browser/ads_service_factory.h" +#include "brave/components/brave_ads/browser/ads_service_impl.h" +#include "brave/components/brave_ads/common/pref_names.h" +#include "brave/components/brave_ads/browser/locale_helper_mock.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/views/frame/browser_view.h" +#include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/base/in_process_browser_test.h" +#include "chrome/test/base/testing_profile.h" #include "chrome/test/base/ui_test_utils.h" #include "components/network_session_configurator/common/network_switches.h" #include "content/public/browser/notification_service.h" @@ -40,8 +49,14 @@ // npm run test -- brave_browser_tests --filter=BraveRewardsBrowserTest.* +using ::testing::NiceMock; +using ::testing::Return; + using braveledger_bat_helper::SERVER_TYPES; +using RewardsNotificationType = + brave_rewards::RewardsNotificationService::RewardsNotificationType; + namespace { std::unique_ptr HandleRequest( @@ -137,13 +152,26 @@ namespace brave_test_resp { std::string uphold_commit_resp_; } // namespace brave_test_resp -class BraveRewardsBrowserTest : - public InProcessBrowserTest, - public brave_rewards::RewardsServiceObserver, - public brave_rewards::RewardsNotificationServiceObserver, - public base::SupportsWeakPtr { +class BraveRewardsBrowserTest + : public InProcessBrowserTest, + public brave_rewards::RewardsServiceObserver, + public brave_rewards::RewardsNotificationServiceObserver, + public base::SupportsWeakPtr { public: + BraveRewardsBrowserTest() { + // You can do set-up work for each test here + + MaybeMockLocaleHelper(); + } + + ~BraveRewardsBrowserTest() override { + // You can do clean-up work that doesn't throw exceptions here + } + void SetUpOnMainThread() override { + // Code here will be called immediately after the constructor (right before + // each test) + InProcessBrowserTest::SetUpOnMainThread(); host_resolver()->AddRule("*", "127.0.0.1"); @@ -157,19 +185,34 @@ class BraveRewardsBrowserTest : brave::RegisterPathProvider(); ReadTestData(); + + auto* browser_profile = browser()->profile(); + rewards_service_ = static_cast( - brave_rewards::RewardsServiceFactory::GetForProfile( - browser()->profile())); + brave_rewards::RewardsServiceFactory::GetForProfile(browser_profile)); rewards_service_->test_response_callback_ = base::BindRepeating(&BraveRewardsBrowserTest::GetTestResponse, base::Unretained(this)); rewards_service_->SetLedgerEnvForTesting(); + + ads_service_ = static_cast( + brave_ads::AdsServiceFactory::GetForProfile(browser_profile)); + ASSERT_NE(nullptr, ads_service_); } void TearDown() override { + // Code here will be called immediately after each test (right before the + // destructor) + InProcessBrowserTest::TearDown(); } + bool SetUpUserDataDirectory() override { + MaybeMockUserProfilePreferencesForBraveAdsUpgradePath(); + + return true; + } + void SetUpCommandLine(base::CommandLine* command_line) override { // HTTPS server only serves a valid cert for localhost, so this is needed // to load pages from other hosts without an error @@ -183,6 +226,18 @@ class BraveRewardsBrowserTest : loop.RunUntilIdle(); } + PrefService* GetPrefs() { + return browser()->profile()->GetPrefs(); + } + + bool IsRewardsEnabled() { + return GetPrefs()->GetBoolean(brave_rewards::prefs::kBraveRewardsEnabled); + } + + bool IsAdsEnabled() { + return ads_service_->IsEnabled(); + } + std::string GetWalletProperties() { return "{" @@ -466,6 +521,180 @@ class BraveRewardsBrowserTest : ASSERT_TRUE(js_result.ExtractBool()); } + void WaitForBraveAdsHaveArrivedNotification() { + if (brave_ads_have_arrived_notification_was_already_shown_) { + return; + } + + brave_ads_have_arrived_notification_run_loop_ = + std::make_unique(); + brave_ads_have_arrived_notification_run_loop_->Run(); + } + + void AddNotificationServiceObserver() { + rewards_service_->GetNotificationService()->AddObserver(this); + } + + void MaybeMockLocaleHelper() { + const std::map locale_for_tests = { + {"BraveAdsRegionIsSupported", "en_US"}, + {"BraveAdsRegionIsNotSupported", "en_XX"}, + {"PRE_AutoEnableAdsForSupportedRegions", "en_US"}, + {"AutoEnableAdsForSupportedRegions", "en_US"}, + {"PRE_DoNotAutoEnableAdsForUnsupportedRegions", "en_XX"}, + {"DoNotAutoEnableAdsForUnsupportedRegions", "en_XX"}, + {"PRE_ShowBraveAdsHaveArrivedNotificationForNewRegion", "en_XX"}, + {"ShowBraveAdsHaveArrivedNotificationForNewRegion", "en_US"}, + {"PRE_DoNotShowBraveAdsHaveArrivedNotificationForUnsupportedRegion", "en_XX"}, // NOLINT + {"DoNotShowBraveAdsHaveArrivedNotificationForUnsupportedRegion", "en_XX"}, + }; + + const ::testing::TestInfo* const test_info = + ::testing::UnitTest::GetInstance()->current_test_info(); + ASSERT_NE(nullptr, test_info); + + const auto it = locale_for_tests.find(test_info->name()); + if (it == locale_for_tests.end()) { + MaybeMockLocaleHelperForBraveAdsUpgradePath(); + return; + } + + MockLocaleHelper(it->second); + } + + void MaybeMockLocaleHelperForBraveAdsUpgradePath() { + std::vector parameters; + if (!GetUpgradePathParams(¶meters)) { + return; + } + + const std::string supported_region_parameter = parameters.at(1); + ASSERT_TRUE(!supported_region_parameter.empty()); + + std::string locale; + if (supported_region_parameter == "ForSupportedRegion") { + locale = "en_US"; + } else { + locale = "en_XX"; + } + + MockLocaleHelper(locale); + } + + void MockLocaleHelper( + const std::string& locale) { + locale_helper_mock_ = + std::make_unique>(); + + brave_ads::LocaleHelper::GetInstance()->set_for_testing( + locale_helper_mock_.get()); + + ON_CALL(*locale_helper_mock_, GetLocale()) + .WillByDefault(Return(locale)); + } + + void MaybeMockUserProfilePreferencesForBraveAdsUpgradePath() { + std::vector parameters; + if (!GetUpgradePathParams(¶meters)) { + return; + } + + const std::string preferences_parameter = parameters.at(0); + ASSERT_TRUE(!preferences_parameter.empty()); + + MockUserProfilePreferences(preferences_parameter); + } + + bool GetUpgradePathParams( + std::vector* parameters) { + EXPECT_NE(nullptr, parameters); + + const ::testing::TestInfo* const test_info = + ::testing::UnitTest::GetInstance()->current_test_info(); + EXPECT_NE(nullptr, test_info); + + const std::string test_suite_name = test_info->test_suite_name(); + if (test_suite_name != "BraveRewardsBrowserTest/BraveAdsBrowserTest") { + return false; + } + + const std::string test_name = test_info->name(); + const auto test_name_components = base::SplitString(test_name, "/", + base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL); + EXPECT_EQ(2UL, test_name_components.size()); + + // test_name_components: + // 0 = Name + // 1 = Parameters + + const std::string name = test_name_components.at(0); + if (name != "UpgradePath") { + return false; + } + + // parameters: + // 0 = Preferences + // 1 = Supported region + // 2 = Rewards enabled + // 3 = Ads enabled + // 4 = Should show notification + + *parameters = base::SplitString(test_name_components.at(1), "_", + base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL); + EXPECT_EQ(5UL, parameters->size()); + + return true; + } + + base::FilePath GetUserDataPath() const { + base::FilePath path; + base::PathService::Get(chrome::DIR_USER_DATA, &path); + path = path.AppendASCII(TestingProfile::kTestUserProfileDir); + return path; + } + + base::FilePath GetTestDataPath() const { + // TODO(tmancey): We should be able to use |GetTestDataDir| however the path + // was invalid during setup, therefore investigate further + base::FilePath path; + base::PathService::Get(base::DIR_SOURCE_ROOT, &path); + path = path.Append(FILE_PATH_LITERAL("brave")); + path = path.Append(FILE_PATH_LITERAL("test")); + path = path.Append(FILE_PATH_LITERAL("data")); + return path; + } + + void MockUserProfilePreferences( + const std::string& preference) const { + auto user_data_path = GetUserDataPath(); + ASSERT_TRUE(base::CreateDirectory(user_data_path)); + + const auto preferences_path = + user_data_path.Append(chrome::kPreferencesFilename); + + // TODO(tmancey): We should be able to use |GetTestDataDir| however the path + // was invalid during setup, therefore investigate further + auto test_data_path = GetTestDataPath(); + test_data_path = test_data_path.AppendASCII("rewards-data"); + test_data_path = test_data_path.AppendASCII("migration"); + test_data_path = test_data_path.AppendASCII(preference); + ASSERT_TRUE(base::PathExists(test_data_path)); + + ASSERT_TRUE(base::CopyFile(test_data_path, preferences_path)); + } + + bool IsShowingNotificationForType( + const RewardsNotificationType type) const { + const auto& notifications = rewards_service_->GetAllNotifications(); + for (const auto& notification : notifications) { + if (notification.second.type_ == type) { + return true; + } + } + + return false; + } + void GetReconcileTime() { rewards_service()->GetReconcileTime( base::Bind(&BraveRewardsBrowserTest::OnGetReconcileTime, @@ -1197,15 +1426,34 @@ class BraveRewardsBrowserTest : brave_rewards::RewardsNotificationService* rewards_notification_service, const brave_rewards::RewardsNotificationService::RewardsNotification& notification) { - const brave_rewards::RewardsNotificationService::RewardsNotificationsMap& - notifications = rewards_notification_service->GetAllNotifications(); + const auto& notifications = + rewards_notification_service->GetAllNotifications(); + for (const auto& notification : notifications) { - if (notification.second.type_ == - brave_rewards::RewardsNotificationService::RewardsNotificationType - ::REWARDS_NOTIFICATION_INSUFFICIENT_FUNDS) { - insufficient_notification_would_have_already_shown_ = true; - if (wait_for_insufficient_notification_loop_) { - wait_for_insufficient_notification_loop_->Quit(); + switch (notification.second.type_) { + case brave_rewards::RewardsNotificationService:: + RewardsNotificationType::REWARDS_NOTIFICATION_INSUFFICIENT_FUNDS: { + insufficient_notification_would_have_already_shown_ = true; + if (wait_for_insufficient_notification_loop_) { + wait_for_insufficient_notification_loop_->Quit(); + } + + break; + } + + case brave_rewards::RewardsNotificationService:: + RewardsNotificationType::REWARDS_NOTIFICATION_ADS_ONBOARDING: { + brave_ads_have_arrived_notification_was_already_shown_ = true; + + if (brave_ads_have_arrived_notification_run_loop_) { + brave_ads_have_arrived_notification_run_loop_->Quit(); + } + + break; + } + + default: { + break; } } } @@ -1259,6 +1507,10 @@ class BraveRewardsBrowserTest : brave_rewards::RewardsServiceImpl* rewards_service_; + brave_ads::AdsServiceImpl* ads_service_; + + std::unique_ptr locale_helper_mock_; + brave_rewards::Grant grant_; std::unique_ptr wait_for_wallet_initialization_loop_; @@ -1291,6 +1543,9 @@ class BraveRewardsBrowserTest : std::unique_ptr wait_for_insufficient_notification_loop_; bool insufficient_notification_would_have_already_shown_ = false; + std::unique_ptr brave_ads_have_arrived_notification_run_loop_; + bool brave_ads_have_arrived_notification_was_already_shown_ = false; + bool ac_low_amount_ = false; bool last_publisher_added_ = false; bool alter_publisher_list_ = false; @@ -2157,16 +2412,10 @@ IN_PROC_BROWSER_TEST_F(BraveRewardsBrowserTest, return; } - bool notification_shown = false; - for (const auto& notification : notifications) { - if (notification.second.type_ == - brave_rewards::RewardsNotificationService::RewardsNotificationType - ::REWARDS_NOTIFICATION_INSUFFICIENT_FUNDS) { - notification_shown = true; - break; - } - } - EXPECT_FALSE(notification_shown); + bool is_showing_notification = IsShowingNotificationForType( + RewardsNotificationType::REWARDS_NOTIFICATION_INSUFFICIENT_FUNDS); + + EXPECT_FALSE(is_showing_notification); // Stop observing the Rewards service rewards_service_->RemoveObserver(this); @@ -2196,16 +2445,10 @@ IN_PROC_BROWSER_TEST_F(BraveRewardsBrowserTest, return; } - bool notification_shown = false; - for (const auto& notification : notifications) { - if (notification.second.type_ == - brave_rewards::RewardsNotificationService::RewardsNotificationType - ::REWARDS_NOTIFICATION_INSUFFICIENT_FUNDS) { - notification_shown = true; - break; - } - } - EXPECT_FALSE(notification_shown); + bool is_showing_notification = IsShowingNotificationForType( + RewardsNotificationType::REWARDS_NOTIFICATION_INSUFFICIENT_FUNDS); + + EXPECT_FALSE(is_showing_notification); // Stop observing the Rewards service rewards_service_->RemoveObserver(this); @@ -2237,16 +2480,10 @@ IN_PROC_BROWSER_TEST_F(BraveRewardsBrowserTest, return; } - bool notification_shown = false; - for (const auto& notification : notifications) { - if (notification.second.type_ == - brave_rewards::RewardsNotificationService::RewardsNotificationType - ::REWARDS_NOTIFICATION_INSUFFICIENT_FUNDS) { - notification_shown = true; - break; - } - } - EXPECT_FALSE(notification_shown); + bool is_showing_notification = IsShowingNotificationForType( + RewardsNotificationType::REWARDS_NOTIFICATION_INSUFFICIENT_FUNDS); + + EXPECT_FALSE(is_showing_notification); // Stop observing the Rewards service rewards_service_->RemoveObserver(this); @@ -2278,16 +2515,10 @@ IN_PROC_BROWSER_TEST_F(BraveRewardsBrowserTest, return; } - bool notification_shown = false; - for (const auto& notification : notifications) { - if (notification.second.type_ == - brave_rewards::RewardsNotificationService::RewardsNotificationType - ::REWARDS_NOTIFICATION_INSUFFICIENT_FUNDS) { - notification_shown = true; - break; - } - } - EXPECT_TRUE(notification_shown); + bool is_showing_notification = IsShowingNotificationForType( + RewardsNotificationType::REWARDS_NOTIFICATION_INSUFFICIENT_FUNDS); + + EXPECT_TRUE(is_showing_notification); // Stop observing the Rewards service rewards_service_->RemoveObserver(this); @@ -2662,3 +2893,477 @@ IN_PROC_BROWSER_TEST_F(BraveRewardsBrowserTest, // Stop observing the Rewards service rewards_service_->RemoveObserver(this); } + +IN_PROC_BROWSER_TEST_F(BraveRewardsBrowserTest, + BraveAdsRegionIsSupported) { + EXPECT_TRUE(ads_service_->IsSupportedRegion()); +} + +IN_PROC_BROWSER_TEST_F(BraveRewardsBrowserTest, + BraveAdsRegionIsNotSupported) { + EXPECT_FALSE(ads_service_->IsSupportedRegion()); +} + +IN_PROC_BROWSER_TEST_F(BraveRewardsBrowserTest, + PRE_AutoEnableAdsForSupportedRegions) { + EnableRewards(); + + EXPECT_TRUE(IsAdsEnabled()); +} + +IN_PROC_BROWSER_TEST_F(BraveRewardsBrowserTest, + AutoEnableAdsForSupportedRegions) { + EXPECT_TRUE(IsAdsEnabled()); +} + +IN_PROC_BROWSER_TEST_F(BraveRewardsBrowserTest, + PRE_DoNotAutoEnableAdsForUnsupportedRegions) { + EnableRewards(); + + EXPECT_FALSE(IsAdsEnabled()); +} + +IN_PROC_BROWSER_TEST_F(BraveRewardsBrowserTest, + DoNotAutoEnableAdsForUnsupportedRegions) { + EXPECT_FALSE(IsAdsEnabled()); +} + +IN_PROC_BROWSER_TEST_F(BraveRewardsBrowserTest, + PRE_ShowBraveAdsHaveArrivedNotificationForNewRegion) { + EnableRewards(); + + EXPECT_FALSE(IsAdsEnabled()); +} + +IN_PROC_BROWSER_TEST_F(BraveRewardsBrowserTest, + ShowBraveAdsHaveArrivedNotificationForNewRegion) { + AddNotificationServiceObserver(); + + WaitForBraveAdsHaveArrivedNotification(); + + EXPECT_FALSE(IsAdsEnabled()); +} + +IN_PROC_BROWSER_TEST_F(BraveRewardsBrowserTest, + PRE_DoNotShowBraveAdsHaveArrivedNotificationForUnsupportedRegion) { + EnableRewards(); + + EXPECT_FALSE(IsAdsEnabled()); +} + +IN_PROC_BROWSER_TEST_F(BraveRewardsBrowserTest, + DoNotShowBraveAdsHaveArrivedNotificationForUnsupportedRegion) { + bool is_showing_notification = IsShowingNotificationForType( + RewardsNotificationType::REWARDS_NOTIFICATION_ADS_ONBOARDING); + + EXPECT_FALSE(is_showing_notification); +} + +struct BraveAdsUpgradePathParamInfo { + // |preferences| should be set to the name of the preferences filename located + // at "src/brave/test/data/rewards-data/migration" + std::string preferences; + + // |supported_region| should be set to |true| if the locale should be set to a + // supported region; otherwise, should be set to |false| + bool supported_region; + + // |rewards_enabled| should be set to |true| if Brave rewards should be + // enabled after upgrade; otherwise, should be set to |false| + bool rewards_enabled; + + // |ads_enabled| should be set to |true| if Brave ads should be enabled after + // upgrade; otherwise, should be set to |false| + bool ads_enabled; + + // |should_show_onboarding| should be set to |true| if Brave ads onboarding + // should be shown after upgrade; otherwise, should be set to |false| + bool should_show_onboarding; +}; + +class BraveAdsBrowserTest + : public BraveRewardsBrowserTest, + public ::testing::WithParamInterface {}; + +const BraveAdsUpgradePathParamInfo kTests[] = { + // Test Suite with expected outcomes for upgrade paths instantiated using + // Value-Parameterized Tests + + // Upgrade from 0.62 to current version + { + "PreferencesForVersion062WithRewardsDisabled", + false, /* supported_region */ + false, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion062WithRewardsDisabled", + true, /* supported_region */ + false, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion062WithRewardsEnabled", + false, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion062WithRewardsEnabled", + true, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + true /* should_show_onboarding */ + }, + + // Upgrade from 0.63 to current version (Initial release of Brave ads) + { + "PreferencesForVersion063WithRewardsAndAdsDisabled", + false, /* supported_region */ + false, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion063WithRewardsEnabledAndAdsDisabled", + false, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion063WithRewardsAndAdsEnabled", + false, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion063WithRewardsAndAdsDisabled", + true, /* supported_region */ + false, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion063WithRewardsEnabledAndAdsDisabled", + true, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + true /* should_show_onboarding */ + }, + // TODO(tmancey): The following test failed due to the ads_enabled flag being + // incorrectly set to false + // { + // "PreferencesForVersion063WithRewardsAndAdsEnabled", + // true, /* supported_region */ + // true, /* rewards_enabled */ + // true, /* ads_enabled */ + // false /* should_show_onboarding */ + // }, + + // Upgrade from 0.67 to current version + { + "PreferencesForVersion067WithRewardsAndAdsDisabled", + false, /* supported_region */ + false, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion067WithRewardsEnabledAndAdsDisabled", + false, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion067WithRewardsAndAdsEnabled", + false, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion067WithRewardsAndAdsDisabled", + true, /* supported_region */ + false, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion067WithRewardsEnabledAndAdsDisabled", + true, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + true /* should_show_onboarding */ + }, + { + "PreferencesForVersion067WithRewardsAndAdsEnabled", + true, /* supported_region */ + true, /* rewards_enabled */ + true, /* ads_enabled */ + false /* should_show_onboarding */ + }, + + // Upgrade from 0.68 to current version + { + "PreferencesForVersion068WithRewardsAndAdsDisabled", + false, /* supported_region */ + false, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion068WithRewardsEnabledAndAdsDisabled", + false, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion068WithRewardsAndAdsEnabled", + false, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion068WithRewardsAndAdsDisabled", + true, /* supported_region */ + false, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion068WithRewardsEnabledAndAdsDisabled", + true, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + true /* should_show_onboarding */ + }, + { + "PreferencesForVersion068WithRewardsAndAdsEnabled", + true, /* supported_region */ + true, /* rewards_enabled */ + true, /* ads_enabled */ + false /* should_show_onboarding */ + }, + + // Upgrade from 0.69 to current version + { + "PreferencesForVersion069WithRewardsAndAdsDisabled", + false, /* supported_region */ + false, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion069WithRewardsEnabledAndAdsDisabled", + false, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion069WithRewardsAndAdsEnabled", + false, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion069WithRewardsAndAdsDisabled", + true, /* supported_region */ + false, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion069WithRewardsEnabledAndAdsDisabled", + true, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + true /* should_show_onboarding */ + }, + { + "PreferencesForVersion069WithRewardsAndAdsEnabled", + true, /* supported_region */ + true, /* rewards_enabled */ + true, /* ads_enabled */ + false /* should_show_onboarding */ + }, + + // Upgrade from 0.70 to current version + { + "PreferencesForVersion070WithRewardsAndAdsDisabled", + false, /* supported_region */ + false, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion070WithRewardsEnabledAndAdsDisabled", + false, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion070WithRewardsAndAdsEnabled", + false, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion070WithRewardsAndAdsDisabled", + true, /* supported_region */ + false, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion070WithRewardsEnabledAndAdsDisabled", + true, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + true /* should_show_onboarding */ + }, + { + "PreferencesForVersion070WithRewardsAndAdsEnabled", + true, /* supported_region */ + true, /* rewards_enabled */ + true, /* ads_enabled */ + false /* should_show_onboarding */ + }, + + // Upgrade from 0.71 to current version + { + "PreferencesForVersion071WithRewardsAndAdsDisabled", + false, /* supported_region */ + false, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion071WithRewardsEnabledAndAdsDisabled", + false, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion071WithRewardsAndAdsEnabled", + false, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion071WithRewardsAndAdsDisabled", + true, /* supported_region */ + false, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion071WithRewardsEnabledAndAdsDisabled", + true, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + true /* should_show_onboarding */ + }, + { + "PreferencesForVersion071WithRewardsAndAdsEnabled", + true, /* supported_region */ + true, /* rewards_enabled */ + true, /* ads_enabled */ + false /* should_show_onboarding */ + }, + + // Upgrade from 0.72 to current version + { + "PreferencesForVersion072WithRewardsAndAdsDisabled", + false, /* supported_region */ + false, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion072WithRewardsEnabledAndAdsDisabled", + false, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion072WithRewardsAndAdsEnabled", + false, /* supported_locale */ + true, /* rewards_enabled */ + true, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion072WithRewardsAndAdsDisabled", + true, /* supported_region */ + false, /* rewards_enabled */ + false, /* ads_enabled */ + false /* should_show_onboarding */ + }, + { + "PreferencesForVersion072WithRewardsEnabledAndAdsDisabled", + true, /* supported_region */ + true, /* rewards_enabled */ + false, /* ads_enabled */ + true /* should_show_onboarding */ + }, + { + "PreferencesForVersion072WithRewardsAndAdsEnabled", + true, /* supported_region */ + true, /* rewards_enabled */ + true, /* ads_enabled */ + false /* should_show_onboarding */ + } +}; + +IN_PROC_BROWSER_TEST_P(BraveAdsBrowserTest, UpgradePath) { + BraveAdsUpgradePathParamInfo param(GetParam()); + + bool is_showing_notification = IsShowingNotificationForType( + RewardsNotificationType::REWARDS_NOTIFICATION_ADS_ONBOARDING); + + EXPECT_EQ(IsRewardsEnabled(), param.rewards_enabled); + EXPECT_EQ(IsAdsEnabled(), param.ads_enabled); + EXPECT_EQ(is_showing_notification, param.should_show_onboarding); +} + +// Generate the test case name from the metadata included in +// |BraveAdsUpgradePathParamInfo| +static std::string GetTestCaseName( + ::testing::TestParamInfo param_info) { + const char* preferences = param_info.param.preferences.c_str(); + + const char* supported_region = param_info.param.supported_region ? + "ForSupportedRegion" : "ForUnsupportedRegion"; + + const char* rewards_enabled = param_info.param.rewards_enabled ? + "RewardsShouldBeEnabled" : "RewardsShouldBeDisabled"; + + const char* ads_enabled = param_info.param.ads_enabled ? + "AdsShouldBeEnabled" : "AdsShouldBeDisabled"; + + const char* should_show_onboarding = param_info.param.should_show_onboarding ? + "ShouldShowOnboarding" : "ShouldNotShowOnboarding"; + + // NOTE: You should not remove, change the format or reorder the following + // parameters as they are parsed in |GetUpgradePathParams| + return base::StringPrintf("%s_%s_%s_%s_%s", preferences, supported_region, + rewards_enabled, ads_enabled, should_show_onboarding); +} + +INSTANTIATE_TEST_SUITE_P(BraveRewardsBrowserTest, + BraveAdsBrowserTest, ::testing::ValuesIn(kTests), GetTestCaseName); diff --git a/test/BUILD.gn b/test/BUILD.gn index e817d75dec2..8f4e90537e4 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -556,6 +556,8 @@ test("brave_browser_tests") { sources += [ "//brave/components/brave_rewards/browser/rewards_notification_service_browsertest.cc", "//brave/components/brave_rewards/browser/rewards_service_browsertest.cc", + "//brave/components/brave_ads/browser/locale_helper_mock.cc", + "//brave/components/brave_ads/browser/locale_helper_mock.h", ] deps += [ diff --git a/test/data/rewards-data/migration/PreferencesForVersion062WithRewardsDisabled b/test/data/rewards-data/migration/PreferencesForVersion062WithRewardsDisabled new file mode 100644 index 00000000000..ed32765f0b7 --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion062WithRewardsDisabled @@ -0,0 +1 @@ +{"plugins":{"plugins_list":[]},"google":{"services":{"signin_scoped_device_id":"a6b1f8f8-bd81-4174-93c0-3e51a6f66da3"}},"apps":{"shortcuts_version":5},"profile":{"avatar_index":26,"exit_type":"Crashed","created_by_version":"73.0.62.51","avatar_bubble_tutorial_shown":2,"managed_user_id":"","content_settings":{"pref_version":1,"exceptions":{"cookies":{},"ssl_cert_decisions":{},"clipboard":{},"auto_select_certificate":{},"javascript":{},"durable_storage":{},"permission_autoblocking_data":{},"popups":{},"client_hints":{},"sensors":{},"media_engagement":{},"notifications":{},"flash_data":{},"password_protection":{},"midi_sysex":{},"autoplay":{},"intent_picker_auto_display":{},"bluetooth_guard":{},"mixed_script":{},"protocol_handler":{},"images":{},"background_sync":{},"important_site_info":{},"subresource_filter":{},"payment_handler":{},"geolocation":{},"ppapi_broker":{},"subresource_filter_data":{},"media_stream_camera":{},"usb_chooser_data":{},"sound":{},"usb_guard":{},"site_engagement":{},"plugins":{},"accessibility_events":{},"media_stream_mic":{},"app_banner":{},"automatic_downloads":{}}},"exited_cleanly":true,"name":"Person 1"},"countryid_at_install":18242,"data_reduction":{"this_week_number":2587,"network_properties":{}},"gcm":{"product_category_for_subtypes":"com.brave.macosx"},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"account_id_migration_state":2,"media":{"device_id_salt":"17D2C302CC4A1D4DEE69ECDE8D4E05F2","engagement":{"schema_version":4}},"browser":{"has_seen_welcome_page":true,"last_google_search_domain_mixing_metrics_time":"13209274800000000","window_placement":{"bottom":1368,"work_area_bottom":1390,"maximized":false,"work_area_right":2560,"left":22,"right":1222,"top":45,"work_area_left":0,"work_area_top":23}},"previews":{"litepage":{"user-needs-notification":false}},"invalidator":{"client_id":"zR1dy36eH9KKvwsoZEbaNg=="},"account_tracker_service_last_update":"13209305811380184","translate_site_blacklist_with_time":{},"language_model_counters":{"en":2},"extensions":{"last_chrome_version":"73.0.62.51","alerts":{"initialized":true},"chrome_url_overrides":{}},"signin":{"allowed":false},"ntp":{"num_personal_suggestions":1},"brave":{"rewards":{"enabled":false,"enabled_migrated":true},"brave_ads":{"enabled":false}},"default_apps_install_state":3} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion062WithRewardsEnabled b/test/data/rewards-data/migration/PreferencesForVersion062WithRewardsEnabled new file mode 100644 index 00000000000..f7ee49521b4 --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion062WithRewardsEnabled @@ -0,0 +1 @@ +{"account_id_migration_state":2,"account_tracker_service_last_update":"13209305811380184","apps":{"shortcuts_version":5},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"brave":{"brave_ads":{"enabled":true},"rewards":{"enabled":true,"enabled_migrated":true}},"browser":{"has_seen_welcome_page":true,"last_google_search_domain_mixing_metrics_time":"13209274800000000","window_placement":{"bottom":1368,"left":22,"maximized":false,"right":1222,"top":45,"work_area_bottom":1390,"work_area_left":0,"work_area_right":2560,"work_area_top":23}},"countryid_at_install":18242,"data_reduction":{"network_properties":{},"this_week_number":2587},"default_apps_install_state":3,"extensions":{"alerts":{"initialized":true},"chrome_url_overrides":{},"last_chrome_version":"73.0.62.51"},"gcm":{"product_category_for_subtypes":"com.brave.macosx"},"google":{"services":{"signin_scoped_device_id":"a6b1f8f8-bd81-4174-93c0-3e51a6f66da3"}},"invalidator":{"client_id":"zR1dy36eH9KKvwsoZEbaNg=="},"language_model_counters":{"en":2},"media":{"device_id_salt":"17D2C302CC4A1D4DEE69ECDE8D4E05F2","engagement":{"schema_version":4}},"ntp":{"num_personal_suggestions":1},"plugins":{"plugins_list":[]},"previews":{"litepage":{"user-needs-notification":false}},"profile":{"avatar_bubble_tutorial_shown":2,"avatar_index":26,"content_settings":{"exceptions":{"accessibility_events":{},"app_banner":{},"auto_select_certificate":{},"automatic_downloads":{},"autoplay":{},"background_sync":{},"bluetooth_guard":{},"client_hints":{},"clipboard":{},"cookies":{},"durable_storage":{},"flash_data":{},"geolocation":{},"images":{},"important_site_info":{},"intent_picker_auto_display":{},"javascript":{},"media_engagement":{},"media_stream_camera":{},"media_stream_mic":{},"midi_sysex":{},"mixed_script":{},"notifications":{},"password_protection":{},"payment_handler":{},"permission_autoblocking_data":{},"plugins":{},"popups":{},"ppapi_broker":{},"protocol_handler":{},"sensors":{},"site_engagement":{},"sound":{},"ssl_cert_decisions":{},"subresource_filter":{},"subresource_filter_data":{},"usb_chooser_data":{},"usb_guard":{}},"pref_version":1},"created_by_version":"73.0.62.51","exit_type":"Crashed","exited_cleanly":true,"managed_user_id":"","name":"Person 1"},"signin":{"allowed":false},"translate_site_blacklist_with_time":{}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion063WithRewardsAndAdsDisabled b/test/data/rewards-data/migration/PreferencesForVersion063WithRewardsAndAdsDisabled new file mode 100644 index 00000000000..0a8b3a11ae6 --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion063WithRewardsAndAdsDisabled @@ -0,0 +1 @@ +{"account_id_migration_state":2,"account_tracker_service_last_update":"13209349502592944","apps":{"shortcuts_version":5},"autocomplete":{"retention_policy_last_version":74},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"brave":{"brave_ads":{"enabled":false,"idle_threshold":15,"prefs":{"migrated":{"from_0_62":{"x":false}}}},"rewards":{"enabled":false,"enabled_migrated":true,"notifications":"{\"displayed\":[],\"notifications\":[]}"}},"browser":{"has_seen_welcome_page":true,"last_google_search_domain_mixing_metrics_time":"13209361200000000","window_placement":{"bottom":1368,"left":22,"maximized":false,"right":1222,"top":45,"work_area_bottom":1390,"work_area_left":0,"work_area_right":2560,"work_area_top":23}},"countryid_at_install":18242,"data_reduction":{"daily_original_length":[],"daily_original_length_application":"0","daily_original_length_unknown":"0","daily_original_length_via_data_reduction_proxy":[],"daily_original_length_via_data_reduction_proxy_application":"0","daily_original_length_via_data_reduction_proxy_unknown":"0","daily_original_length_via_data_reduction_proxy_video":"0","daily_original_length_video":"0","daily_original_length_with_data_reduction_proxy_enabled":[],"daily_original_length_with_data_reduction_proxy_enabled_application":"0","daily_original_length_with_data_reduction_proxy_enabled_unknown":"0","daily_original_length_with_data_reduction_proxy_enabled_video":"0","daily_received_length":[],"daily_received_length_application":"0","daily_received_length_https_with_data_reduction_proxy_enabled":[],"daily_received_length_long_bypass_with_data_reduction_proxy_enabled":[],"daily_received_length_short_bypass_with_data_reduction_proxy_enabled":[],"daily_received_length_unknown":"0","daily_received_length_unknown_with_data_reduction_proxy_enabled":[],"daily_received_length_via_data_reduction_proxy":[],"daily_received_length_via_data_reduction_proxy_application":"0","daily_received_length_via_data_reduction_proxy_unknown":"0","daily_received_length_via_data_reduction_proxy_video":"0","daily_received_length_video":"0","daily_received_length_with_data_reduction_proxy_enabled":[],"daily_received_length_with_data_reduction_proxy_enabled_application":"0","daily_received_length_with_data_reduction_proxy_enabled_unknown":"0","daily_received_length_with_data_reduction_proxy_enabled_video":"0","last_update_date":"0","network_properties":{},"this_week_number":2587},"default_apps_install_state":3,"extensions":{"alerts":{"initialized":true},"chrome_url_overrides":{},"last_chrome_version":"74.0.63.55"},"gcm":{"product_category_for_subtypes":"com.brave.macosx"},"google":{"services":{"signin_scoped_device_id":"e3538305-7245-4204-8144-1f1cb2fa41f1"}},"http_original_content_length":"0","http_received_content_length":"0","invalidator":{"client_id":"AjMLU8+7yj9MC+II5nPQhw=="},"language_model_counters":{"en":4},"media":{"device_id_salt":"A2E445F12CE78EEE4A19FCADE5375CD1","engagement":{"schema_version":4}},"ntp":{"num_personal_suggestions":1},"plugins":{"plugins_list":[]},"previews":{"litepage":{"user-needs-notification":false}},"profile":{"avatar_bubble_tutorial_shown":2,"avatar_index":26,"content_settings":{"exceptions":{"accessibility_events":{},"app_banner":{},"auto_select_certificate":{},"automatic_downloads":{},"autoplay":{},"background_sync":{},"bluetooth_guard":{},"client_hints":{},"clipboard":{},"cookies":{},"durable_storage":{},"flash_data":{},"geolocation":{},"images":{},"important_site_info":{},"intent_picker_auto_display":{},"javascript":{},"media_engagement":{},"media_stream_camera":{},"media_stream_mic":{},"midi_sysex":{},"mixed_script":{},"notifications":{},"password_protection":{},"payment_handler":{},"permission_autoblocking_data":{},"plugins":{},"popups":{},"ppapi_broker":{},"protocol_handler":{},"sensors":{},"serial_chooser_data":{},"serial_guard":{},"site_engagement":{},"sound":{},"ssl_cert_decisions":{},"subresource_filter":{},"subresource_filter_data":{},"usb_chooser_data":{},"usb_guard":{}},"pref_version":1},"created_by_version":"74.0.63.55","exit_type":"Normal","exited_cleanly":true,"managed_user_id":"","name":"Person 1"},"signin":{"allowed":false},"translate_site_blacklist_with_time":{}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion063WithRewardsAndAdsEnabled b/test/data/rewards-data/migration/PreferencesForVersion063WithRewardsAndAdsEnabled new file mode 100644 index 00000000000..5142534d8e0 --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion063WithRewardsAndAdsEnabled @@ -0,0 +1 @@ +{"plugins":{"plugins_list":[]},"apps":{"shortcuts_version":5},"http_original_content_length":"0","countryid_at_install":18242,"data_reduction":{"daily_original_length":[],"daily_received_length_via_data_reduction_proxy":[],"daily_original_length_via_data_reduction_proxy_video":"0","daily_original_length_with_data_reduction_proxy_enabled":[],"daily_original_length_with_data_reduction_proxy_enabled_unknown":"0","last_update_date":"0","daily_original_length_via_data_reduction_proxy_application":"0","daily_received_length_https_with_data_reduction_proxy_enabled":[],"daily_original_length_with_data_reduction_proxy_enabled_video":"0","daily_received_length_via_data_reduction_proxy_video":"0","daily_received_length":[],"daily_original_length_unknown":"0","daily_received_length_via_data_reduction_proxy_unknown":"0","daily_received_length_with_data_reduction_proxy_enabled_unknown":"0","daily_received_length_short_bypass_with_data_reduction_proxy_enabled":[],"daily_received_length_via_data_reduction_proxy_application":"0","daily_received_length_with_data_reduction_proxy_enabled":[],"daily_received_length_with_data_reduction_proxy_enabled_video":"0","daily_received_length_unknown_with_data_reduction_proxy_enabled":[],"daily_original_length_via_data_reduction_proxy":[],"daily_original_length_via_data_reduction_proxy_unknown":"0","network_properties":{},"daily_original_length_with_data_reduction_proxy_enabled_application":"0","daily_original_length_application":"0","daily_received_length_video":"0","daily_received_length_with_data_reduction_proxy_enabled_application":"0","daily_original_length_video":"0","daily_received_length_unknown":"0","this_week_number":2587,"daily_received_length_application":"0","daily_received_length_long_bypass_with_data_reduction_proxy_enabled":[]},"google":{"services":{"signin_scoped_device_id":"1d96d7e5-6719-4655-a335-ed587f9d0545"}},"profile":{"avatar_index":26,"exit_type":"Normal","created_by_version":"74.0.63.55","avatar_bubble_tutorial_shown":2,"managed_user_id":"","content_settings":{"pref_version":1,"exceptions":{"cookies":{},"ssl_cert_decisions":{},"serial_guard":{},"clipboard":{},"auto_select_certificate":{},"javascript":{},"durable_storage":{},"permission_autoblocking_data":{},"popups":{},"client_hints":{},"sensors":{},"media_engagement":{},"notifications":{},"flash_data":{},"password_protection":{},"autoplay":{},"midi_sysex":{},"intent_picker_auto_display":{},"bluetooth_guard":{},"mixed_script":{},"protocol_handler":{},"serial_chooser_data":{},"images":{},"background_sync":{},"important_site_info":{},"subresource_filter":{},"payment_handler":{},"geolocation":{},"ppapi_broker":{},"subresource_filter_data":{},"media_stream_camera":{},"usb_chooser_data":{},"sound":{},"usb_guard":{},"site_engagement":{},"plugins":{},"accessibility_events":{},"media_stream_mic":{},"app_banner":{},"automatic_downloads":{}}},"exited_cleanly":true,"name":"Person 1"},"http_received_content_length":"0","gcm":{"product_category_for_subtypes":"com.brave.macosx"},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"media":{"device_id_salt":"A2E445F12CE78EEE4A19FCADE5375CD1","engagement":{"schema_version":4}},"account_id_migration_state":2,"browser":{"has_seen_welcome_page":true,"last_google_search_domain_mixing_metrics_time":"13209361200000000","window_placement":{"bottom":1368,"work_area_bottom":1390,"maximized":false,"work_area_right":2560,"left":22,"right":1222,"top":45,"work_area_left":0,"work_area_top":23}},"previews":{"litepage":{"user-needs-notification":false}},"invalidator":{"client_id":"AjMLU8+7yj9MC+II5nPQhw=="},"account_tracker_service_last_update":"13209349502592944","autocomplete":{"retention_policy_last_version":74},"translate_site_blacklist_with_time":{},"language_model_counters":{"en":2},"extensions":{"last_chrome_version":"74.0.63.55","alerts":{"initialized":true},"chrome_url_overrides":{}},"ntp":{"num_personal_suggestions":1},"brave":{"rewards":{"enabled":true,"notifications":"{\"displayed\":[],\"notifications\":[]}","enabled_migrated":true},"brave_ads":{"enabled":true,"prefs":{"migrated":{"from_0_62":{"x":false}}}}},"default_apps_install_state":3,"signin":{"allowed":false}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion063WithRewardsEnabledAndAdsDisabled b/test/data/rewards-data/migration/PreferencesForVersion063WithRewardsEnabledAndAdsDisabled new file mode 100644 index 00000000000..0b056094c1a --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion063WithRewardsEnabledAndAdsDisabled @@ -0,0 +1 @@ +{"plugins":{"plugins_list":[]},"apps":{"shortcuts_version":5},"http_original_content_length":"0","countryid_at_install":18242,"data_reduction":{"daily_original_length":[],"daily_received_length_via_data_reduction_proxy":[],"daily_original_length_via_data_reduction_proxy_video":"0","daily_original_length_with_data_reduction_proxy_enabled":[],"daily_original_length_with_data_reduction_proxy_enabled_unknown":"0","last_update_date":"0","daily_original_length_via_data_reduction_proxy_application":"0","daily_received_length_https_with_data_reduction_proxy_enabled":[],"daily_original_length_with_data_reduction_proxy_enabled_video":"0","daily_received_length_via_data_reduction_proxy_video":"0","daily_received_length":[],"daily_original_length_unknown":"0","daily_received_length_via_data_reduction_proxy_unknown":"0","daily_received_length_with_data_reduction_proxy_enabled_unknown":"0","daily_received_length_short_bypass_with_data_reduction_proxy_enabled":[],"daily_received_length_via_data_reduction_proxy_application":"0","daily_received_length_with_data_reduction_proxy_enabled":[],"daily_received_length_with_data_reduction_proxy_enabled_video":"0","daily_received_length_unknown_with_data_reduction_proxy_enabled":[],"daily_original_length_via_data_reduction_proxy":[],"daily_original_length_via_data_reduction_proxy_unknown":"0","network_properties":{},"daily_original_length_with_data_reduction_proxy_enabled_application":"0","daily_original_length_application":"0","daily_received_length_video":"0","daily_received_length_with_data_reduction_proxy_enabled_application":"0","daily_original_length_video":"0","daily_received_length_unknown":"0","this_week_number":2587,"daily_received_length_application":"0","daily_received_length_long_bypass_with_data_reduction_proxy_enabled":[]},"google":{"services":{"signin_scoped_device_id":"98dceb59-792e-4c7a-b14e-b04d435ff22e"}},"profile":{"avatar_index":26,"exit_type":"Normal","created_by_version":"74.0.63.55","avatar_bubble_tutorial_shown":2,"managed_user_id":"","content_settings":{"pref_version":1,"exceptions":{"cookies":{},"ssl_cert_decisions":{},"serial_guard":{},"clipboard":{},"auto_select_certificate":{},"javascript":{},"durable_storage":{},"permission_autoblocking_data":{},"popups":{},"client_hints":{},"sensors":{},"media_engagement":{},"notifications":{},"flash_data":{},"password_protection":{},"autoplay":{},"midi_sysex":{},"intent_picker_auto_display":{},"bluetooth_guard":{},"mixed_script":{},"protocol_handler":{},"serial_chooser_data":{},"images":{},"background_sync":{},"important_site_info":{},"subresource_filter":{},"payment_handler":{},"geolocation":{},"ppapi_broker":{},"subresource_filter_data":{},"media_stream_camera":{},"usb_chooser_data":{},"sound":{},"usb_guard":{},"site_engagement":{},"plugins":{},"accessibility_events":{},"media_stream_mic":{},"app_banner":{},"automatic_downloads":{}}},"exited_cleanly":true,"name":"Person 1"},"http_received_content_length":"0","gcm":{"product_category_for_subtypes":"com.brave.macosx"},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"media":{"device_id_salt":"A2E445F12CE78EEE4A19FCADE5375CD1","engagement":{"schema_version":4}},"account_id_migration_state":2,"browser":{"has_seen_welcome_page":true,"last_google_search_domain_mixing_metrics_time":"13209361200000000","window_placement":{"bottom":1368,"work_area_bottom":1390,"maximized":false,"work_area_right":2560,"left":22,"right":1222,"top":45,"work_area_left":0,"work_area_top":23}},"previews":{"litepage":{"user-needs-notification":false}},"invalidator":{"client_id":"AjMLU8+7yj9MC+II5nPQhw=="},"account_tracker_service_last_update":"13209349502592944","autocomplete":{"retention_policy_last_version":74},"translate_site_blacklist_with_time":{},"language_model_counters":{"en":3},"extensions":{"last_chrome_version":"74.0.63.55","alerts":{"initialized":true},"chrome_url_overrides":{}},"ntp":{"num_personal_suggestions":1},"brave":{"rewards":{"enabled":true,"notifications":"{\"displayed\":[],\"notifications\":[]}","enabled_migrated":true},"brave_ads":{"enabled":false,"prefs":{"migrated":{"from_0_62":{"x":false}}}}},"default_apps_install_state":3,"signin":{"allowed":false}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion067WithRewardsAndAdsDisabled b/test/data/rewards-data/migration/PreferencesForVersion067WithRewardsAndAdsDisabled new file mode 100644 index 00000000000..1d13d655030 --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion067WithRewardsAndAdsDisabled @@ -0,0 +1 @@ +{"account_id_migration_state":2,"account_tracker_service_last_update":"13209474206264124","apps":{"shortcuts_version":6},"autocomplete":{"retention_policy_last_version":76},"autofill":{"japan_city_field_migrated_to_street_address":true,"last_version_validated":76,"orphan_rows_removed":true},"brave":{"brave_ads":{"enabled":false,"has_removed_first_launch_notification":true,"idle_threshold":15,"launch_notification_timestamp":"0","prefs":{"version":3},"should_show_first_launch_notification":false},"rewards":{"enabled":false,"enabled_migrated":true,"notifications":"{\"displayed\":[],\"notifications\":[]}"}},"browser":{"has_seen_welcome_page":true,"last_google_search_domain_mixing_metrics_time":"13209447600000000","window_placement":{"bottom":1390,"left":680,"maximized":false,"right":1880,"top":23,"work_area_bottom":1390,"work_area_left":0,"work_area_right":2560,"work_area_top":23}},"countryid_at_install":18242,"data_reduction":{"daily_original_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","7128813"],"daily_original_length_application":"7128813","daily_original_length_unknown":"0","daily_original_length_via_data_reduction_proxy":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_via_data_reduction_proxy_application":"0","daily_original_length_via_data_reduction_proxy_unknown":"0","daily_original_length_via_data_reduction_proxy_video":"0","daily_original_length_video":"0","daily_original_length_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_with_data_reduction_proxy_enabled_application":"0","daily_original_length_with_data_reduction_proxy_enabled_unknown":"0","daily_original_length_with_data_reduction_proxy_enabled_video":"0","daily_received_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","7128813"],"daily_received_length_application":"7128813","daily_received_length_https_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_long_bypass_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_short_bypass_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_unknown":"0","daily_received_length_unknown_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_via_data_reduction_proxy":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_via_data_reduction_proxy_application":"0","daily_received_length_via_data_reduction_proxy_unknown":"0","daily_received_length_via_data_reduction_proxy_video":"0","daily_received_length_video":"0","daily_received_length_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_with_data_reduction_proxy_enabled_application":"0","daily_received_length_with_data_reduction_proxy_enabled_unknown":"0","daily_received_length_with_data_reduction_proxy_enabled_video":"0","last_update_date":"13209433200000000","network_properties":{},"this_week_number":2587,"this_week_services_downstream_foreground_kb":{"23373669":0,"51242536":6961}},"default_apps_install_state":3,"download":{"directory_upgrade":true},"extensions":{"alerts":{"initialized":true},"chrome_url_overrides":{},"last_chrome_version":"76.0.67.123"},"gcm":{"product_category_for_subtypes":"com.brave.macosx"},"google":{"services":{"signin_scoped_device_id":"52c3e5f7-3057-49bd-aedd-93753830c61a"}},"http_original_content_length":"7128813","http_received_content_length":"7128813","invalidation":{"per_sender_topics_to_handler":{"8181035976":{}}},"invalidator":{"client_id":"8/wzVgos45zajcPHVoXf+Q=="},"language_model_counters":{"en":5},"media":{"device_id_salt":"51F3BF225859E1378132911F5628BFEA","engagement":{"schema_version":4}},"media_router":{"enable_media_router":false},"ntp":{"num_personal_suggestions":1},"plugins":{"plugins_list":[]},"previews":{"litepage":{"user-needs-notification":false},"offline_helper":{"available_pages":{}}},"profile":{"avatar_bubble_tutorial_shown":2,"avatar_index":26,"content_settings":{"exceptions":{"accessibility_events":{},"app_banner":{},"auto_select_certificate":{},"automatic_downloads":{},"autoplay":{},"background_sync":{},"bluetooth_guard":{},"bluetooth_scanning":{},"client_hints":{},"clipboard":{},"cookies":{},"durable_storage":{},"flash_data":{},"geolocation":{},"hid_chooser_data":{},"hid_guard":{},"images":{},"important_site_info":{},"intent_picker_auto_display":{},"javascript":{},"media_engagement":{},"media_stream_camera":{},"media_stream_mic":{},"midi_sysex":{},"mixed_script":{},"notifications":{},"password_protection":{},"payment_handler":{},"permission_autoblocking_data":{},"plugins":{},"popups":{},"ppapi_broker":{},"protocol_handler":{},"sensors":{},"serial_chooser_data":{},"serial_guard":{},"site_engagement":{},"sound":{},"ssl_cert_decisions":{},"subresource_filter":{},"subresource_filter_data":{},"usb_chooser_data":{},"usb_guard":{}},"pref_version":1},"created_by_version":"76.0.67.123","exit_type":"Normal","exited_cleanly":true,"managed_user_id":"","name":"Person 1"},"signin":{"allowed":false},"translate_site_blacklist_with_time":{}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion067WithRewardsAndAdsEnabled b/test/data/rewards-data/migration/PreferencesForVersion067WithRewardsAndAdsEnabled new file mode 100644 index 00000000000..7f82510ef97 --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion067WithRewardsAndAdsEnabled @@ -0,0 +1 @@ +{"account_id_migration_state":2,"account_tracker_service_last_update":"13209474206264124","apps":{"shortcuts_version":6},"autocomplete":{"retention_policy_last_version":76},"autofill":{"japan_city_field_migrated_to_street_address":true,"last_version_validated":76,"orphan_rows_removed":true},"brave":{"brave_ads":{"enabled":true,"has_removed_first_launch_notification":true,"idle_threshold":15,"launch_notification_timestamp":"0","prefs":{"version":3},"should_show_first_launch_notification":false},"rewards":{"enabled":true,"enabled_migrated":true,"notifications":"{\"displayed\":[],\"notifications\":[]}"}},"browser":{"has_seen_welcome_page":true,"last_google_search_domain_mixing_metrics_time":"13209447600000000","window_placement":{"bottom":1390,"left":680,"maximized":false,"right":1880,"top":23,"work_area_bottom":1390,"work_area_left":0,"work_area_right":2560,"work_area_top":23}},"countryid_at_install":18242,"data_reduction":{"daily_original_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","7128813"],"daily_original_length_application":"7128813","daily_original_length_unknown":"0","daily_original_length_via_data_reduction_proxy":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_via_data_reduction_proxy_application":"0","daily_original_length_via_data_reduction_proxy_unknown":"0","daily_original_length_via_data_reduction_proxy_video":"0","daily_original_length_video":"0","daily_original_length_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_with_data_reduction_proxy_enabled_application":"0","daily_original_length_with_data_reduction_proxy_enabled_unknown":"0","daily_original_length_with_data_reduction_proxy_enabled_video":"0","daily_received_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","7128813"],"daily_received_length_application":"7128813","daily_received_length_https_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_long_bypass_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_short_bypass_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_unknown":"0","daily_received_length_unknown_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_via_data_reduction_proxy":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_via_data_reduction_proxy_application":"0","daily_received_length_via_data_reduction_proxy_unknown":"0","daily_received_length_via_data_reduction_proxy_video":"0","daily_received_length_video":"0","daily_received_length_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_with_data_reduction_proxy_enabled_application":"0","daily_received_length_with_data_reduction_proxy_enabled_unknown":"0","daily_received_length_with_data_reduction_proxy_enabled_video":"0","last_update_date":"13209433200000000","network_properties":{},"this_week_number":2587,"this_week_services_downstream_foreground_kb":{"23373669":0,"51242536":6961}},"default_apps_install_state":3,"download":{"directory_upgrade":true},"extensions":{"alerts":{"initialized":true},"chrome_url_overrides":{},"last_chrome_version":"76.0.67.123"},"gcm":{"product_category_for_subtypes":"com.brave.macosx"},"google":{"services":{"signin_scoped_device_id":"28d98c6d-1066-4672-9c2f-bf48df11ec2c"}},"http_original_content_length":"7128813","http_received_content_length":"7128813","invalidation":{"per_sender_topics_to_handler":{"8181035976":{}}},"invalidator":{"client_id":"8/wzVgos45zajcPHVoXf+Q=="},"language_model_counters":{"en":3},"media":{"device_id_salt":"51F3BF225859E1378132911F5628BFEA","engagement":{"schema_version":4}},"media_router":{"enable_media_router":false},"ntp":{"num_personal_suggestions":1},"plugins":{"plugins_list":[]},"previews":{"litepage":{"user-needs-notification":false},"offline_helper":{"available_pages":{}}},"profile":{"avatar_bubble_tutorial_shown":2,"avatar_index":26,"content_settings":{"exceptions":{"accessibility_events":{},"app_banner":{},"auto_select_certificate":{},"automatic_downloads":{},"autoplay":{},"background_sync":{},"bluetooth_guard":{},"bluetooth_scanning":{},"client_hints":{},"clipboard":{},"cookies":{},"durable_storage":{},"flash_data":{},"geolocation":{},"hid_chooser_data":{},"hid_guard":{},"images":{},"important_site_info":{},"intent_picker_auto_display":{},"javascript":{},"media_engagement":{},"media_stream_camera":{},"media_stream_mic":{},"midi_sysex":{},"mixed_script":{},"notifications":{},"password_protection":{},"payment_handler":{},"permission_autoblocking_data":{},"plugins":{},"popups":{},"ppapi_broker":{},"protocol_handler":{},"sensors":{},"serial_chooser_data":{},"serial_guard":{},"site_engagement":{},"sound":{},"ssl_cert_decisions":{},"subresource_filter":{},"subresource_filter_data":{},"usb_chooser_data":{},"usb_guard":{}},"pref_version":1},"created_by_version":"76.0.67.123","exit_type":"Normal","exited_cleanly":true,"managed_user_id":"","name":"Person 1"},"signin":{"allowed":false},"translate_site_blacklist_with_time":{}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion067WithRewardsEnabledAndAdsDisabled b/test/data/rewards-data/migration/PreferencesForVersion067WithRewardsEnabledAndAdsDisabled new file mode 100644 index 00000000000..1f71f154106 --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion067WithRewardsEnabledAndAdsDisabled @@ -0,0 +1 @@ +{"signin":{"allowed":false},"plugins":{"plugins_list":[]},"google":{"services":{"signin_scoped_device_id":"cfaa399d-2bc1-4015-baec-ce52a3ce2372"}},"http_original_content_length":"7128813","countryid_at_install":18242,"data_reduction":{"daily_original_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","7128813"],"daily_received_length_via_data_reduction_proxy":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_via_data_reduction_proxy_video":"0","daily_original_length_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_with_data_reduction_proxy_enabled_unknown":"0","last_update_date":"13209433200000000","daily_original_length_via_data_reduction_proxy_application":"0","daily_received_length_https_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_with_data_reduction_proxy_enabled_video":"0","daily_received_length_via_data_reduction_proxy_video":"0","daily_received_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","7128813"],"daily_original_length_unknown":"0","daily_received_length_via_data_reduction_proxy_unknown":"0","daily_received_length_with_data_reduction_proxy_enabled_unknown":"0","daily_received_length_short_bypass_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_via_data_reduction_proxy_application":"0","daily_received_length_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_with_data_reduction_proxy_enabled_video":"0","daily_received_length_unknown_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_via_data_reduction_proxy":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_via_data_reduction_proxy_unknown":"0","this_week_services_downstream_foreground_kb":{"51242536":6961,"23373669":0},"network_properties":{},"daily_original_length_with_data_reduction_proxy_enabled_application":"0","daily_original_length_application":"7128813","daily_received_length_video":"0","daily_received_length_with_data_reduction_proxy_enabled_application":"0","daily_original_length_video":"0","daily_received_length_unknown":"0","this_week_number":2587,"daily_received_length_application":"7128813","daily_received_length_long_bypass_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]},"apps":{"shortcuts_version":6},"profile":{"avatar_index":26,"exit_type":"Normal","created_by_version":"76.0.67.123","avatar_bubble_tutorial_shown":2,"managed_user_id":"","content_settings":{"pref_version":1,"exceptions":{"cookies":{},"ssl_cert_decisions":{},"clipboard":{},"serial_guard":{},"auto_select_certificate":{},"javascript":{},"durable_storage":{},"permission_autoblocking_data":{},"popups":{},"client_hints":{},"sensors":{},"media_engagement":{},"notifications":{},"flash_data":{},"password_protection":{},"autoplay":{},"midi_sysex":{},"intent_picker_auto_display":{},"bluetooth_guard":{},"mixed_script":{},"protocol_handler":{},"serial_chooser_data":{},"hid_guard":{},"images":{},"background_sync":{},"important_site_info":{},"bluetooth_scanning":{},"hid_chooser_data":{},"geolocation":{},"payment_handler":{},"ppapi_broker":{},"media_stream_camera":{},"subresource_filter":{},"sound":{},"subresource_filter_data":{},"usb_chooser_data":{},"site_engagement":{},"usb_guard":{},"plugins":{},"accessibility_events":{},"media_stream_mic":{},"app_banner":{},"automatic_downloads":{}}},"exited_cleanly":true,"name":"Person 1"},"media_router":{"enable_media_router":false},"http_received_content_length":"7128813","gcm":{"product_category_for_subtypes":"com.brave.macosx"},"autofill":{"japan_city_field_migrated_to_street_address":true,"last_version_validated":76,"orphan_rows_removed":true},"invalidation":{"per_sender_topics_to_handler":{"8181035976":{}}},"media":{"device_id_salt":"51F3BF225859E1378132911F5628BFEA","engagement":{"schema_version":4}},"account_id_migration_state":2,"browser":{"has_seen_welcome_page":true,"last_google_search_domain_mixing_metrics_time":"13209447600000000","window_placement":{"bottom":1390,"work_area_bottom":1390,"maximized":false,"work_area_right":2560,"left":680,"right":1880,"top":23,"work_area_left":0,"work_area_top":23}},"previews":{"litepage":{"user-needs-notification":false},"offline_helper":{"available_pages":{}}},"invalidator":{"client_id":"8/wzVgos45zajcPHVoXf+Q=="},"account_tracker_service_last_update":"13209474206264124","autocomplete":{"retention_policy_last_version":76},"translate_site_blacklist_with_time":{},"language_model_counters":{"en":4},"extensions":{"last_chrome_version":"76.0.67.123","alerts":{"initialized":true},"chrome_url_overrides":{}},"download":{"directory_upgrade":true},"brave":{"rewards":{"enabled":true,"notifications":"{\"displayed\":[],\"notifications\":[]}","enabled_migrated":true},"brave_ads":{"prefs":{"version":3},"enabled":false}},"default_apps_install_state":3,"ntp":{"num_personal_suggestions":1}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion068WithRewardsAndAdsDisabled b/test/data/rewards-data/migration/PreferencesForVersion068WithRewardsAndAdsDisabled new file mode 100644 index 00000000000..5d8cbd52a1e --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion068WithRewardsAndAdsDisabled @@ -0,0 +1 @@ +{"account_id_migration_state":2,"account_tracker_service_last_update":"13209474689657066","apps":{"shortcuts_version":6},"autocomplete":{"retention_policy_last_version":76},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"brave":{"brave_ads":{"enabled":false,"has_removed_first_launch_notification":true,"idle_threshold":15,"launch_notification_timestamp":"0","prefs":{"version":3},"should_show_first_launch_notification":false},"rewards":{"enabled":false,"enabled_migrated":true,"notifications":"{\"displayed\":[],\"notifications\":[]}"}},"browser":{"has_seen_welcome_page":true,"window_placement":{"bottom":1390,"left":680,"maximized":false,"right":1880,"top":23,"work_area_bottom":1390,"work_area_left":0,"work_area_right":2560,"work_area_top":23}},"countryid_at_install":18242,"data_reduction":{"daily_original_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","7139468"],"daily_original_length_application":"7139468","daily_original_length_unknown":"0","daily_original_length_via_data_reduction_proxy":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_via_data_reduction_proxy_application":"0","daily_original_length_via_data_reduction_proxy_unknown":"0","daily_original_length_via_data_reduction_proxy_video":"0","daily_original_length_video":"0","daily_original_length_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_with_data_reduction_proxy_enabled_application":"0","daily_original_length_with_data_reduction_proxy_enabled_unknown":"0","daily_original_length_with_data_reduction_proxy_enabled_video":"0","daily_received_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","7139468"],"daily_received_length_application":"7139468","daily_received_length_https_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_long_bypass_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_short_bypass_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_unknown":"0","daily_received_length_unknown_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_via_data_reduction_proxy":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_via_data_reduction_proxy_application":"0","daily_received_length_via_data_reduction_proxy_unknown":"0","daily_received_length_via_data_reduction_proxy_video":"0","daily_received_length_video":"0","daily_received_length_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_with_data_reduction_proxy_enabled_application":"0","daily_received_length_with_data_reduction_proxy_enabled_unknown":"0","daily_received_length_with_data_reduction_proxy_enabled_video":"0","last_update_date":"13209433200000000","network_properties":{},"this_week_number":2587,"this_week_services_downstream_foreground_kb":{"23373669":1,"51242536":6968}},"default_apps_install_state":3,"extensions":{"alerts":{"initialized":true},"chrome_url_overrides":{},"last_chrome_version":"76.0.68.116"},"gcm":{"product_category_for_subtypes":"com.brave.macosx"},"google":{"services":{"signin_scoped_device_id":"c9d2b778-e37a-4bff-afc2-9fba4b813d03"}},"http_original_content_length":"7139468","http_received_content_length":"7139468","invalidator":{"client_id":"0koCgJodjYKtRlteHCB7IA=="},"language_model_counters":{"en":5},"media":{"device_id_salt":"D2852D123B2CB4BF44E325242DE0E173","engagement":{"schema_version":4}},"media_router":{"enable_media_router":false},"ntp":{"num_personal_suggestions":1},"plugins":{"plugins_list":[]},"previews":{"litepage":{"user-needs-notification":false},"offline_helper":{"available_pages":{}}},"profile":{"avatar_bubble_tutorial_shown":2,"avatar_index":26,"content_settings":{"exceptions":{"accessibility_events":{},"app_banner":{},"auto_select_certificate":{},"automatic_downloads":{},"autoplay":{},"background_sync":{},"bluetooth_guard":{},"bluetooth_scanning":{},"client_hints":{},"clipboard":{},"cookies":{},"durable_storage":{},"flash_data":{},"geolocation":{},"hid_chooser_data":{},"hid_guard":{},"images":{},"important_site_info":{},"intent_picker_auto_display":{},"javascript":{},"media_engagement":{},"media_stream_camera":{},"media_stream_mic":{},"midi_sysex":{},"mixed_script":{},"notifications":{},"password_protection":{},"payment_handler":{},"permission_autoblocking_data":{},"plugins":{},"popups":{},"ppapi_broker":{},"protocol_handler":{},"sensors":{},"serial_chooser_data":{},"serial_guard":{},"site_engagement":{},"sound":{},"ssl_cert_decisions":{},"subresource_filter":{},"subresource_filter_data":{},"usb_chooser_data":{},"usb_guard":{}},"pref_version":1},"created_by_version":"76.0.68.116","exit_type":"Normal","exited_cleanly":true,"managed_user_id":"","name":"Person 1"},"signin":{"allowed":false},"translate_site_blacklist_with_time":{}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion068WithRewardsAndAdsEnabled b/test/data/rewards-data/migration/PreferencesForVersion068WithRewardsAndAdsEnabled new file mode 100644 index 00000000000..70dbe1e9e37 --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion068WithRewardsAndAdsEnabled @@ -0,0 +1 @@ +{"account_id_migration_state":2,"account_tracker_service_last_update":"13209474689657066","apps":{"shortcuts_version":6},"autocomplete":{"retention_policy_last_version":76},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"brave":{"brave_ads":{"enabled":true,"has_removed_first_launch_notification":true,"idle_threshold":15,"launch_notification_timestamp":"0","prefs":{"version":3},"should_show_first_launch_notification":false},"rewards":{"enabled":true,"enabled_migrated":true,"notifications":"{\"displayed\":[],\"notifications\":[]}"}},"browser":{"has_seen_welcome_page":true,"window_placement":{"bottom":1390,"left":911,"maximized":false,"right":2111,"top":23,"work_area_bottom":1390,"work_area_left":0,"work_area_right":2560,"work_area_top":23}},"countryid_at_install":18242,"data_reduction":{"daily_original_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","7130865"],"daily_original_length_application":"7130865","daily_original_length_unknown":"0","daily_original_length_via_data_reduction_proxy":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_via_data_reduction_proxy_application":"0","daily_original_length_via_data_reduction_proxy_unknown":"0","daily_original_length_via_data_reduction_proxy_video":"0","daily_original_length_video":"0","daily_original_length_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_with_data_reduction_proxy_enabled_application":"0","daily_original_length_with_data_reduction_proxy_enabled_unknown":"0","daily_original_length_with_data_reduction_proxy_enabled_video":"0","daily_received_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","7130865"],"daily_received_length_application":"7130865","daily_received_length_https_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_long_bypass_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_short_bypass_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_unknown":"0","daily_received_length_unknown_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_via_data_reduction_proxy":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_via_data_reduction_proxy_application":"0","daily_received_length_via_data_reduction_proxy_unknown":"0","daily_received_length_via_data_reduction_proxy_video":"0","daily_received_length_video":"0","daily_received_length_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_with_data_reduction_proxy_enabled_application":"0","daily_received_length_with_data_reduction_proxy_enabled_unknown":"0","daily_received_length_with_data_reduction_proxy_enabled_video":"0","last_update_date":"13209433200000000","network_properties":{},"this_week_number":2587,"this_week_services_downstream_foreground_kb":{"23373669":1,"51242536":6961}},"default_apps_install_state":3,"extensions":{"alerts":{"initialized":true},"chrome_url_overrides":{},"last_chrome_version":"76.0.68.116"},"gcm":{"product_category_for_subtypes":"com.brave.macosx"},"google":{"services":{"signin_scoped_device_id":"01cff0ef-4af0-486a-8e5f-579aa474f3e1"}},"http_original_content_length":"7130865","http_received_content_length":"7130865","invalidator":{"client_id":"0koCgJodjYKtRlteHCB7IA=="},"language_model_counters":{"en":3},"media":{"device_id_salt":"D2852D123B2CB4BF44E325242DE0E173","engagement":{"schema_version":4}},"media_router":{"enable_media_router":false},"ntp":{"num_personal_suggestions":1},"plugins":{"plugins_list":[]},"previews":{"litepage":{"user-needs-notification":false},"offline_helper":{"available_pages":{}}},"profile":{"avatar_bubble_tutorial_shown":2,"avatar_index":26,"content_settings":{"exceptions":{"accessibility_events":{},"app_banner":{},"auto_select_certificate":{},"automatic_downloads":{},"autoplay":{},"background_sync":{},"bluetooth_guard":{},"bluetooth_scanning":{},"client_hints":{},"clipboard":{},"cookies":{},"durable_storage":{},"flash_data":{},"geolocation":{},"hid_chooser_data":{},"hid_guard":{},"images":{},"important_site_info":{},"intent_picker_auto_display":{},"javascript":{},"media_engagement":{},"media_stream_camera":{},"media_stream_mic":{},"midi_sysex":{},"mixed_script":{},"notifications":{},"password_protection":{},"payment_handler":{},"permission_autoblocking_data":{},"plugins":{},"popups":{},"ppapi_broker":{},"protocol_handler":{},"sensors":{},"serial_chooser_data":{},"serial_guard":{},"site_engagement":{},"sound":{},"ssl_cert_decisions":{},"subresource_filter":{},"subresource_filter_data":{},"usb_chooser_data":{},"usb_guard":{}},"pref_version":1},"created_by_version":"76.0.68.116","exit_type":"Normal","exited_cleanly":true,"managed_user_id":"","name":"Person 1"},"signin":{"allowed":false},"translate_site_blacklist_with_time":{}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion068WithRewardsEnabledAndAdsDisabled b/test/data/rewards-data/migration/PreferencesForVersion068WithRewardsEnabledAndAdsDisabled new file mode 100644 index 00000000000..316bfdfc2e9 --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion068WithRewardsEnabledAndAdsDisabled @@ -0,0 +1 @@ +{"plugins":{"plugins_list":[]},"apps":{"shortcuts_version":6},"http_original_content_length":"7136921","countryid_at_install":18242,"data_reduction":{"daily_original_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","7136921"],"daily_received_length_via_data_reduction_proxy":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_via_data_reduction_proxy_video":"0","daily_original_length_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_with_data_reduction_proxy_enabled_unknown":"0","last_update_date":"13209433200000000","daily_original_length_via_data_reduction_proxy_application":"0","daily_received_length_https_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_with_data_reduction_proxy_enabled_video":"0","daily_received_length_via_data_reduction_proxy_video":"0","daily_received_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","7136921"],"daily_original_length_unknown":"0","daily_received_length_via_data_reduction_proxy_unknown":"0","daily_received_length_with_data_reduction_proxy_enabled_unknown":"0","daily_received_length_short_bypass_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_via_data_reduction_proxy_application":"0","daily_received_length_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_with_data_reduction_proxy_enabled_video":"0","daily_received_length_unknown_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_via_data_reduction_proxy":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_via_data_reduction_proxy_unknown":"0","this_week_services_downstream_foreground_kb":{"51242536":6966,"23373669":1},"network_properties":{},"daily_original_length_with_data_reduction_proxy_enabled_application":"0","daily_original_length_application":"7136921","daily_received_length_video":"0","daily_received_length_with_data_reduction_proxy_enabled_application":"0","daily_original_length_video":"0","daily_received_length_unknown":"0","this_week_number":2587,"daily_received_length_application":"7136921","daily_received_length_long_bypass_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]},"google":{"services":{"signin_scoped_device_id":"e7dc389c-678c-4863-bd57-d3f1eba33229"}},"profile":{"avatar_index":26,"exit_type":"Normal","created_by_version":"76.0.68.116","avatar_bubble_tutorial_shown":2,"managed_user_id":"","content_settings":{"pref_version":1,"exceptions":{"cookies":{},"ssl_cert_decisions":{},"clipboard":{},"serial_guard":{},"auto_select_certificate":{},"javascript":{},"durable_storage":{},"permission_autoblocking_data":{},"popups":{},"client_hints":{},"sensors":{},"media_engagement":{},"notifications":{},"flash_data":{},"password_protection":{},"autoplay":{},"midi_sysex":{},"intent_picker_auto_display":{},"bluetooth_guard":{},"mixed_script":{},"protocol_handler":{},"serial_chooser_data":{},"hid_guard":{},"images":{},"background_sync":{},"important_site_info":{},"bluetooth_scanning":{},"hid_chooser_data":{},"geolocation":{},"payment_handler":{},"ppapi_broker":{},"media_stream_camera":{},"subresource_filter":{},"sound":{},"subresource_filter_data":{},"usb_chooser_data":{},"site_engagement":{},"usb_guard":{},"plugins":{},"accessibility_events":{},"media_stream_mic":{},"app_banner":{},"automatic_downloads":{}}},"exited_cleanly":true,"name":"Person 1"},"media_router":{"enable_media_router":false},"http_received_content_length":"7136921","gcm":{"product_category_for_subtypes":"com.brave.macosx"},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"media":{"device_id_salt":"D2852D123B2CB4BF44E325242DE0E173","engagement":{"schema_version":4}},"account_id_migration_state":2,"browser":{"has_seen_welcome_page":true,"window_placement":{"bottom":1390,"work_area_bottom":1390,"maximized":false,"work_area_right":2560,"left":911,"right":2111,"top":23,"work_area_left":0,"work_area_top":23}},"previews":{"litepage":{"user-needs-notification":false},"offline_helper":{"available_pages":{}}},"invalidator":{"client_id":"0koCgJodjYKtRlteHCB7IA=="},"account_tracker_service_last_update":"13209474689657066","autocomplete":{"retention_policy_last_version":76},"translate_site_blacklist_with_time":{},"language_model_counters":{"en":4},"extensions":{"last_chrome_version":"76.0.68.116","alerts":{"initialized":true},"chrome_url_overrides":{}},"ntp":{"num_personal_suggestions":1},"brave":{"rewards":{"enabled":true,"notifications":"{\"displayed\":[],\"notifications\":[]}","enabled_migrated":true},"brave_ads":{"prefs":{"version":3},"enabled":false}},"default_apps_install_state":3,"signin":{"allowed":false}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion069WithRewardsAndAdsDisabled b/test/data/rewards-data/migration/PreferencesForVersion069WithRewardsAndAdsDisabled new file mode 100644 index 00000000000..59c88545f19 --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion069WithRewardsAndAdsDisabled @@ -0,0 +1 @@ +{"account_id_migration_state":2,"account_tracker_service_last_update":"13209474884161520","apps":{"shortcuts_version":6},"autocomplete":{"retention_policy_last_version":76},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"brave":{"brave_ads":{"enabled":false,"has_removed_first_launch_notification":true,"idle_threshold":15,"launch_notification_timestamp":"0","prefs":{"version":3},"should_show_first_launch_notification":false},"rewards":{"enabled":false,"enabled_migrated":true,"external_wallets":{"uphold":{"address":"","one_time_string":"6E3E5A98636D337A5315A253EB70B9BBB23C4F280AECA193A96D1392A4ECA586","status":0,"token":"","transferred":false,"user_name":""}},"notifications":"{\"displayed\":[],\"notifications\":[]}"}},"browser":{"default_browser_infobar_last_declined":"13209474962805451","has_seen_welcome_page":true,"window_placement":{"bottom":1390,"left":680,"maximized":false,"right":1880,"top":23,"work_area_bottom":1390,"work_area_left":0,"work_area_right":2560,"work_area_top":23}},"countryid_at_install":18242,"data_reduction":{"daily_original_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","3532332"],"daily_original_length_application":"3532332","daily_original_length_unknown":"0","daily_original_length_via_data_reduction_proxy":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_via_data_reduction_proxy_application":"0","daily_original_length_via_data_reduction_proxy_unknown":"0","daily_original_length_via_data_reduction_proxy_video":"0","daily_original_length_video":"0","daily_original_length_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_with_data_reduction_proxy_enabled_application":"0","daily_original_length_with_data_reduction_proxy_enabled_unknown":"0","daily_original_length_with_data_reduction_proxy_enabled_video":"0","daily_received_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","3532332"],"daily_received_length_application":"3532332","daily_received_length_https_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_long_bypass_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_short_bypass_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_unknown":"0","daily_received_length_unknown_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_via_data_reduction_proxy":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_via_data_reduction_proxy_application":"0","daily_received_length_via_data_reduction_proxy_unknown":"0","daily_received_length_via_data_reduction_proxy_video":"0","daily_received_length_video":"0","daily_received_length_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_with_data_reduction_proxy_enabled_application":"0","daily_received_length_with_data_reduction_proxy_enabled_unknown":"0","daily_received_length_with_data_reduction_proxy_enabled_video":"0","last_update_date":"13209433200000000","network_properties":{},"this_week_number":2587,"this_week_services_downstream_foreground_kb":{"23373669":1,"51242536":3446}},"default_apps_install_state":3,"extensions":{"alerts":{"initialized":true},"chrome_url_overrides":{},"last_chrome_version":"76.0.69.98"},"gcm":{"product_category_for_subtypes":"com.brave.macosx"},"google":{"services":{"signin_scoped_device_id":"96b18963-db6b-4eb6-9432-78fec482cab1"}},"http_original_content_length":"3532332","http_received_content_length":"3532332","invalidator":{"client_id":"Ttx+bXxOpEzbjiqq/xOEZg=="},"language_model_counters":{"en":5},"media":{"device_id_salt":"FE97131B0CF87435045FE3CCAC74D84B","engagement":{"schema_version":4}},"media_router":{"enable_media_router":false},"ntp":{"num_personal_suggestions":1},"plugins":{"plugins_list":[]},"previews":{"litepage":{"user-needs-notification":false},"offline_helper":{"available_pages":{}}},"profile":{"avatar_bubble_tutorial_shown":2,"avatar_index":26,"content_settings":{"exceptions":{"accessibility_events":{},"app_banner":{},"auto_select_certificate":{},"automatic_downloads":{},"autoplay":{},"background_sync":{},"bluetooth_guard":{},"bluetooth_scanning":{},"client_hints":{},"clipboard":{},"cookies":{},"durable_storage":{},"flash_data":{},"geolocation":{},"hid_chooser_data":{},"hid_guard":{},"images":{},"important_site_info":{},"intent_picker_auto_display":{},"javascript":{},"media_engagement":{},"media_stream_camera":{},"media_stream_mic":{},"midi_sysex":{},"mixed_script":{},"notifications":{},"password_protection":{},"payment_handler":{},"permission_autoblocking_data":{},"plugins":{},"popups":{},"ppapi_broker":{},"protocol_handler":{},"sensors":{},"serial_chooser_data":{},"serial_guard":{},"site_engagement":{},"sound":{},"ssl_cert_decisions":{},"subresource_filter":{},"subresource_filter_data":{},"usb_chooser_data":{},"usb_guard":{}},"pref_version":1},"created_by_version":"76.0.69.98","exit_type":"Normal","exited_cleanly":true,"managed_user_id":"","name":"Person 1"},"signin":{"allowed":false},"translate_site_blacklist_with_time":{}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion069WithRewardsAndAdsEnabled b/test/data/rewards-data/migration/PreferencesForVersion069WithRewardsAndAdsEnabled new file mode 100644 index 00000000000..8273c6f18ac --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion069WithRewardsAndAdsEnabled @@ -0,0 +1 @@ +{"account_id_migration_state":2,"account_tracker_service_last_update":"13209474884161520","apps":{"shortcuts_version":6},"autocomplete":{"retention_policy_last_version":76},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"brave":{"brave_ads":{"enabled":true,"has_removed_first_launch_notification":false,"idle_threshold":15,"launch_notification_timestamp":"0","prefs":{"version":3},"should_show_first_launch_notification":false},"rewards":{"enabled":true,"enabled_migrated":true,"external_wallets":{"uphold":{"address":"","one_time_string":"6E3E5A98636D337A5315A253EB70B9BBB23C4F280AECA193A96D1392A4ECA586","status":0,"token":"","transferred":false,"user_name":""}},"notifications":"{\"displayed\":[],\"notifications\":[]}"}},"browser":{"has_seen_welcome_page":true,"window_placement":{"bottom":1390,"left":680,"maximized":false,"right":1880,"top":23,"work_area_bottom":1390,"work_area_left":0,"work_area_right":2560,"work_area_top":23}},"countryid_at_install":18242,"data_reduction":{"daily_original_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","3527045"],"daily_original_length_application":"3527045","daily_original_length_unknown":"0","daily_original_length_via_data_reduction_proxy":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_via_data_reduction_proxy_application":"0","daily_original_length_via_data_reduction_proxy_unknown":"0","daily_original_length_via_data_reduction_proxy_video":"0","daily_original_length_video":"0","daily_original_length_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_with_data_reduction_proxy_enabled_application":"0","daily_original_length_with_data_reduction_proxy_enabled_unknown":"0","daily_original_length_with_data_reduction_proxy_enabled_video":"0","daily_received_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","3527045"],"daily_received_length_application":"3527045","daily_received_length_https_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_long_bypass_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_short_bypass_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_unknown":"0","daily_received_length_unknown_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_via_data_reduction_proxy":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_via_data_reduction_proxy_application":"0","daily_received_length_via_data_reduction_proxy_unknown":"0","daily_received_length_via_data_reduction_proxy_video":"0","daily_received_length_video":"0","daily_received_length_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_with_data_reduction_proxy_enabled_application":"0","daily_received_length_with_data_reduction_proxy_enabled_unknown":"0","daily_received_length_with_data_reduction_proxy_enabled_video":"0","last_update_date":"13209433200000000","network_properties":{},"this_week_number":2587,"this_week_services_downstream_foreground_kb":{"23373669":1,"51242536":3442}},"default_apps_install_state":3,"extensions":{"alerts":{"initialized":true},"chrome_url_overrides":{},"last_chrome_version":"76.0.69.98"},"gcm":{"product_category_for_subtypes":"com.brave.macosx"},"google":{"services":{"signin_scoped_device_id":"684609ac-a27b-45ba-93a8-57c43c38fe18"}},"http_original_content_length":"3527045","http_received_content_length":"3527045","invalidator":{"client_id":"Ttx+bXxOpEzbjiqq/xOEZg=="},"language_model_counters":{"en":3},"media":{"device_id_salt":"FE97131B0CF87435045FE3CCAC74D84B","engagement":{"schema_version":4}},"media_router":{"enable_media_router":false},"ntp":{"num_personal_suggestions":1},"plugins":{"plugins_list":[]},"previews":{"litepage":{"user-needs-notification":false},"offline_helper":{"available_pages":{}}},"profile":{"avatar_bubble_tutorial_shown":2,"avatar_index":26,"content_settings":{"exceptions":{"accessibility_events":{},"app_banner":{},"auto_select_certificate":{},"automatic_downloads":{},"autoplay":{},"background_sync":{},"bluetooth_guard":{},"bluetooth_scanning":{},"client_hints":{},"clipboard":{},"cookies":{},"durable_storage":{},"flash_data":{},"geolocation":{},"hid_chooser_data":{},"hid_guard":{},"images":{},"important_site_info":{},"intent_picker_auto_display":{},"javascript":{},"media_engagement":{},"media_stream_camera":{},"media_stream_mic":{},"midi_sysex":{},"mixed_script":{},"notifications":{},"password_protection":{},"payment_handler":{},"permission_autoblocking_data":{},"plugins":{},"popups":{},"ppapi_broker":{},"protocol_handler":{},"sensors":{},"serial_chooser_data":{},"serial_guard":{},"site_engagement":{},"sound":{},"ssl_cert_decisions":{},"subresource_filter":{},"subresource_filter_data":{},"usb_chooser_data":{},"usb_guard":{}},"pref_version":1},"created_by_version":"76.0.69.98","exit_type":"Normal","exited_cleanly":true,"managed_user_id":"","name":"Person 1"},"signin":{"allowed":false},"translate_site_blacklist_with_time":{}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion069WithRewardsEnabledAndAdsDisabled b/test/data/rewards-data/migration/PreferencesForVersion069WithRewardsEnabledAndAdsDisabled new file mode 100644 index 00000000000..036f2977cca --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion069WithRewardsEnabledAndAdsDisabled @@ -0,0 +1 @@ +{"plugins":{"plugins_list":[]},"apps":{"shortcuts_version":6},"http_original_content_length":"3529810","countryid_at_install":18242,"data_reduction":{"daily_original_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","3529810"],"daily_received_length_via_data_reduction_proxy":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_via_data_reduction_proxy_video":"0","daily_original_length_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_with_data_reduction_proxy_enabled_unknown":"0","last_update_date":"13209433200000000","daily_original_length_via_data_reduction_proxy_application":"0","daily_received_length_https_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_with_data_reduction_proxy_enabled_video":"0","daily_received_length_via_data_reduction_proxy_video":"0","daily_received_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","3529810"],"daily_original_length_unknown":"0","daily_received_length_via_data_reduction_proxy_unknown":"0","daily_received_length_with_data_reduction_proxy_enabled_unknown":"0","daily_received_length_short_bypass_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_via_data_reduction_proxy_application":"0","daily_received_length_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_received_length_with_data_reduction_proxy_enabled_video":"0","daily_received_length_unknown_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_via_data_reduction_proxy":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"daily_original_length_via_data_reduction_proxy_unknown":"0","this_week_services_downstream_foreground_kb":{"51242536":3444,"23373669":1},"network_properties":{},"daily_original_length_with_data_reduction_proxy_enabled_application":"0","daily_original_length_application":"3529810","daily_received_length_video":"0","daily_received_length_with_data_reduction_proxy_enabled_application":"0","daily_original_length_video":"0","daily_received_length_unknown":"0","this_week_number":2587,"daily_received_length_application":"3529810","daily_received_length_long_bypass_with_data_reduction_proxy_enabled":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]},"google":{"services":{"signin_scoped_device_id":"3db1b8f0-bfe8-42bd-b4cf-40b86453da6e"}},"profile":{"avatar_index":26,"exit_type":"Normal","created_by_version":"76.0.69.98","avatar_bubble_tutorial_shown":2,"managed_user_id":"","content_settings":{"pref_version":1,"exceptions":{"cookies":{},"ssl_cert_decisions":{},"clipboard":{},"serial_guard":{},"auto_select_certificate":{},"javascript":{},"durable_storage":{},"permission_autoblocking_data":{},"popups":{},"client_hints":{},"sensors":{},"media_engagement":{},"notifications":{},"flash_data":{},"password_protection":{},"autoplay":{},"midi_sysex":{},"intent_picker_auto_display":{},"bluetooth_guard":{},"mixed_script":{},"protocol_handler":{},"serial_chooser_data":{},"hid_guard":{},"images":{},"background_sync":{},"important_site_info":{},"bluetooth_scanning":{},"hid_chooser_data":{},"geolocation":{},"payment_handler":{},"ppapi_broker":{},"media_stream_camera":{},"subresource_filter":{},"sound":{},"subresource_filter_data":{},"usb_chooser_data":{},"site_engagement":{},"usb_guard":{},"plugins":{},"accessibility_events":{},"media_stream_mic":{},"app_banner":{},"automatic_downloads":{}}},"exited_cleanly":true,"name":"Person 1"},"media_router":{"enable_media_router":false},"http_received_content_length":"3529810","gcm":{"product_category_for_subtypes":"com.brave.macosx"},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"media":{"device_id_salt":"FE97131B0CF87435045FE3CCAC74D84B","engagement":{"schema_version":4}},"account_id_migration_state":2,"browser":{"default_browser_infobar_last_declined":"13209474962805451","has_seen_welcome_page":true,"window_placement":{"bottom":1390,"work_area_bottom":1390,"maximized":false,"work_area_right":2560,"left":680,"right":1880,"top":23,"work_area_left":0,"work_area_top":23}},"previews":{"litepage":{"user-needs-notification":false},"offline_helper":{"available_pages":{}}},"invalidator":{"client_id":"Ttx+bXxOpEzbjiqq/xOEZg=="},"account_tracker_service_last_update":"13209474884161520","autocomplete":{"retention_policy_last_version":76},"translate_site_blacklist_with_time":{},"language_model_counters":{"en":4},"extensions":{"last_chrome_version":"76.0.69.98","alerts":{"initialized":true},"chrome_url_overrides":{}},"ntp":{"num_personal_suggestions":1},"brave":{"rewards":{"enabled":true,"enabled_migrated":true,"notifications":"{\"displayed\":[],\"notifications\":[]}"},"brave_ads":{"prefs":{"version":3},"enabled":false}},"default_apps_install_state":3,"signin":{"allowed":false}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion070WithRewardsAndAdsDisabled b/test/data/rewards-data/migration/PreferencesForVersion070WithRewardsAndAdsDisabled new file mode 100644 index 00000000000..ee435e22061 --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion070WithRewardsAndAdsDisabled @@ -0,0 +1 @@ +{"plugins":{"plugins_list":[]},"apps":{"shortcuts_version":6},"google":{"services":{"signin_scoped_device_id":"cd90a460-35fa-4c12-8f09-0789a119c3c9"}},"profile":{"avatar_index":26,"exit_type":"Crashed","created_by_version":"76.0.70.45","avatar_bubble_tutorial_shown":2,"managed_user_id":"","content_settings":{"pref_version":1,"exceptions":{"cookies":{},"ssl_cert_decisions":{},"clipboard":{},"serial_guard":{},"auto_select_certificate":{},"javascript":{},"durable_storage":{},"permission_autoblocking_data":{},"popups":{},"client_hints":{},"sensors":{},"media_engagement":{},"notifications":{},"flash_data":{},"password_protection":{},"autoplay":{},"midi_sysex":{},"intent_picker_auto_display":{},"bluetooth_guard":{},"mixed_script":{},"protocol_handler":{},"serial_chooser_data":{},"hid_guard":{},"images":{},"background_sync":{},"important_site_info":{},"bluetooth_scanning":{},"hid_chooser_data":{},"geolocation":{},"payment_handler":{},"ppapi_broker":{},"media_stream_camera":{},"subresource_filter":{},"sound":{},"subresource_filter_data":{},"usb_chooser_data":{},"site_engagement":{},"usb_guard":{},"plugins":{},"accessibility_events":{},"media_stream_mic":{},"app_banner":{},"automatic_downloads":{}}},"exited_cleanly":true,"name":"Person 1"},"countryid_at_install":18242,"data_reduction":{"this_week_number":2599,"network_properties":{}},"media_router":{"enable_media_router":false},"gcm":{"product_category_for_subtypes":"com.brave.macosx"},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"media":{"device_id_salt":"5C2FEC4880CFDC7A7F7D11F77CDE7736","engagement":{"schema_version":4}},"account_id_migration_state":2,"browser":{"has_seen_welcome_page":true,"window_placement":{"bottom":1369,"work_area_bottom":1393,"maximized":false,"work_area_right":2560,"left":814,"right":2014,"top":43,"work_area_left":0,"work_area_top":23}},"previews":{"litepage":{"user-needs-notification":false},"offline_helper":{"available_pages":{}}},"invalidator":{"client_id":"AiDHn2blyJ81aXub65eIWA=="},"account_tracker_service_last_update":"13216396385486319","autocomplete":{"retention_policy_last_version":76},"translate_site_blacklist_with_time":{},"extensions":{"last_chrome_version":"76.0.70.45","alerts":{"initialized":true},"chrome_url_overrides":{}},"ntp":{"num_personal_suggestions":1},"brave":{"rewards":{"enabled":false},"brave_ads":{"enabled":false,"prefs":{"version":4}}},"default_apps_install_state":3,"signin":{"allowed":false}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion070WithRewardsAndAdsEnabled b/test/data/rewards-data/migration/PreferencesForVersion070WithRewardsAndAdsEnabled new file mode 100644 index 00000000000..20ae119655d --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion070WithRewardsAndAdsEnabled @@ -0,0 +1 @@ +{"plugins":{"plugins_list":[]},"google":{"services":{"signin_scoped_device_id":"38c6d44e-cb92-45ae-94c0-ad8e6833ab49"}},"apps":{"shortcuts_version":6},"profile":{"avatar_index":26,"exit_type":"Crashed","created_by_version":"76.0.70.45","avatar_bubble_tutorial_shown":2,"managed_user_id":"","content_settings":{"pref_version":1,"exceptions":{"cookies":{},"ssl_cert_decisions":{},"serial_guard":{},"clipboard":{},"auto_select_certificate":{},"javascript":{},"durable_storage":{},"permission_autoblocking_data":{},"popups":{},"client_hints":{},"sensors":{},"media_engagement":{},"notifications":{},"flash_data":{},"password_protection":{},"midi_sysex":{},"autoplay":{},"intent_picker_auto_display":{},"bluetooth_guard":{},"mixed_script":{},"protocol_handler":{},"serial_chooser_data":{},"hid_guard":{},"images":{},"background_sync":{},"important_site_info":{},"bluetooth_scanning":{},"hid_chooser_data":{},"geolocation":{},"payment_handler":{},"ppapi_broker":{},"media_stream_camera":{},"subresource_filter":{},"sound":{},"subresource_filter_data":{},"usb_chooser_data":{},"site_engagement":{},"usb_guard":{},"plugins":{},"accessibility_events":{},"media_stream_mic":{},"app_banner":{},"automatic_downloads":{}}},"exited_cleanly":true,"name":"Person 1"},"countryid_at_install":18242,"data_reduction":{"this_week_number":2599,"this_week_services_downstream_foreground_kb":{"23373669":59,"51242536":6141},"network_properties":{}},"media_router":{"enable_media_router":false},"gcm":{"product_category_for_subtypes":"com.brave.macosx"},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"account_id_migration_state":2,"media":{"device_id_salt":"ED8F68850C3988AAA92BA81ED60EDFC3","engagement":{"schema_version":4}},"browser":{"has_seen_welcome_page":true,"window_placement":{"bottom":1365,"work_area_bottom":1393,"maximized":false,"work_area_right":2560,"left":958,"right":2158,"top":39,"work_area_left":0,"work_area_top":23}},"previews":{"litepage":{"user-needs-notification":false},"offline_helper":{"available_pages":{}}},"invalidator":{"client_id":"zWLUqYSg73+Rj/fYkkTbvQ=="},"autocomplete":{"retention_policy_last_version":76},"account_tracker_service_last_update":"13216396143554437","translate_site_blacklist_with_time":{},"extensions":{"last_chrome_version":"76.0.70.45","alerts":{"initialized":true},"chrome_url_overrides":{}},"brave":{"rewards":{"enabled":true,"enabled_migrated":true},"brave_ads":{"enabled":true,"prefs":{"version":4}}},"ntp":{"num_personal_suggestions":1},"default_apps_install_state":3,"signin":{"allowed":false}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion070WithRewardsEnabledAndAdsDisabled b/test/data/rewards-data/migration/PreferencesForVersion070WithRewardsEnabledAndAdsDisabled new file mode 100644 index 00000000000..4818cf731a6 --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion070WithRewardsEnabledAndAdsDisabled @@ -0,0 +1 @@ +{"plugins":{"plugins_list":[]},"google":{"services":{"signin_scoped_device_id":"38c6d44e-cb92-45ae-94c0-ad8e6833ab49"}},"apps":{"shortcuts_version":6},"profile":{"avatar_index":26,"exit_type":"Crashed","created_by_version":"76.0.70.45","avatar_bubble_tutorial_shown":2,"managed_user_id":"","content_settings":{"pref_version":1,"exceptions":{"cookies":{},"ssl_cert_decisions":{},"serial_guard":{},"clipboard":{},"auto_select_certificate":{},"javascript":{},"durable_storage":{},"permission_autoblocking_data":{},"popups":{},"client_hints":{},"sensors":{},"media_engagement":{},"notifications":{},"flash_data":{},"password_protection":{},"midi_sysex":{},"autoplay":{},"intent_picker_auto_display":{},"bluetooth_guard":{},"mixed_script":{},"protocol_handler":{},"serial_chooser_data":{},"hid_guard":{},"images":{},"background_sync":{},"important_site_info":{},"bluetooth_scanning":{},"hid_chooser_data":{},"geolocation":{},"payment_handler":{},"ppapi_broker":{},"media_stream_camera":{},"subresource_filter":{},"sound":{},"subresource_filter_data":{},"usb_chooser_data":{},"site_engagement":{},"usb_guard":{},"plugins":{},"accessibility_events":{},"media_stream_mic":{},"app_banner":{},"automatic_downloads":{}}},"exited_cleanly":true,"name":"Person 1"},"countryid_at_install":18242,"data_reduction":{"this_week_number":2599,"this_week_services_downstream_foreground_kb":{"51242536":6141,"23373669":59},"network_properties":{}},"media_router":{"enable_media_router":false},"gcm":{"product_category_for_subtypes":"com.brave.macosx"},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"account_id_migration_state":2,"media":{"device_id_salt":"ED8F68850C3988AAA92BA81ED60EDFC3","engagement":{"schema_version":4}},"browser":{"has_seen_welcome_page":true,"window_placement":{"bottom":1365,"work_area_bottom":1393,"maximized":false,"work_area_right":2560,"left":958,"right":2158,"top":39,"work_area_left":0,"work_area_top":23}},"previews":{"litepage":{"user-needs-notification":false},"offline_helper":{"available_pages":{}}},"invalidator":{"client_id":"zWLUqYSg73+Rj/fYkkTbvQ=="},"account_tracker_service_last_update":"13216396143554437","autocomplete":{"retention_policy_last_version":76},"translate_site_blacklist_with_time":{},"extensions":{"last_chrome_version":"76.0.70.45","alerts":{"initialized":true},"chrome_url_overrides":{}},"brave":{"rewards":{"enabled":true,"enabled_migrated":true},"brave_ads":{"enabled":false,"prefs":{"version":4}}},"ntp":{"num_personal_suggestions":1},"default_apps_install_state":3,"signin":{"allowed":false}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion071WithRewardsAndAdsDisabled b/test/data/rewards-data/migration/PreferencesForVersion071WithRewardsAndAdsDisabled new file mode 100644 index 00000000000..46d10a88bb6 --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion071WithRewardsAndAdsDisabled @@ -0,0 +1 @@ +{"account_id_migration_state":2,"account_tracker_service_last_update":"13216396826046216","apps":{"shortcuts_version":6},"autocomplete":{"retention_policy_last_version":78},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"brave":{"brave_ads":{"enabled":false,"prefs":{"version":4},"should_show_first_launch_notification":true},"rewards":{"enabled":false,"notifications":"{\"displayed\":[],\"notifications\":[]}"}},"browser":{"has_seen_welcome_page":true,"window_placement":{"bottom":1372,"left":1097,"maximized":false,"right":2297,"top":46,"work_area_bottom":1393,"work_area_left":0,"work_area_right":2560,"work_area_top":23}},"countryid_at_install":18242,"data_reduction":{"daily_original_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","7335104"],"daily_received_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","7335104"],"last_update_date":"13216345200000000","network_properties":{},"this_week_number":2599,"this_week_services_downstream_foreground_kb":{"115765598":1,"11793316":1,"119416099":1,"47942479":1,"54845618":7010,"6019475":153}},"default_apps_install_state":3,"extensions":{"alerts":{"initialized":true},"chrome_url_overrides":{},"last_chrome_version":"78.0.71.103"},"gcm":{"product_category_for_subtypes":"com.brave.macosx"},"google":{"services":{"signin_scoped_device_id":"35b46ba7-e362-4187-acf5-314d6b6c7c07"}},"http_original_content_length":"7335104","http_received_content_length":"7335104","invalidation":{"per_sender_topics_to_handler":{"8181035976":{}}},"invalidator":{"client_id":"otBqUy+IrUu7KIff1KSjzg=="},"media":{"device_id_salt":"8D1F8B106AEF518D34FC921F8FE674F9","engagement":{"schema_version":4}},"media_router":{"enable_media_router":false},"ntp":{"num_personal_suggestions":1},"plugins":{"plugins_list":[]},"previews":{"litepage":{"user-needs-notification":false},"offline_helper":{"available_pages":{}}},"profile":{"avatar_bubble_tutorial_shown":2,"avatar_index":26,"block_third_party_cookies":true,"content_settings":{"exceptions":{"accessibility_events":{},"app_banner":{},"auto_select_certificate":{},"automatic_downloads":{},"autoplay":{},"background_sync":{},"bluetooth_guard":{},"bluetooth_scanning":{},"client_hints":{},"clipboard":{},"cookies":{},"durable_storage":{},"flash_data":{},"geolocation":{},"hid_chooser_data":{},"hid_guard":{},"images":{},"important_site_info":{},"intent_picker_auto_display":{},"javascript":{},"legacy_cookie_access":{},"media_engagement":{},"media_stream_camera":{},"media_stream_mic":{},"midi_sysex":{},"mixed_script":{},"native_file_system_write_guard":{},"notifications":{},"password_protection":{},"payment_handler":{},"permission_autoblocking_data":{},"plugins":{},"popups":{},"ppapi_broker":{},"protocol_handler":{},"sensors":{},"serial_chooser_data":{},"serial_guard":{},"site_engagement":{},"sound":{},"ssl_cert_decisions":{},"subresource_filter":{},"subresource_filter_data":{},"usb_chooser_data":{},"usb_guard":{}},"pref_version":1},"created_by_version":"78.0.71.103","default_content_setting_values":{"cookies":1},"exit_type":"Normal","exited_cleanly":true,"managed_user_id":"","name":"Person 1"},"signin":{"allowed":false},"translate_site_blacklist_with_time":{},"web_apps":{"system_web_app_last_update":"78.0.71.103"}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion071WithRewardsAndAdsEnabled b/test/data/rewards-data/migration/PreferencesForVersion071WithRewardsAndAdsEnabled new file mode 100644 index 00000000000..69ad9a65bc1 --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion071WithRewardsAndAdsEnabled @@ -0,0 +1 @@ +{"plugins":{"plugins_list":[]},"google":{"services":{"signin_scoped_device_id":"8894b9d4-e22a-442f-b915-57d1e571b3bc"}},"http_original_content_length":"17898573","profile":{"avatar_index":26,"default_content_setting_values":{"cookies":1},"exit_type":"Normal","created_by_version":"78.0.71.103","managed_user_id":"","content_settings":{"pref_version":1,"exceptions":{"cookies":{},"ssl_cert_decisions":{},"serial_guard":{},"clipboard":{},"auto_select_certificate":{},"javascript":{},"native_file_system_write_guard":{},"durable_storage":{},"permission_autoblocking_data":{},"popups":{},"client_hints":{},"sensors":{},"media_engagement":{},"notifications":{},"flash_data":{},"password_protection":{},"midi_sysex":{},"autoplay":{},"intent_picker_auto_display":{},"bluetooth_guard":{},"mixed_script":{},"protocol_handler":{},"serial_chooser_data":{},"hid_guard":{},"images":{},"background_sync":{},"important_site_info":{},"bluetooth_scanning":{},"hid_chooser_data":{},"geolocation":{},"payment_handler":{},"ppapi_broker":{},"media_stream_camera":{},"subresource_filter":{},"sound":{},"subresource_filter_data":{},"usb_chooser_data":{},"site_engagement":{},"usb_guard":{},"plugins":{},"accessibility_events":{},"legacy_cookie_access":{},"media_stream_mic":{},"app_banner":{},"automatic_downloads":{}}},"avatar_bubble_tutorial_shown":2,"block_third_party_cookies":true,"exited_cleanly":true,"name":"Person 1"},"countryid_at_install":18242,"data_reduction":{"daily_received_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","17898573"],"this_week_number":2599,"network_properties":{},"daily_original_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","17898573"],"this_week_services_downstream_foreground_kb":{"115765598":1,"51242536":10156,"47942479":2,"54845618":7015,"6019475":306,"119416099":2,"23373669":1,"11793316":1},"last_update_date":"13216345200000000"},"apps":{"shortcuts_version":6},"media_router":{"enable_media_router":false},"gcm":{"product_category_for_subtypes":"com.brave.macosx"},"http_received_content_length":"17898573","web_apps":{"system_web_app_last_update":"78.0.71.103"},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"media":{"device_id_salt":"8D1F8B106AEF518D34FC921F8FE674F9","engagement":{"schema_version":4}},"invalidation":{"per_sender_topics_to_handler":{"8181035976":{}}},"account_id_migration_state":2,"browser":{"has_seen_welcome_page":true,"window_placement":{"bottom":1372,"work_area_bottom":1394,"maximized":false,"work_area_right":2560,"left":1097,"right":2297,"top":46,"work_area_left":0,"work_area_top":23}},"previews":{"litepage":{"user-needs-notification":false},"offline_helper":{"available_pages":{}}},"invalidator":{"client_id":"otBqUy+IrUu7KIff1KSjzg=="},"account_tracker_service_last_update":"13216396826046216","autocomplete":{"retention_policy_last_version":78},"translate_site_blacklist_with_time":{},"extensions":{"last_chrome_version":"78.0.71.103","alerts":{"initialized":true},"chrome_url_overrides":{}},"ntp":{"num_personal_suggestions":1},"brave":{"rewards":{"enabled":true,"notifications":"{\"displayed\":[],\"notifications\":[]}","enabled_migrated":true},"brave_ads":{"enabled":true,"prefs":{"version":4}}},"default_apps_install_state":3,"signin":{"allowed":false}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion071WithRewardsEnabledAndAdsDisabled b/test/data/rewards-data/migration/PreferencesForVersion071WithRewardsEnabledAndAdsDisabled new file mode 100644 index 00000000000..dab1022457a --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion071WithRewardsEnabledAndAdsDisabled @@ -0,0 +1 @@ +{"plugins":{"plugins_list":[]},"google":{"services":{"signin_scoped_device_id":"8894b9d4-e22a-442f-b915-57d1e571b3bc"}},"http_original_content_length":"17898573","profile":{"avatar_index":26,"default_content_setting_values":{"cookies":1},"exit_type":"Normal","created_by_version":"78.0.71.103","managed_user_id":"","content_settings":{"pref_version":1,"exceptions":{"cookies":{},"ssl_cert_decisions":{},"serial_guard":{},"clipboard":{},"auto_select_certificate":{},"javascript":{},"native_file_system_write_guard":{},"durable_storage":{},"permission_autoblocking_data":{},"popups":{},"client_hints":{},"sensors":{},"media_engagement":{},"notifications":{},"flash_data":{},"password_protection":{},"midi_sysex":{},"autoplay":{},"intent_picker_auto_display":{},"bluetooth_guard":{},"mixed_script":{},"protocol_handler":{},"serial_chooser_data":{},"hid_guard":{},"images":{},"background_sync":{},"important_site_info":{},"bluetooth_scanning":{},"hid_chooser_data":{},"geolocation":{},"payment_handler":{},"ppapi_broker":{},"media_stream_camera":{},"subresource_filter":{},"sound":{},"subresource_filter_data":{},"usb_chooser_data":{},"site_engagement":{},"usb_guard":{},"plugins":{},"accessibility_events":{},"legacy_cookie_access":{},"media_stream_mic":{},"app_banner":{},"automatic_downloads":{}}},"avatar_bubble_tutorial_shown":2,"block_third_party_cookies":true,"exited_cleanly":true,"name":"Person 1"},"countryid_at_install":18242,"data_reduction":{"last_update_date":"13216345200000000","this_week_number":2599,"network_properties":{},"daily_original_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","17898573"],"daily_received_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","17898573"],"this_week_services_downstream_foreground_kb":{"115765598":1,"51242536":10156,"47942479":2,"54845618":7015,"6019475":306,"119416099":2,"23373669":1,"11793316":1}},"apps":{"shortcuts_version":6},"media_router":{"enable_media_router":false},"gcm":{"product_category_for_subtypes":"com.brave.macosx"},"http_received_content_length":"17898573","web_apps":{"system_web_app_last_update":"78.0.71.103"},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"media":{"device_id_salt":"8D1F8B106AEF518D34FC921F8FE674F9","engagement":{"schema_version":4}},"invalidation":{"per_sender_topics_to_handler":{"8181035976":{}}},"account_id_migration_state":2,"browser":{"has_seen_welcome_page":true,"window_placement":{"bottom":1372,"work_area_bottom":1394,"maximized":false,"work_area_right":2560,"left":1097,"right":2297,"top":46,"work_area_left":0,"work_area_top":23}},"previews":{"litepage":{"user-needs-notification":false},"offline_helper":{"available_pages":{}}},"invalidator":{"client_id":"otBqUy+IrUu7KIff1KSjzg=="},"account_tracker_service_last_update":"13216396826046216","autocomplete":{"retention_policy_last_version":78},"translate_site_blacklist_with_time":{},"extensions":{"last_chrome_version":"78.0.71.103","alerts":{"initialized":true},"chrome_url_overrides":{}},"ntp":{"num_personal_suggestions":1},"brave":{"rewards":{"enabled":true,"notifications":"{\"displayed\":[],\"notifications\":[]}","enabled_migrated":true},"brave_ads":{"enabled":false,"prefs":{"version":4}}},"default_apps_install_state":3,"signin":{"allowed":false}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion072WithRewardsAndAdsDisabled b/test/data/rewards-data/migration/PreferencesForVersion072WithRewardsAndAdsDisabled new file mode 100644 index 00000000000..99c766093d7 --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion072WithRewardsAndAdsDisabled @@ -0,0 +1 @@ +{"plugins":{"plugins_list":[]},"google":{"services":{"signin_scoped_device_id":"6a11b733-0321-4140-adbe-5839b822b116"}},"http_original_content_length":"7335280","profile":{"avatar_index":26,"default_content_setting_values":{"cookies":1},"exit_type":"Normal","created_by_version":"78.0.72.110","managed_user_id":"","content_settings":{"pref_version":1,"exceptions":{"cookies":{},"ssl_cert_decisions":{},"serial_guard":{},"clipboard":{},"auto_select_certificate":{},"javascript":{},"native_file_system_write_guard":{},"durable_storage":{},"permission_autoblocking_data":{},"popups":{},"client_hints":{},"sensors":{},"media_engagement":{},"notifications":{},"flash_data":{},"password_protection":{},"midi_sysex":{},"autoplay":{},"intent_picker_auto_display":{},"bluetooth_guard":{},"mixed_script":{},"protocol_handler":{},"serial_chooser_data":{},"hid_guard":{},"images":{},"background_sync":{},"important_site_info":{},"bluetooth_scanning":{},"hid_chooser_data":{},"geolocation":{},"payment_handler":{},"ppapi_broker":{},"media_stream_camera":{},"subresource_filter":{},"sound":{},"subresource_filter_data":{},"usb_chooser_data":{},"site_engagement":{},"usb_guard":{},"plugins":{},"accessibility_events":{},"legacy_cookie_access":{},"media_stream_mic":{},"app_banner":{},"automatic_downloads":{}}},"avatar_bubble_tutorial_shown":2,"block_third_party_cookies":true,"exited_cleanly":true,"name":"Person 1"},"countryid_at_install":18242,"data_reduction":{"daily_received_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","7335280"],"this_week_number":2599,"network_properties":{},"daily_original_length":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","7335280"],"this_week_services_downstream_foreground_kb":{"11793316":1,"115765598":1,"119416099":1,"47942479":1,"54845618":7010,"6019475":153},"last_update_date":"13216345200000000"},"apps":{"shortcuts_version":6},"media_router":{"enable_media_router":false},"gcm":{"product_category_for_subtypes":"com.brave.macosx"},"http_received_content_length":"7335280","web_apps":{"system_web_app_last_update":"78.0.72.110"},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"media":{"device_id_salt":"CADF5E857C7AB6658B03F54A51AE9397","engagement":{"schema_version":4}},"invalidation":{"per_sender_topics_to_handler":{"8181035976":{}}},"account_id_migration_state":2,"browser":{"has_seen_welcome_page":true,"window_placement":{"bottom":1368,"work_area_bottom":1394,"maximized":false,"work_area_right":2560,"left":1313,"right":2513,"top":41,"work_area_left":0,"work_area_top":23}},"previews":{"litepage":{"user-needs-notification":false},"offline_helper":{"available_pages":{}}},"invalidator":{"client_id":"Gman09feu6pUPiVjAk5LsA=="},"account_tracker_service_last_update":"13216397276097211","autocomplete":{"retention_policy_last_version":78},"translate_site_blacklist_with_time":{},"extensions":{"last_chrome_version":"78.0.72.110","alerts":{"initialized":true},"chrome_url_overrides":{}},"ntp":{"num_personal_suggestions":1},"brave":{"rewards":{"enabled":false,"notifications":"{\"displayed\":[],\"notifications\":[]}"},"brave_ads":{"enabled":false,"prefs":{"version":6}}},"default_apps_install_state":3,"signin":{"allowed":false}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion072WithRewardsAndAdsEnabled b/test/data/rewards-data/migration/PreferencesForVersion072WithRewardsAndAdsEnabled new file mode 100644 index 00000000000..881af0d7432 --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion072WithRewardsAndAdsEnabled @@ -0,0 +1 @@ +{"plugins":{"plugins_list":[]},"google":{"services":{"signin_scoped_device_id":"551a07dd-1f62-48f8-8664-ac640c6e9493"}},"apps":{"shortcuts_version":6},"profile":{"password_manager_onboarding_state":1,"avatar_index":26,"default_content_setting_values":{"cookies":1},"exit_type":"Crashed","avatar_bubble_tutorial_shown":2,"created_by_version":"78.0.72.110","content_settings":{"pref_version":1,"exceptions":{"cookies":{},"ssl_cert_decisions":{},"serial_guard":{},"clipboard":{},"auto_select_certificate":{},"javascript":{},"native_file_system_write_guard":{},"durable_storage":{},"permission_autoblocking_data":{},"popups":{},"client_hints":{},"sensors":{},"media_engagement":{},"notifications":{},"flash_data":{},"password_protection":{},"midi_sysex":{},"autoplay":{},"intent_picker_auto_display":{},"bluetooth_guard":{},"mixed_script":{},"protocol_handler":{},"serial_chooser_data":{},"hid_guard":{},"images":{},"background_sync":{},"important_site_info":{},"bluetooth_scanning":{},"hid_chooser_data":{},"geolocation":{},"payment_handler":{},"ppapi_broker":{},"media_stream_camera":{},"subresource_filter":{},"sound":{},"subresource_filter_data":{},"usb_chooser_data":{},"site_engagement":{},"usb_guard":{},"plugins":{},"accessibility_events":{},"legacy_cookie_access":{},"media_stream_mic":{},"app_banner":{},"automatic_downloads":{}}},"managed_user_id":"","block_third_party_cookies":true,"name":"Person 1","exited_cleanly":true},"countryid_at_install":18242,"data_reduction":{"this_week_number":2599,"this_week_services_downstream_foreground_kb":{"119416099":1,"47942479":1,"23373669":59,"51242536":7,"54845618":5,"6019475":153},"network_properties":{}},"media_router":{"enable_media_router":false},"gcm":{"product_category_for_subtypes":"com.brave.macosx"},"web_apps":{"system_web_app_last_update":"78.0.72.110"},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"media":{"device_id_salt":"473041D4F6F20CDF42623E11AFD38371","engagement":{"schema_version":4}},"invalidation":{"per_sender_topics_to_handler":{"8181035976":{}}},"account_id_migration_state":2,"browser":{"has_seen_welcome_page":true,"window_placement":{"bottom":1368,"work_area_bottom":1394,"maximized":false,"work_area_right":2560,"left":1312,"right":2512,"top":41,"work_area_left":0,"work_area_top":23}},"previews":{"litepage":{"user-needs-notification":false},"offline_helper":{"available_pages":{}}},"invalidator":{"client_id":"PaQO+sxcBaTZ0HUCmMquig=="},"account_tracker_service_last_update":"13216397442039543","autocomplete":{"retention_policy_last_version":78},"translate_site_blacklist_with_time":{},"language_model_counters":{"en":1},"extensions":{"last_chrome_version":"78.0.72.110","alerts":{"initialized":true},"chrome_url_overrides":{}},"ntp":{"num_personal_suggestions":1},"brave":{"rewards":{"enabled":true,"enabled_migrated":true},"brave_ads":{"enabled":true,"prefs":{"version":6}}},"default_apps_install_state":3,"signin":{"allowed":false}} \ No newline at end of file diff --git a/test/data/rewards-data/migration/PreferencesForVersion072WithRewardsEnabledAndAdsDisabled b/test/data/rewards-data/migration/PreferencesForVersion072WithRewardsEnabledAndAdsDisabled new file mode 100644 index 00000000000..e29ade8c517 --- /dev/null +++ b/test/data/rewards-data/migration/PreferencesForVersion072WithRewardsEnabledAndAdsDisabled @@ -0,0 +1 @@ +{"plugins":{"plugins_list":[]},"google":{"services":{"signin_scoped_device_id":"551a07dd-1f62-48f8-8664-ac640c6e9493"}},"apps":{"shortcuts_version":6},"profile":{"password_manager_onboarding_state":1,"avatar_index":26,"default_content_setting_values":{"cookies":1},"exit_type":"Crashed","avatar_bubble_tutorial_shown":2,"content_settings":{"pref_version":1,"exceptions":{"cookies":{},"ssl_cert_decisions":{},"serial_guard":{},"clipboard":{},"auto_select_certificate":{},"javascript":{},"native_file_system_write_guard":{},"durable_storage":{},"permission_autoblocking_data":{},"popups":{},"client_hints":{},"sensors":{},"media_engagement":{},"notifications":{},"flash_data":{},"password_protection":{},"midi_sysex":{},"autoplay":{},"intent_picker_auto_display":{},"bluetooth_guard":{},"mixed_script":{},"protocol_handler":{},"serial_chooser_data":{},"hid_guard":{},"images":{},"background_sync":{},"important_site_info":{},"bluetooth_scanning":{},"hid_chooser_data":{},"geolocation":{},"payment_handler":{},"ppapi_broker":{},"media_stream_camera":{},"subresource_filter":{},"sound":{},"subresource_filter_data":{},"usb_chooser_data":{},"site_engagement":{},"usb_guard":{},"plugins":{},"accessibility_events":{},"legacy_cookie_access":{},"media_stream_mic":{},"app_banner":{},"automatic_downloads":{}}},"created_by_version":"78.0.72.110","managed_user_id":"","block_third_party_cookies":true,"exited_cleanly":true,"name":"Person 1"},"countryid_at_install":18242,"data_reduction":{"this_week_number":2599,"this_week_services_downstream_foreground_kb":{"47942479":1,"119416099":1,"23373669":59,"51242536":7,"54845618":5,"6019475":153},"network_properties":{}},"media_router":{"enable_media_router":false},"gcm":{"product_category_for_subtypes":"com.brave.macosx"},"web_apps":{"system_web_app_last_update":"78.0.72.110"},"autofill":{"japan_city_field_migrated_to_street_address":true,"orphan_rows_removed":true},"media":{"device_id_salt":"473041D4F6F20CDF42623E11AFD38371","engagement":{"schema_version":4}},"invalidation":{"per_sender_topics_to_handler":{"8181035976":{}}},"account_id_migration_state":2,"browser":{"has_seen_welcome_page":true,"window_placement":{"bottom":1368,"work_area_bottom":1394,"maximized":false,"work_area_right":2560,"left":1312,"right":2512,"top":41,"work_area_left":0,"work_area_top":23}},"previews":{"litepage":{"user-needs-notification":false},"offline_helper":{"available_pages":{}}},"invalidator":{"client_id":"PaQO+sxcBaTZ0HUCmMquig=="},"account_tracker_service_last_update":"13216397442039543","autocomplete":{"retention_policy_last_version":78},"translate_site_blacklist_with_time":{},"language_model_counters":{"en":1},"extensions":{"last_chrome_version":"78.0.72.110","alerts":{"initialized":true},"chrome_url_overrides":{}},"ntp":{"num_personal_suggestions":1},"brave":{"rewards":{"enabled":true,"enabled_migrated":true},"brave_ads":{"enabled":false,"prefs":{"version":6}}},"default_apps_install_state":3,"signin":{"allowed":false}} \ No newline at end of file