chromium/chrome/browser/download/bubble/download_display_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_display_controller.h"

#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ref.h"
#include "base/time/time.h"
#include "chrome/browser/download/bubble/download_bubble_display_info.h"
#include "chrome/browser/download/bubble/download_bubble_ui_controller.h"
#include "chrome/browser/download/bubble/download_bubble_utils.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/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/mock_download_item.h"
#include "components/offline_items_collection/core/offline_item.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 {
OfflineItem;
_;
NiceMock;
Return;
ReturnRef;
ReturnRefOfCopy;
StrictMock;
StrictMockDownloadItem;
DownloadIconActive;
DownloadIconState;
DownloadState;
DownloadUIModelPtr;
OfflineItemList;
OfflineItemState;

class FakeDownloadDisplay : public DownloadDisplay {};

// TODO(chlily): Pull this and the very similar class in
// DownloadBubbleUIControllerTest out into a test utils file.
class MockDownloadBubbleUpdateService : public DownloadBubbleUpdateService {};

class MockDownloadCoreService : public DownloadCoreService {};

std::unique_ptr<KeyedService> BuildMockDownloadCoreService(
    content::BrowserContext* browser_context) {}

class DownloadDisplayControllerTest : public testing::Test {};

TEST_F(DownloadDisplayControllerTest, GetProgressItemsInProgress) {}

TEST_F(DownloadDisplayControllerTest, OfflineItemsUncertainProgress) {}

TEST_F(DownloadDisplayControllerTest, GetProgressItemsAllComplete) {}

TEST_F(DownloadDisplayControllerTest, UpdateToolbarButtonState) {}

TEST_F(DownloadDisplayControllerTest,
       UpdateToolbarButtonState_MultipleDownloads) {}

TEST_F(DownloadDisplayControllerTest,
       UpdateToolbarButtonState_OnCompleteItemCreated) {}

TEST_F(DownloadDisplayControllerTest, UpdateToolbarButtonState_DeepScanning) {}

TEST_F(DownloadDisplayControllerTest, UpdateToolbarButtonState_EmptyFilePath) {}

TEST_F(DownloadDisplayControllerTest,
       UpdateToolbarButtonState_DangerousDownload) {}

TEST_F(DownloadDisplayControllerTest,
       UpdateToolbarButtonState_InsecureDownload) {}

TEST_F(DownloadDisplayControllerTest, UpdateToolbarButtonState_OnRemovedItem) {}

TEST_F(DownloadDisplayControllerTest,
       UpdateToolbarButtonState_DownloadWasActionedOn) {}

TEST_F(DownloadDisplayControllerTest, UpdateToolbarButtonState_OnResume) {}

TEST_F(DownloadDisplayControllerTest,
       UpdateToolbarButtonState_DontShowDetailsIfNotAllowed) {}

TEST_F(DownloadDisplayControllerTest, InitialState_InProgressDownload) {}

TEST_F(DownloadDisplayControllerTest, InitialState_NoLastDownload) {}

TEST_F(DownloadDisplayControllerTest, OnButtonPressed_IconStateComplete) {}

TEST_F(DownloadDisplayControllerTest, OnButtonPressed_IconStateInProgress) {}

TEST_F(DownloadDisplayControllerTest,
       Fullscreen_DoesNotShowDetailsForInProgressOnExitFullscreen) {}

TEST_F(DownloadDisplayControllerTest,
       Fullscreen_ShowsIconAndDetailsForCompletedOnExitFullscreen) {}

// Test the path where the exclusive access bubble should not be shown (e.g. in
// kiosk mode or in immersive fullscreen).
TEST_F(DownloadDisplayControllerTest,
       Fullscreen_ShouldNotShowExclusiveAccessBubble) {}

TEST_F(DownloadDisplayControllerTest,
       ShowsDetailsWhenExtensionObservingDownloads) {}

}  // namespace