Chromium Code Reviews| Index: chrome/browser/download/download_browsertest.cc |
| diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc |
| index 9abd16faa5a119912c336bb6664aed1a1191bbf5..8d0724e72feb72584d0ee39b6b70e651a0bce80b 100644 |
| --- a/chrome/browser/download/download_browsertest.cc |
| +++ b/chrome/browser/download/download_browsertest.cc |
| @@ -241,11 +241,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 { |
| @@ -1072,8 +1071,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("download-test1.lib"); |
| content::TestFileErrorInjector::FileErrorInfo error_info; |
| error_info.url = url.spec(); |
| @@ -1130,14 +1128,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("download-test1.lib")); |
|
mmenke
2015/10/14 16:43:20
Suggest making the path a constant char[] (Either
tfarina
2015/10/17 22:24:44
Done.
|
| // 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); |
| } |
| @@ -1145,8 +1143,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("download-test1.lib")); |
| // Download the file and wait. We do not expect the Select File dialog. |
| DownloadAndWait(browser(), url); |
| @@ -1154,6 +1151,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)); |
| @@ -1167,8 +1165,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("download-test1.lib")); |
| EnableFileChooser(true); |
| @@ -1187,6 +1184,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); |
| } |
| @@ -1194,7 +1192,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. |
| @@ -1270,8 +1268,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. |
| @@ -1316,14 +1313,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. |
| @@ -1358,8 +1355,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("download-test1.lib")); |
| // Since |incognito| is a separate browser, we have to set it up explicitly. |
| incognito->profile()->GetPrefs()->SetBoolean(prefs::kPromptForDownload, |
| false); |
| @@ -1385,6 +1381,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, IncognitoDownload) { |
| ExpectWindowCountAfterDownload(1); |
| #endif |
| + base::FilePath file(FILE_PATH_LITERAL("download-test1.lib")); |
| CheckDownload(browser(), file, file); |
| } |
| @@ -1459,8 +1456,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( |
| @@ -1479,8 +1475,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("download-test1.lib")); |
| DownloadAndWaitWithDisposition( |
| browser(), |
| url, |
| @@ -1490,6 +1485,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); |
| } |
| @@ -1502,8 +1498,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); |
| @@ -1530,8 +1525,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); |
| @@ -1546,8 +1540,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("download-test1.lib")); |
| DownloadAndWaitWithDisposition(browser(), |
| url, |
| CURRENT_TAB, |
| @@ -1556,6 +1549,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); |
| } |
| @@ -1568,8 +1562,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); |
| @@ -1598,8 +1591,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); |
| @@ -1753,8 +1745,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( |
| @@ -1775,6 +1767,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( |
| @@ -1813,8 +1806,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("download-test1.lib")); |
| GURL flags_url(chrome::kChromeUIFlagsURL); |
| GURL extensions_url(chrome::kChromeUIExtensionsFrameURL); |
| @@ -1837,8 +1829,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("download-test1.lib")); |
| ui_test_utils::NavigateToURL(browser(), downloads_url); |
| WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); |
| @@ -1862,8 +1853,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. |
| @@ -1883,7 +1873,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)); |
| @@ -2007,8 +1997,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 |
| @@ -2068,8 +2058,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("download-test1.lib")); |
| // DownloadUrl always prompts; return acceptance of whatever it prompts. |
| EnableFileChooser(true); |
| @@ -2092,18 +2081,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("download-test1.lib")); |
| 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 |
| @@ -3335,8 +3325,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, |
| @@ -3408,14 +3398,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. |
| @@ -3444,8 +3434,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("download-test1.lib")); |
| // Download the file and wait. We do not expect the Select File dialog. |
| DownloadAndWait(browser(), url); |
| @@ -3468,8 +3457,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("download-test1.lib")); |
| // Since |incognito| is a separate browser, we have to set it up explicitly. |
| incognito->profile()->GetPrefs()->SetBoolean(prefs::kPromptForDownload, |
| false); |
| @@ -3490,8 +3478,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("download-test1.lib")); |
| #if !defined(OS_MACOSX) |
| // See below. |
| Browser* first_browser = browser(); |
| @@ -3540,13 +3527,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("download-test1.lib")); |
| HistoryObserver observer(browser()->profile()); |
| DownloadAndWait(browser(), download_url); |
| observer.WaitForStored(); |
| @@ -3567,13 +3554,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("download-test1.lib")); |
| 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); |
| @@ -3597,8 +3584,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("download-test1.lib")); |
| DownloadManager* download_manager = DownloadManagerForBrowser(browser()); |
| scoped_ptr<content::DownloadTestObserver> observer( |
| @@ -3622,7 +3608,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)); |