Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1408)

Unified Diff: chrome/browser/download/download_target_determiner_unittest.cc

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/download/download_target_determiner_unittest.cc
diff --git a/chrome/browser/download/download_target_determiner_unittest.cc b/chrome/browser/download/download_target_determiner_unittest.cc
index 05f18c27bdfa9d649b36a03988ef7818c11709ac..b050b361c2840af3e09181729749df49a26b5939 100644
--- a/chrome/browser/download/download_target_determiner_unittest.cc
+++ b/chrome/browser/download/download_target_determiner_unittest.cc
@@ -508,7 +508,7 @@ void NotifyExtensionsOverridePath(
callback.Run(new_path, DownloadPathReservationTracker::UNIQUIFY);
}
-TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_Basic) {
+TEST_F(DownloadTargetDeterminerTest, Basic) {
const DownloadTestCase kBasicTestCases[] = {
{// 0: Automatic Safe
AUTOMATIC, content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
@@ -559,7 +559,7 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_Basic) {
}
#if !BUILDFLAG(ANDROID_JAVA_UI)
-TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_CancelSaveAs) {
+TEST_F(DownloadTargetDeterminerTest, CancelSaveAs) {
const DownloadTestCase kCancelSaveAsTestCases[] = {
{// 0: Save_As Safe, Cancelled.
SAVE_AS, content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
@@ -578,7 +578,7 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_CancelSaveAs) {
// The SafeBrowsing check is performed early. Make sure that a download item
// that has been marked as DANGEROUS_URL behaves correctly.
-TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_DangerousUrl) {
+TEST_F(DownloadTargetDeterminerTest, DangerousUrl) {
const DownloadTestCase kSafeBrowsingTestCases[] = {
{// 0: Automatic Dangerous URL
AUTOMATIC, content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL,
@@ -652,7 +652,7 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_DangerousUrl) {
// The SafeBrowsing check is performed early. Make sure that a download item
// that has been marked as MAYBE_DANGEROUS_CONTENT behaves correctly.
-TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_MaybeDangerousContent) {
+TEST_F(DownloadTargetDeterminerTest, MaybeDangerousContent) {
const DownloadTestCase kSafeBrowsingTestCases[] = {
{// 0: Automatic Maybe dangerous content
AUTOMATIC, content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT,
@@ -712,7 +712,7 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_MaybeDangerousContent) {
#if !BUILDFLAG(ANDROID_JAVA_UI)
// Test whether the last saved directory is used for 'Save As' downloads.
-TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_LastSavePath) {
+TEST_F(DownloadTargetDeterminerTest, LastSavePath) {
const DownloadTestCase kLastSavePathTestCasesPre[] = {
{// 0: If the last save path is empty, then the default download directory
// should be used.
@@ -803,7 +803,7 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_LastSavePath) {
// These tests are run with the default downloads folder set to a virtual
// directory.
-TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_DefaultVirtual) {
+TEST_F(DownloadTargetDeterminerTest, DefaultVirtual) {
// The default download directory is the virutal path.
download_prefs()->SetDownloadPath(test_virtual_dir());
@@ -894,7 +894,7 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_DefaultVirtual) {
// Test that an inactive download will still get a virtual or local download
// path.
-TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_InactiveDownload) {
+TEST_F(DownloadTargetDeterminerTest, InactiveDownload) {
const DownloadTestCase kInactiveTestCases[] = {
{AUTOMATIC, content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
DownloadFileType::NOT_DANGEROUS, "http://example.com/foo.txt",
@@ -933,7 +933,7 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_InactiveDownload) {
// If the reserved path could not be verified, then the user should see a
// prompt.
-TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_ReservationFailed) {
+TEST_F(DownloadTargetDeterminerTest, ReservationFailed) {
const DownloadTestCase kReservationFailedCases[] = {
{// 0: Automatic download. Since the reservation fails, the disposition of
// the target is to prompt, but the returned path is used.
@@ -955,7 +955,7 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_ReservationFailed) {
}
// If the local path could not be determined, the download should be cancelled.
-TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_LocalPathFailed) {
+TEST_F(DownloadTargetDeterminerTest, LocalPathFailed) {
const DownloadTestCase kLocalPathFailedCases[] = {
{// 0: Automatic download.
AUTOMATIC, content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
@@ -980,7 +980,7 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_LocalPathFailed) {
// Downloads that have a danger level of ALLOW_ON_USER_GESTURE should be marked
// as safe depending on whether there was a user gesture associated with the
// download and whether the referrer was visited prior to today.
-TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_VisitedReferrer) {
+TEST_F(DownloadTargetDeterminerTest, VisitedReferrer) {
const DownloadTestCase kVisitedReferrerCases[] = {
// http://visited.example.com/ is added to the history as a visit that
// happened prior to today.
@@ -1172,7 +1172,7 @@ TEST_F(DownloadTargetDeterminerTest, TransitionType) {
#if !BUILDFLAG(ANDROID_JAVA_UI)
// These test cases are run with "Prompt for download" user preference set to
// true.
-TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_PromptAlways) {
+TEST_F(DownloadTargetDeterminerTest, PromptAlways) {
const DownloadTestCase kPromptingTestCases[] = {
{// 0: Safe Automatic - Should prompt because of "Prompt for download"
// preference setting.
@@ -1217,7 +1217,7 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_PromptAlways) {
// These test cases are run with "Prompt for download" user preference set to
// true. Automatic extension downloads shouldn't cause prompting.
// Android doesn't support extensions.
-TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_PromptAlways_Extension) {
+TEST_F(DownloadTargetDeterminerTest, PromptAlways_Extension) {
const DownloadTestCase kPromptingTestCases[] = {
{// 0: Automatic Browser Extension download. - Shouldn't prompt for browser
// extension downloads even if "Prompt for download" preference is set.
@@ -1263,7 +1263,7 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_PromptAlways_Extension) {
// If the download path is managed, then we don't show any prompts.
// Note that if the download path is managed, then PromptForDownload() is false.
-TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_ManagedPath) {
+TEST_F(DownloadTargetDeterminerTest, ManagedPath) {
const DownloadTestCase kManagedPathTestCases[] = {
{// 0: Automatic Safe
AUTOMATIC, content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
@@ -1292,7 +1292,7 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_ManagedPath) {
// Test basic functionality supporting extensions that want to override download
// filenames.
-TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_NotifyExtensionsSafe) {
+TEST_F(DownloadTargetDeterminerTest, NotifyExtensionsSafe) {
const DownloadTestCase kNotifyExtensionsTestCases[] = {
{// 0: Automatic Safe
AUTOMATIC, content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
@@ -1345,7 +1345,7 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_NotifyExtensionsSafe) {
// Test that filenames provided by extensions are passed into SafeBrowsing
// checks and dangerous download checks.
-TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_NotifyExtensionsUnsafe) {
+TEST_F(DownloadTargetDeterminerTest, NotifyExtensionsUnsafe) {
const DownloadTestCase kNotHandledBySafeBrowsing = {
AUTOMATIC,
content::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE,
@@ -1384,8 +1384,7 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_NotifyExtensionsUnsafe) {
// Test that conflict actions set by extensions are passed correctly into
// ReserveVirtualPath.
-TEST_F(DownloadTargetDeterminerTest,
- TargetDeterminer_NotifyExtensionsConflict) {
+TEST_F(DownloadTargetDeterminerTest, NotifyExtensionsConflict) {
const DownloadTestCase kNotifyExtensionsTestCase = {
AUTOMATIC,
content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
@@ -1433,8 +1432,7 @@ TEST_F(DownloadTargetDeterminerTest,
#if !BUILDFLAG(ANDROID_JAVA_UI)
// Test that relative paths returned by extensions are always relative to the
// default downloads path.
-TEST_F(DownloadTargetDeterminerTest,
- TargetDeterminer_NotifyExtensionsDefaultPath) {
+TEST_F(DownloadTargetDeterminerTest, NotifyExtensionsDefaultPath) {
const DownloadTestCase kNotifyExtensionsTestCase = {
SAVE_AS,
content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
@@ -1470,8 +1468,7 @@ TEST_F(DownloadTargetDeterminerTest,
}
#endif // !BUILDFLAG(ANDROID_JAVA_UI)
-TEST_F(DownloadTargetDeterminerTest,
- TargetDeterminer_InitialVirtualPathUnsafe) {
+TEST_F(DownloadTargetDeterminerTest, InitialVirtualPathUnsafe) {
const base::FilePath::CharType* kInitialPath =
FILE_PATH_LITERAL("some_path/bar.html");
@@ -1507,7 +1504,7 @@ TEST_F(DownloadTargetDeterminerTest,
// the download (ACCESS_DENIED, NO_SPACE, etc..), then the user should be
// prompted, and not otherwise. These test cases shouldn't result in prompting
// since the error is set to NETWORK_FAILED.
-TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_ResumedNoPrompt) {
+TEST_F(DownloadTargetDeterminerTest, ResumedNoPrompt) {
// All test cases run with GetPathInDownloadDir(kInitialPath) as the inital
// path.
const base::FilePath::CharType* kInitialPath =
@@ -1585,7 +1582,7 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_ResumedNoPrompt) {
// Test that a forced download doesn't prompt, even if the interrupt reason
// suggests that the target path may not be suitable for downloads.
-TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_ResumedForcedDownload) {
+TEST_F(DownloadTargetDeterminerTest, ResumedForcedDownload) {
const base::FilePath::CharType* kInitialPath =
FILE_PATH_LITERAL("some_path/bar.txt");
const DownloadTestCase kResumedForcedDownload = {
@@ -1624,7 +1621,7 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_ResumedForcedDownload) {
// the download (ACCESS_DENIED, NO_SPACE, etc..), then the user should be
// prompted, and not otherwise. These test cases result in prompting since the
// error is set to NO_SPACE.
-TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_ResumedWithPrompt) {
+TEST_F(DownloadTargetDeterminerTest, ResumedWithPrompt) {
// All test cases run with GetPathInDownloadDir(kInitialPath) as the inital
// path.
const base::FilePath::CharType* kInitialPath =
@@ -1709,8 +1706,7 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_ResumedWithPrompt) {
}
// Test intermediate filename generation for resumed downloads.
-TEST_F(DownloadTargetDeterminerTest,
- TargetDeterminer_IntermediateNameForResumed) {
+TEST_F(DownloadTargetDeterminerTest, IntermediateNameForResumed) {
// All test cases run with GetPathInDownloadDir(kInitialPath) as the inital
// path.
const base::FilePath::CharType kInitialPath[] =
@@ -1825,8 +1821,7 @@ TEST_F(DownloadTargetDeterminerTest,
}
// Test MIME type determination based on the target filename.
-TEST_F(DownloadTargetDeterminerTest,
- TargetDeterminer_MIMETypeDetermination) {
+TEST_F(DownloadTargetDeterminerTest, MIMETypeDetermination) {
// All test cases run with GetPathInDownloadDir(kInitialPath) as the inital
// path.
const base::FilePath::CharType kInitialPath[] =
@@ -2032,8 +2027,7 @@ class DownloadTargetDeterminerTestWithPlugin
// Check if secure handling of filetypes is determined correctly for PPAPI
// plugins.
-TEST_F(DownloadTargetDeterminerTestWithPlugin,
- TargetDeterminer_CheckForSecureHandling_PPAPI) {
+TEST_F(DownloadTargetDeterminerTestWithPlugin, CheckForSecureHandling_PPAPI) {
// All test cases run with GetPathInDownloadDir(kInitialPath) as the inital
// path.
const base::FilePath::CharType kInitialPath[] =
@@ -2102,7 +2096,7 @@ TEST_F(DownloadTargetDeterminerTestWithPlugin,
// Check if secure handling of filetypes is determined correctly for
// BrowserPlugins.
TEST_F(DownloadTargetDeterminerTestWithPlugin,
- TargetDeterminer_CheckForSecureHandling_BrowserPlugin) {
+ CheckForSecureHandling_BrowserPlugin) {
// All test cases run with GetPathInDownloadDir(kInitialPath) as the inital
// path.
const base::FilePath::CharType kInitialPath[] =

Powered by Google App Engine
This is Rietveld 408576698