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

Side by Side Diff: content/browser/download/download_browsertest.cc

Issue 19052005: Move PathIsWritable, DirectoryExists, ContentsEqual, and TextContentsEqual to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file contains download browser tests that are known to be runnable 5 // This file contains download browser tests that are known to be runnable
6 // in a pure content context. Over time tests should be migrated here. 6 // in a pure content context. Over time tests should be migrated here.
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 // Verify that the files have the expected data and size. 768 // Verify that the files have the expected data and size.
769 // |file1| should be full of '*'s, and |file2| should be the same as the 769 // |file1| should be full of '*'s, and |file2| should be the same as the
770 // source file. 770 // source file.
771 base::FilePath file1(download1->GetTargetFilePath()); 771 base::FilePath file1(download1->GetTargetFilePath());
772 size_t file_size1 = URLRequestSlowDownloadJob::kFirstDownloadSize + 772 size_t file_size1 = URLRequestSlowDownloadJob::kFirstDownloadSize +
773 URLRequestSlowDownloadJob::kSecondDownloadSize; 773 URLRequestSlowDownloadJob::kSecondDownloadSize;
774 std::string expected_contents(file_size1, '*'); 774 std::string expected_contents(file_size1, '*');
775 ASSERT_TRUE(VerifyFile(file1, expected_contents, file_size1)); 775 ASSERT_TRUE(VerifyFile(file1, expected_contents, file_size1));
776 776
777 base::FilePath file2(download2->GetTargetFilePath()); 777 base::FilePath file2(download2->GetTargetFilePath());
778 ASSERT_TRUE(file_util::ContentsEqual( 778 ASSERT_TRUE(base::ContentsEqual(
779 file2, GetTestFilePath("download", "download-test.lib"))); 779 file2, GetTestFilePath("download", "download-test.lib")));
780 } 780 }
781 781
782 // Try to cancel just before we release the download file, by delaying final 782 // Try to cancel just before we release the download file, by delaying final
783 // rename callback. 783 // rename callback.
784 IN_PROC_BROWSER_TEST_F(DownloadContentTest, CancelAtFinalRename) { 784 IN_PROC_BROWSER_TEST_F(DownloadContentTest, CancelAtFinalRename) {
785 // Setup new factory. 785 // Setup new factory.
786 DownloadFileWithDelayFactory* file_factory = 786 DownloadFileWithDelayFactory* file_factory =
787 new DownloadFileWithDelayFactory(); 787 new DownloadFileWithDelayFactory();
788 DownloadManagerImpl* download_manager(DownloadManagerForShell(shell())); 788 DownloadManagerImpl* download_manager(DownloadManagerForShell(shell()));
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 // Start the second download and wait until it's done. The test server is 1567 // Start the second download and wait until it's done. The test server is
1568 // single threaded. The response to this download request should follow the 1568 // single threaded. The response to this download request should follow the
1569 // response to the previous resumption request. 1569 // response to the previous resumption request.
1570 GURL url2(test_server()->GetURL("rangereset?size=100&rst_limit=0&token=x")); 1570 GURL url2(test_server()->GetURL("rangereset?size=100&rst_limit=0&token=x"));
1571 DownloadAndWait(shell(), url2, DownloadItem::COMPLETE); 1571 DownloadAndWait(shell(), url2, DownloadItem::COMPLETE);
1572 1572
1573 EXPECT_TRUE(EnsureNoPendingDownloads()); 1573 EXPECT_TRUE(EnsureNoPendingDownloads());
1574 } 1574 }
1575 1575
1576 } // namespace content 1576 } // namespace content
OLDNEW
« no previous file with comments | « cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc ('k') | content/browser/download/download_item_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698