#include "chrome/browser/ui/download/download_bubble_row_view_info.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/download/bubble/download_bubble_prefs.h"
#include "chrome/browser/download/download_item_model.h"
#include "chrome/browser/download/download_ui_model.h"
#include "chrome/browser/download/offline_item_utils.h"
#include "chrome/browser/safe_browsing/download_protection/download_protection_service.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/test/base/testing_profile.h"
#include "components/download/public/common/download_danger_type.h"
#include "components/download/public/common/mock_download_item.h"
#include "components/offline_items_collection/core/offline_item.h"
#include "components/prefs/pref_service.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/safe_browsing/core/common/proto/csd.pb.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/signin/public/identity_manager/identity_test_utils.h"
#include "components/vector_icons/vector_icons.h"
#include "content/public/browser/download_item_utils.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/views/vector_icons.h"
namespace {
void SetOnCall(bool* to_set) { … }
ContentId;
DownloadState;
NiceMock;
Return;
ReturnRefOfCopy;
UnorderedElementsAre;
#if BUILDFLAG(FULL_SAFE_BROWSING)
TailoredVerdict;
#endif
class DownloadBubbleRowViewInfoTest : public testing::Test,
public DownloadBubbleRowViewInfoObserver { … };
TEST_F(DownloadBubbleRowViewInfoTest, NotifyObserverOnUpdate) { … }
TEST_F(DownloadBubbleRowViewInfoTest, NotifyObserverOnStateUpdate) { … }
TEST_F(DownloadBubbleRowViewInfoTest, NotifyObserverOnDestroyed) { … }
TEST_F(DownloadBubbleRowViewInfoTest, InsecureDownloadPrimaryCommand) { … }
TEST_F(DownloadBubbleRowViewInfoTest, InProgressOrCompletedInfo) { … }
TEST_F(DownloadBubbleRowViewInfoTest, DangerousWarningInfo) { … }
TEST_F(DownloadBubbleRowViewInfoTest, InterruptedInfo) { … }
TEST_F(DownloadBubbleRowViewInfoTest, GetInfoForTailoredWarning_CookieTheft) { … }
TEST_F(DownloadBubbleRowViewInfoTest,
GetInfoForTailoredWarning_SuspiciousArchive) { … }
TEST_F(DownloadBubbleRowViewInfoTest,
GetInfoForTailoredWarning_AccountInfoStringWithAccount) { … }
TEST_F(DownloadBubbleRowViewInfoTest,
GetInfoForTailoredWarning_AccountInfoStringWithoutAccount) { … }
TEST_F(DownloadBubbleRowViewInfoTest, InsecurePrimaryButtonCommand) { … }
TEST_F(DownloadBubbleRowViewInfoTest,
ShouldShowNoticeForEnhancedProtectionScan) { … }
TEST_F(DownloadBubbleRowViewInfoTest,
ShouldNotShowNoticeForAdvancedProtectionScan) { … }
TEST_F(DownloadBubbleRowViewInfoTest, ShouldNotShowNoticeWithoutFlag) { … }
TEST_F(DownloadBubbleRowViewInfoTest, ShouldNotShowIfScanAlreadyPerformed) { … }
}