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

Side by Side Diff: base/file_util_unittest.cc

Issue 600104: Actually delete databases in CookiesTreeModel. (Closed)
Patch Set: fixed comments Created 10 years, 10 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
« no previous file with comments | « base/file_util_posix.cc ('k') | base/file_util_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #include <shlobj.h> 10 #include <shlobj.h>
11 #include <tchar.h> 11 #include <tchar.h>
(...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after
1382 FilePath(foo.value() + FILE_PATH_LITERAL("/bar.txt")))); 1382 FilePath(foo.value() + FILE_PATH_LITERAL("/bar.txt"))));
1383 #elif defined(OS_MACOSX) 1383 #elif defined(OS_MACOSX)
1384 // We can't really do this test on OS X since the case-sensitivity of the 1384 // We can't really do this test on OS X since the case-sensitivity of the
1385 // filesystem is configurable. 1385 // filesystem is configurable.
1386 #elif defined(OS_POSIX) 1386 #elif defined(OS_POSIX)
1387 EXPECT_FALSE(file_util::ContainsPath(foo, 1387 EXPECT_FALSE(file_util::ContainsPath(foo,
1388 foo_caps.Append(FILE_PATH_LITERAL("bar.txt")))); 1388 foo_caps.Append(FILE_PATH_LITERAL("bar.txt"))));
1389 #endif 1389 #endif
1390 } 1390 }
1391 1391
1392 TEST_F(FileUtilTest, LastModified) {
1393 FilePath data_dir = test_dir_.Append(FILE_PATH_LITERAL("FilePathTest"));
1394
1395 // Create a fresh, empty copy of this directory.
1396 if (file_util::PathExists(data_dir)) {
1397 ASSERT_TRUE(file_util::Delete(data_dir, true));
1398 }
1399 ASSERT_TRUE(file_util::CreateDirectory(data_dir));
1400
1401 FilePath foobar(data_dir.Append(FILE_PATH_LITERAL("foobar.txt")));
1402 std::string data("hello");
1403 ASSERT_TRUE(file_util::WriteFile(foobar, data.c_str(), data.length()));
1404
1405 base::Time modification_time;
1406 // Note that this timestamp is divisible by two (seconds) - FAT stores
1407 // modification times with 2s resolution.
1408 ASSERT_TRUE(base::Time::FromString(L"Tue, 15 Nov 1994, 12:45:26 GMT",
1409 &modification_time));
1410 ASSERT_TRUE(file_util::SetLastModifiedTime(foobar, modification_time));
1411 file_util::FileInfo file_info;
1412 ASSERT_TRUE(file_util::GetFileInfo(foobar, &file_info));
1413 ASSERT_TRUE(file_info.last_modified == modification_time);
1414 }
1415
1392 } // namespace 1416 } // namespace
OLDNEW
« no previous file with comments | « base/file_util_posix.cc ('k') | base/file_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698