chromium/chrome/browser/download/bubble/download_bubble_prefs_unittest.cc

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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

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) {
  // Returns false regardless of the pref.
  EXPECT_FALSE(IsDownloadBubblePartialViewEnabled(profile_));
  SetDownloadBubblePartialViewEnabled(profile_, true);
  EXPECT_FALSE(IsDownloadBubblePartialViewEnabled(profile_));
  SetDownloadBubblePartialViewEnabled(profile_, false);
  EXPECT_FALSE(IsDownloadBubblePartialViewEnabled(profile_));
}
#endif  // !BUILDFLAG(IS_CHROMEOS)

TEST_F(DownloadBubblePrefsTest, PartialViewImpressions) {}

}  // namespace download