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

// Copyright 2021 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_ui_controller.h"

#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ref.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/download/bubble/download_bubble_prefs.h"
#include "chrome/browser/download/bubble/download_bubble_update_service.h"
#include "chrome/browser/download/bubble/download_display_controller.h"
#include "chrome/browser/download/chrome_download_manager_delegate.h"
#include "chrome/browser/download/download_core_service.h"
#include "chrome/browser/download/download_core_service_factory.h"
#include "chrome/browser/download/download_item_model.h"
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/download/offline_item_model_manager_factory.h"
#include "chrome/browser/offline_items_collection/offline_content_aggregator_factory.h"
#include "chrome/browser/profiles/profile_key.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/download/download_display.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/test_browser_window.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/download/public/common/download_danger_type.h"
#include "components/download/public/common/download_item.h"
#include "components/download/public/common/mock_download_item.h"
#include "components/offline_items_collection/core/offline_item.h"
#include "components/offline_items_collection/core/offline_item_state.h"
#include "components/offline_items_collection/core/test_support/mock_offline_content_provider.h"
#include "content/public/browser/download_item_utils.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/mock_download_manager.h"
#include "content/public/test/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace {
OfflineItemState;
_;
NiceMock;
Return;
ReturnRef;
ReturnRefOfCopy;
SetArgPointee;
StrictMock;
StrictMockDownloadItem;
DownloadDangerType;
DownloadState;
DownloadUIModelPtr;
OfflineItemList;

const char kProviderNamespace[] =;

class MockDownloadDisplayController : public DownloadDisplayController {};

class MockDownloadBubbleUpdateService : public DownloadBubbleUpdateService {};

class DownloadBubbleUIControllerTest : public testing::Test {};

TEST_F(DownloadBubbleUIControllerTest, ProcessesNewItems) {}

TEST_F(DownloadBubbleUIControllerTest, ProcessesUpdatedItems) {}

TEST_F(DownloadBubbleUIControllerTest, UpdatedItemIsPendingDeepScanning) {}

TEST_F(DownloadBubbleUIControllerTest, TransientDownloadShouldNotShow) {}

TEST_F(DownloadBubbleUIControllerTest,
       CompleteHistoryImportShouldNotShowInPartialView) {}

TEST_F(DownloadBubbleUIControllerTest,
       OpeningMainViewRemovesCompletedEntryFromPartialView) {}

TEST_F(DownloadBubbleUIControllerTest,
       OpeningMainViewDoesNotRemoveInProgressEntryFromPartialView) {}

// Tests that no items are returned (i.e. no partial view will be shown) if it
// is too soon since the last partial view has been shown.
TEST_F(DownloadBubbleUIControllerTest, NoItemsReturnedForPartialViewTooSoon) {}

// Tests that the partial view timer doesn't start if the partial view was
// empty and thus not shown.
TEST_F(DownloadBubbleUIControllerTest, EmptyPartialViewDoesNotPreventOpening) {}

// Test that the preference suppresses the partial view.
TEST_F(DownloadBubbleUIControllerTest, PrefSuppressesPartialView) {}

}  // namespace