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

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

Issue 1391423002: net: Remove FilePath version of URLRequestMockHTTPJob::GetMockUrl(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mmenke review Created 5 years, 2 months 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_browsertest.cc
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc
index 74709233687649313dc36346d331cbbff19c85a4..80b8cff66f09e3a5dbff4d3f34fd5721dcdd0702 100644
--- a/chrome/browser/download/download_browsertest.cc
+++ b/chrome/browser/download/download_browsertest.cc
@@ -119,6 +119,8 @@ using net::URLRequestMockHTTPJob;
namespace {
+const char kDownloadTest1Path[] = "download-test1.lib";
+
class CreatedObserver : public content::DownloadManager::Observer {
public:
explicit CreatedObserver(content::DownloadManager* manager)
@@ -242,11 +244,10 @@ class DownloadTestObserverResumable : public content::DownloadTestObserver {
// IDs and paths of CRX files used in tests.
const char kGoodCrxId[] = "ldnnhddmnhbkjipkidpdiheffobcpfmf";
-const base::FilePath kGoodCrxPath(FILE_PATH_LITERAL("extensions/good.crx"));
+const char kGoodCrxPath[] = "extensions/good.crx";
const char kLargeThemeCrxId[] = "pjpgmfcmabopnnfonnhmdjglfpjjfkbf";
-const base::FilePath kLargeThemePath(
- FILE_PATH_LITERAL("extensions/theme2.crx"));
+const char kLargeThemePath[] = "extensions/theme2.crx";
// Get History Information.
class DownloadsHistoryDataCollector {
@@ -1073,8 +1074,7 @@ class DownloadTest : public InProcessBrowserTest {
DownloadItem* StartMockDownloadAndInjectError(
content::TestFileErrorInjector* error_injector,
content::DownloadInterruptReason error) {
- base::FilePath file_path(FILE_PATH_LITERAL("download-test1.lib"));
- GURL url = URLRequestMockHTTPJob::GetMockUrl(file_path);
+ GURL url = URLRequestMockHTTPJob::GetMockUrl(kDownloadTest1Path);
content::TestFileErrorInjector::FileErrorInfo error_info;
error_info.url = url.spec();
@@ -1131,14 +1131,14 @@ class DownloadTest : public InProcessBrowserTest {
// Download a file due to the associated MIME type.
IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadMimeType) {
- base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl(kDownloadTest1Path));
// Download the file and wait. We do not expect the Select File dialog.
DownloadAndWait(browser(), url);
// Check state.
EXPECT_EQ(1, browser()->tab_strip_model()->count());
+ base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
CheckDownload(browser(), file, file);
}
@@ -1146,8 +1146,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadMimeType) {
// Download a file and confirm that the zone identifier (on windows)
// is set to internet.
IN_PROC_BROWSER_TEST_F(DownloadTest, CheckInternetZone) {
- base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl(kDownloadTest1Path));
// Download the file and wait. We do not expect the Select File dialog.
DownloadAndWait(browser(), url);
@@ -1155,6 +1154,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, CheckInternetZone) {
// Check state. Special file state must be checked before CheckDownload,
// as CheckDownload will delete the output file.
EXPECT_EQ(1, browser()->tab_strip_model()->count());
+ base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
base::FilePath downloaded_file(DestinationFile(browser(), file));
if (base::VolumeSupportsADS(downloaded_file))
EXPECT_TRUE(base::HasInternetZoneIdentifier(downloaded_file));
@@ -1168,8 +1168,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadMimeTypeSelect) {
// Re-enable prompting.
browser()->profile()->GetPrefs()->SetBoolean(
prefs::kPromptForDownload, true);
- base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl(kDownloadTest1Path));
EnableFileChooser(true);
@@ -1188,6 +1187,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadMimeTypeSelect) {
// Check state.
EXPECT_EQ(1, browser()->tab_strip_model()->count());
+ base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
CheckDownload(browser(), file, file);
}
@@ -1195,7 +1195,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadMimeTypeSelect) {
// did not initiate.
IN_PROC_BROWSER_TEST_F(DownloadTest, NoDownload) {
base::FilePath file(FILE_PATH_LITERAL("download-test2.html"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl("download-test2.html"));
base::FilePath file_path(DestinationFile(browser(), file));
// Open a web page and wait.
@@ -1271,8 +1271,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadResourceThrottleCancels) {
// Navigate to a page with the same domain as the file to download. We can't
// navigate directly to the file we don't want to download because cross-site
// navigations reset the TabDownloadState.
- base::FilePath same_site_path(FILE_PATH_LITERAL("download_script.html"));
- GURL same_site_url(URLRequestMockHTTPJob::GetMockUrl(same_site_path));
+ GURL same_site_url(URLRequestMockHTTPJob::GetMockUrl("download_script.html"));
ui_test_utils::NavigateToURL(browser(), same_site_url);
// Make sure the initial navigation didn't trigger a download.
@@ -1317,14 +1316,14 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadResourceThrottleCancels) {
// download tab opened and the file exists as the filename specified in the
// header. This also ensures we properly handle empty file downloads.
IN_PROC_BROWSER_TEST_F(DownloadTest, ContentDisposition) {
- base::FilePath file(FILE_PATH_LITERAL("download-test3.gif"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl("download-test3.gif"));
base::FilePath download_file(
FILE_PATH_LITERAL("download-test3-attachment.gif"));
// Download a file and wait.
DownloadAndWait(browser(), url);
+ base::FilePath file(FILE_PATH_LITERAL("download-test3.gif"));
CheckDownload(browser(), download_file, file);
// Check state.
@@ -1359,8 +1358,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, IncognitoDownload) {
// Download a file in the Incognito window and wait.
CreateAndSetDownloadsDirectory(incognito);
- base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl(kDownloadTest1Path));
// Since |incognito| is a separate browser, we have to set it up explicitly.
incognito->profile()->GetPrefs()->SetBoolean(prefs::kPromptForDownload,
false);
@@ -1386,6 +1384,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, IncognitoDownload) {
ExpectWindowCountAfterDownload(1);
#endif
+ base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
CheckDownload(browser(), file, file);
}
@@ -1460,8 +1459,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadTest_IncognitoRegular) {
IN_PROC_BROWSER_TEST_F(DownloadTest, DontCloseNewTab1) {
// Because it's an HTML link, it should open a web page rather than
// downloading.
- base::FilePath file1(FILE_PATH_LITERAL("download-test2.html"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file1));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl("download-test2.html"));
// Open a web page and wait.
ui_test_utils::NavigateToURLWithDisposition(
@@ -1480,8 +1478,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DontCloseNewTab1) {
IN_PROC_BROWSER_TEST_F(DownloadTest, CloseNewTab1) {
// Download a file in a new background tab and wait. The tab is automatically
// closed when the download begins.
- base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl(kDownloadTest1Path));
DownloadAndWaitWithDisposition(
browser(),
url,
@@ -1491,6 +1488,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, CloseNewTab1) {
// When the download finishes, we should still have one tab.
EXPECT_EQ(1, browser()->tab_strip_model()->count());
+ base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
CheckDownload(browser(), file, file);
}
@@ -1503,8 +1501,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, CloseNewTab1) {
IN_PROC_BROWSER_TEST_F(DownloadTest, DontCloseNewTab2) {
// Because it's an HTML link, it should open a web page rather than
// downloading.
- base::FilePath file1(FILE_PATH_LITERAL("download_page1.html"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file1));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl("download_page1.html"));
// Open a web page and wait.
ui_test_utils::NavigateToURL(browser(), url);
@@ -1531,8 +1528,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DontCloseNewTab2) {
IN_PROC_BROWSER_TEST_F(DownloadTest, DontCloseNewTab3) {
// Because it's an HTML link, it should open a web page rather than
// downloading.
- base::FilePath file1(FILE_PATH_LITERAL("download_page2.html"));
- GURL url1(URLRequestMockHTTPJob::GetMockUrl(file1));
+ GURL url1(URLRequestMockHTTPJob::GetMockUrl("download_page2.html"));
// Open a web page and wait.
ui_test_utils::NavigateToURL(browser(), url1);
@@ -1547,8 +1543,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DontCloseNewTab3) {
EXPECT_EQ(2, browser()->tab_strip_model()->count());
// Download a file and wait.
- base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl(kDownloadTest1Path));
DownloadAndWaitWithDisposition(browser(),
url,
CURRENT_TAB,
@@ -1557,6 +1552,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DontCloseNewTab3) {
// When the download finishes, we should have two tabs.
EXPECT_EQ(2, browser()->tab_strip_model()->count());
+ base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
CheckDownload(browser(), file, file);
}
@@ -1569,8 +1565,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DontCloseNewTab3) {
IN_PROC_BROWSER_TEST_F(DownloadTest, CloseNewTab2) {
// Because it's an HTML link, it should open a web page rather than
// downloading.
- base::FilePath file1(FILE_PATH_LITERAL("download_page3.html"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file1));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl("download_page3.html"));
// Open a web page and wait.
ui_test_utils::NavigateToURL(browser(), url);
@@ -1599,8 +1594,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, CloseNewTab2) {
IN_PROC_BROWSER_TEST_F(DownloadTest, CloseNewTab3) {
// Because it's an HTML link, it should open a web page rather than
// downloading.
- base::FilePath file1(FILE_PATH_LITERAL("download_page4.html"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file1));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl("download_page4.html"));
// Open a web page and wait.
ui_test_utils::NavigateToURL(browser(), url);
@@ -1795,8 +1789,8 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadHistoryDangerCheck) {
false);
// .swf file so that it's dangerous on all platforms (including CrOS).
- base::FilePath file(FILE_PATH_LITERAL("downloads/dangerous/dangerous.swf"));
- GURL download_url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL download_url(
+ URLRequestMockHTTPJob::GetMockUrl("downloads/dangerous/dangerous.swf"));
// Download the url and wait until the object has been stored.
scoped_ptr<content::DownloadTestObserver> download_observer(
@@ -1817,6 +1811,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadHistoryDangerCheck) {
// Confirm history storage is what you expect for an unvalidated
// dangerous file.
+ base::FilePath file(FILE_PATH_LITERAL("downloads/dangerous/dangerous.swf"));
history::DownloadRow& row(downloads_in_database->at(0));
EXPECT_EQ(DestinationFile(browser(), file), row.target_path);
EXPECT_NE(DownloadTargetDeterminer::GetCrDownloadPath(
@@ -1855,8 +1850,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadHistoryDangerCheck) {
// Test for crbug.com/14505. This tests that chrome:// urls are still functional
// after download of a file while viewing another chrome://.
IN_PROC_BROWSER_TEST_F(DownloadTest, ChromeURLAfterDownload) {
- base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
- GURL download_url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL download_url(URLRequestMockHTTPJob::GetMockUrl(kDownloadTest1Path));
GURL flags_url(chrome::kChromeUIFlagsURL);
GURL extensions_url(chrome::kChromeUIExtensionsFrameURL);
@@ -1879,8 +1873,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, ChromeURLAfterDownload) {
// will be able to close.
IN_PROC_BROWSER_TEST_F(DownloadTest, BrowserCloseAfterDownload) {
GURL downloads_url(chrome::kChromeUIFlagsURL);
- base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
- GURL download_url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL download_url(URLRequestMockHTTPJob::GetMockUrl(kDownloadTest1Path));
ui_test_utils::NavigateToURL(browser(), downloads_url);
WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents();
@@ -1904,8 +1897,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, BrowserCloseAfterDownload) {
// Test to make sure the 'download' attribute in anchor tag is respected.
IN_PROC_BROWSER_TEST_F(DownloadTest, AnchorDownloadTag) {
- base::FilePath file(FILE_PATH_LITERAL("download-anchor-attrib.html"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl("download-anchor-attrib.html"));
// Create a download, wait until it's complete, and confirm
// we're in the expected state.
@@ -1925,7 +1917,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, AnchorDownloadTag) {
// Test to make sure auto-open works.
IN_PROC_BROWSER_TEST_F(DownloadTest, AutoOpen) {
base::FilePath file(FILE_PATH_LITERAL("download-autoopen.txt"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl("download-autoopen.txt"));
ASSERT_TRUE(
GetDownloadPrefs(browser())->EnableAutoOpenBasedOnExtension(file));
@@ -2049,8 +2041,8 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, CrxInstallAcceptPermissions) {
// Test installing a CRX that fails integrity checks.
IN_PROC_BROWSER_TEST_F(DownloadTest, CrxInvalid) {
- base::FilePath file(FILE_PATH_LITERAL("extensions/bad_signature.crx"));
- GURL extension_url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL extension_url(
+ URLRequestMockHTTPJob::GetMockUrl("extensions/bad_signature.crx"));
// Install a mock install UI that simulates a user allowing permission to
// finish the install, and dismisses any error message. We check that the
@@ -2110,8 +2102,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, CrxLargeTheme) {
// Tests for download initiation functions.
IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadUrl) {
- base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl(kDownloadTest1Path));
// DownloadUrl always prompts; return acceptance of whatever it prompts.
EnableFileChooser(true);
@@ -2134,18 +2125,19 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadUrl) {
EXPECT_TRUE(DidShowFileChooser());
// Check state.
+ base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
EXPECT_EQ(1, browser()->tab_strip_model()->count());
ASSERT_TRUE(CheckDownload(browser(), file, file));
}
IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadUrlToPath) {
- base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl(kDownloadTest1Path));
WebContents* web_contents =
browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(web_contents);
+ base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
base::ScopedTempDir other_directory;
ASSERT_TRUE(other_directory.CreateUniqueTempDir());
base::FilePath target_file_full_path
@@ -3377,8 +3369,8 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, SafeSupportedFile) {
IN_PROC_BROWSER_TEST_F(DownloadTest, FeedbackService) {
// Make a dangerous file.
- base::FilePath file(FILE_PATH_LITERAL("downloads/dangerous/dangerous.swf"));
- GURL download_url(net::URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL download_url(net::URLRequestMockHTTPJob::GetMockUrl(
+ "downloads/dangerous/dangerous.swf"));
scoped_ptr<content::DownloadTestObserverInterrupted> observer(
new content::DownloadTestObserverInterrupted(
DownloadManagerForBrowser(browser()), 1,
@@ -3450,14 +3442,14 @@ IN_PROC_BROWSER_TEST_F(DownloadTestWithShelf, DownloadAndWait) {
// tab, opening a second tab, closing the shelf, going back to the first tab,
// and checking that the shelf is closed.
IN_PROC_BROWSER_TEST_F(DownloadTestWithShelf, PerWindowShelf) {
- base::FilePath file(FILE_PATH_LITERAL("download-test3.gif"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl("download-test3.gif"));
base::FilePath download_file(
FILE_PATH_LITERAL("download-test3-attachment.gif"));
// Download a file and wait.
DownloadAndWait(browser(), url);
+ base::FilePath file(FILE_PATH_LITERAL("download-test3.gif"));
CheckDownload(browser(), download_file, file);
// Check state.
@@ -3486,8 +3478,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTestWithShelf, PerWindowShelf) {
// Check whether the downloads shelf is closed when the downloads tab is
// invoked.
IN_PROC_BROWSER_TEST_F(DownloadTestWithShelf, CloseShelfOnDownloadsTab) {
- base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl(kDownloadTest1Path));
// Download the file and wait. We do not expect the Select File dialog.
DownloadAndWait(browser(), url);
@@ -3510,8 +3501,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTestWithShelf, IncognitoDownload) {
// Download a file in the Incognito window and wait.
CreateAndSetDownloadsDirectory(incognito);
- base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl(kDownloadTest1Path));
// Since |incognito| is a separate browser, we have to set it up explicitly.
incognito->profile()->GetPrefs()->SetBoolean(prefs::kPromptForDownload,
false);
@@ -3532,8 +3522,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTestWithShelf, IncognitoDownload) {
//
// Regression test for http://crbug.com/44454
IN_PROC_BROWSER_TEST_F(DownloadTestWithShelf, NewWindow) {
- base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl(kDownloadTest1Path));
#if !defined(OS_MACOSX)
// See below.
Browser* first_browser = browser();
@@ -3582,13 +3571,13 @@ IN_PROC_BROWSER_TEST_F(DownloadTestWithShelf, NewWindow) {
// Download shelf should close. Download panel stays open on ChromeOS.
EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible());
+ base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
CheckDownload(browser(), file, file);
}
IN_PROC_BROWSER_TEST_F(DownloadTestWithShelf, PRE_DownloadTest_History) {
// Download a file and wait for it to be stored.
- base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
- GURL download_url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL download_url(URLRequestMockHTTPJob::GetMockUrl(kDownloadTest1Path));
HistoryObserver observer(browser()->profile());
DownloadAndWait(browser(), download_url);
observer.WaitForStored();
@@ -3609,13 +3598,13 @@ IN_PROC_BROWSER_TEST_F(DownloadTestWithShelf, PRE_DownloadTest_History) {
IN_PROC_BROWSER_TEST_F(DownloadTestWithShelf, MAYBE_DownloadTest_History) {
// This starts up right after PRE_DownloadTest_History and shares the same
// profile directory.
- base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
- GURL download_url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL download_url(URLRequestMockHTTPJob::GetMockUrl(kDownloadTest1Path));
std::vector<DownloadItem*> downloads;
content::DownloadManager* manager = DownloadManagerForBrowser(browser());
// Wait for the history to be loaded with a single DownloadItem. Check that
// it's the file that was downloaded in PRE_DownloadTest_History.
+ base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
CreatedObserver created_observer(manager);
created_observer.Wait();
manager->GetAllDownloads(&downloads);
@@ -3639,8 +3628,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTestWithShelf, MAYBE_DownloadTest_History) {
}
IN_PROC_BROWSER_TEST_F(DownloadTestWithShelf, HiddenDownload) {
- base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl(kDownloadTest1Path));
DownloadManager* download_manager = DownloadManagerForBrowser(browser());
scoped_ptr<content::DownloadTestObserver> observer(
@@ -3664,7 +3652,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTestWithShelf, HiddenDownload) {
// Test to make sure auto-open works.
IN_PROC_BROWSER_TEST_F(DownloadTestWithShelf, AutoOpen) {
base::FilePath file(FILE_PATH_LITERAL("download-autoopen.txt"));
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl("download-autoopen.txt"));
ASSERT_TRUE(
GetDownloadPrefs(browser())->EnableAutoOpenBasedOnExtension(file));
« no previous file with comments | « chrome/browser/content_settings/content_settings_browsertest.cc ('k') | chrome/browser/download/save_page_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698