#include "chrome/browser/download/download_request_limiter.h"
#include <memory>
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "build/build_config.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/download/download_permission_request.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/permissions/permission_request_manager.h"
#include "components/permissions/test/mock_permission_prompt_factory.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/web_contents_tester.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/input/web_gesture_event.h"
#include "third_party/blink/public/common/input/web_keyboard_event.h"
#include "third_party/blink/public/common/input/web_mouse_event.h"
#include "third_party/blink/public/common/input/web_touch_event.h"
#if BUILDFLAG(IS_ANDROID)
#include "chrome/browser/flags/android/chrome_feature_list.h"
#endif
WebContents;
namespace {
enum TestingAction { … };
}
class DownloadRequestLimiterTest : public ChromeRenderViewHostTestHarness { … };
TEST_F(DownloadRequestLimiterTest, Allow) { … }
TEST_F(DownloadRequestLimiterTest, ResetOnNavigation) { … }
TEST_F(DownloadRequestLimiterTest, RendererInitiated) { … }
TEST_F(DownloadRequestLimiterTest, HistoryBack) { … }
TEST_F(DownloadRequestLimiterTest, HistoryForwardBack) { … }
TEST_F(DownloadRequestLimiterTest, DownloadRequestLimiter_ResetOnUserGesture) { … }
TEST_F(DownloadRequestLimiterTest, ResetOnReload) { … }
TEST_F(DownloadRequestLimiterTest, RawWebContents) { … }
TEST_F(DownloadRequestLimiterTest, SetHostContentSetting) { … }
TEST_F(DownloadRequestLimiterTest, ContentSettingChanged) { … }
TEST_F(DownloadRequestLimiterTest, RendererInitiatedDownloadFromAnotherOrigin) { … }
TEST_F(DownloadRequestLimiterTest,
DownloadStatusForOtherOriginsNotResetOnUserInteraction) { … }
TEST_F(DownloadRequestLimiterTest, OpaqueOrigins) { … }