#include "chrome/browser/download/bubble/download_bubble_prefs.h"
#include "base/json/json_reader.h"
#include "base/memory/raw_ptr.h"
#include "base/test/scoped_feature_list.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/enterprise/connectors/common.h"
#include "chrome/browser/policy/dm_token_utils.h"
#include "chrome/browser/safe_browsing/advanced_protection_status_manager.h"
#include "chrome/browser/safe_browsing/advanced_protection_status_manager_factory.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/testing_profile_manager.h"
#include "components/enterprise/common/proto/connectors.pb.h"
#include "components/prefs/pref_service.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
constexpr char kDownloadConnectorEnabledNonBlockingPref[] = …;
constexpr char kDownloadConnectorEnabledBlockingPref[] = …;
}
namespace download {
class DownloadBubblePrefsTest : public testing::Test { … };
TEST_F(DownloadBubblePrefsTest, IsDownloadBubbleEnabled) { … }
TEST_F(DownloadBubblePrefsTest, DoesDownloadConnectorBlock) { … }
#if !BUILDFLAG(IS_CHROMEOS)
TEST_F(DownloadBubblePrefsTest, IsPartialViewEnabled) { … }
#else
TEST_F(DownloadBubblePrefsTest, IsPartialViewEnabled) {
EXPECT_FALSE(IsDownloadBubblePartialViewEnabled(profile_));
SetDownloadBubblePartialViewEnabled(profile_, true);
EXPECT_FALSE(IsDownloadBubblePartialViewEnabled(profile_));
SetDownloadBubblePartialViewEnabled(profile_, false);
EXPECT_FALSE(IsDownloadBubblePartialViewEnabled(profile_));
}
#endif
TEST_F(DownloadBubblePrefsTest, PartialViewImpressions) { … }
}