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

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

Issue 10824132: Avoid LazyInstance in DownloadPathReservationTracker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 4 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
« no previous file with comments | « chrome/browser/download/download_path_reservation_tracker.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_path_reservation_tracker_unittest.cc
diff --git a/chrome/browser/download/download_path_reservation_tracker_unittest.cc b/chrome/browser/download/download_path_reservation_tracker_unittest.cc
index aceaf3b2621f425047e397d65bc582605591f1ec..a4085fc597049cce03a6527d2eb1785eb3d11019 100644
--- a/chrome/browser/download/download_path_reservation_tracker_unittest.cc
+++ b/chrome/browser/download/download_path_reservation_tracker_unittest.cc
@@ -61,8 +61,6 @@ class FakeDownloadItem : public MockDownloadItem {
ObserverList<Observer> observers_;
};
-} // namespace
-
class DownloadPathReservationTrackerTest : public testing::Test {
public:
DownloadPathReservationTrackerTest();
@@ -129,7 +127,7 @@ FilePath DownloadPathReservationTrackerTest::GetPathInDownloadsDirectory(
}
bool DownloadPathReservationTrackerTest::IsPathInUse(const FilePath& path) {
- return DownloadPathReservationTracker::GetInstance()->IsPathInUse(path);
+ return DownloadPathReservationTracker::IsPathInUseForTesting(path);
}
void DownloadPathReservationTrackerTest::CallGetReservedPath(
@@ -160,6 +158,8 @@ void DownloadPathReservationTrackerTest::TestReservedPathCallback(
*return_verified = verified;
}
+} // namespace
+
// A basic reservation is acquired and committed.
TEST_F(DownloadPathReservationTrackerTest, BasicReservation) {
scoped_ptr<FakeDownloadItem> item(CreateDownloadItem(1));
@@ -238,10 +238,10 @@ TEST_F(DownloadPathReservationTrackerTest, ConflictingFiles) {
EXPECT_TRUE(IsPathInUse(path));
EXPECT_TRUE(IsPathInUse(reserved_path));
EXPECT_TRUE(verified);
- // The path should be uniquified, skipping over foo.txt and
+ // The path should be uniquified, skipping over foo.txt but not over
// "foo (1).txt.crdownload"
EXPECT_EQ(
- GetPathInDownloadsDirectory(FILE_PATH_LITERAL("foo (2).txt")).value(),
+ GetPathInDownloadsDirectory(FILE_PATH_LITERAL("foo (1).txt")).value(),
reserved_path.value());
item.reset();
« no previous file with comments | « chrome/browser/download/download_path_reservation_tracker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698