Lines Matching refs:base
17 using base::File;
18 using base::FilePath;
21 base::ScopedTempDir temp_dir; in TEST()
29 EXPECT_EQ(base::File::FILE_ERROR_FAILED, file.error_details()); in TEST()
31 File file2(base::File::FILE_ERROR_TOO_MANY_OPENED); in TEST()
33 EXPECT_EQ(base::File::FILE_ERROR_TOO_MANY_OPENED, file2.error_details()); in TEST()
38 File file(file_path, base::File::FLAG_OPEN | base::File::FLAG_READ); in TEST()
40 EXPECT_EQ(base::File::FILE_ERROR_NOT_FOUND, file.error_details()); in TEST()
45 File file(file_path, base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_READ); in TEST()
48 EXPECT_EQ(base::File::FILE_OK, file.error_details()); in TEST()
53 File file(file_path, base::File::FLAG_OPEN | base::File::FLAG_READ); in TEST()
56 EXPECT_EQ(base::File::FILE_OK, file.error_details()); in TEST()
66 file.Initialize(file_path, base::File::FLAG_OPEN | base::File::FLAG_READ); in TEST()
69 EXPECT_EQ(base::File::FILE_OK, file.error_details()); in TEST()
78 File file(file_path, base::File::FLAG_CREATE | base::File::FLAG_READ); in TEST()
81 EXPECT_EQ(base::File::FILE_ERROR_EXISTS, file.error_details()); in TEST()
87 base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE); in TEST()
90 EXPECT_EQ(base::File::FILE_OK, file.error_details()); in TEST()
97 base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_READ | in TEST()
98 base::File::FLAG_DELETE_ON_CLOSE); in TEST()
101 EXPECT_EQ(base::File::FILE_OK, file.error_details()); in TEST()
104 EXPECT_FALSE(base::PathExists(file_path)); in TEST()
108 base::ScopedTempDir temp_dir; in TEST()
113 File file(file_path, base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_ASYNC); in TEST()
119 File file(file_path, base::File::FLAG_OPEN_ALWAYS); in TEST()
126 base::ScopedTempDir temp_dir; in TEST()
132 base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_READ | in TEST()
133 base::File::FLAG_SHARE_DELETE); in TEST()
136 EXPECT_EQ(base::File::FILE_OK, file.error_details()); in TEST()
140 base::File::FLAG_OPEN | base::File::FLAG_DELETE_ON_CLOSE | in TEST()
141 base::File::FLAG_READ); in TEST()
144 EXPECT_EQ(base::File::FILE_OK, same_file.error_details()); in TEST()
149 EXPECT_FALSE(base::PathExists(file_path)); in TEST()
153 base::ScopedTempDir temp_dir; in TEST()
157 base::File::FLAG_CREATE | base::File::FLAG_READ | in TEST()
158 base::File::FLAG_WRITE); in TEST()
225 base::ScopedTempDir temp_dir; in TEST()
228 File file(file_path, base::File::FLAG_CREATE | base::File::FLAG_APPEND); in TEST()
244 base::File::FLAG_OPEN | base::File::FLAG_READ | in TEST()
245 base::File::FLAG_APPEND); in TEST()
273 base::ScopedTempDir temp_dir; in TEST()
277 base::File::FLAG_CREATE | base::File::FLAG_READ | in TEST()
278 base::File::FLAG_WRITE); in TEST()
325 base::ScopedTempDir temp_dir;
328 base::File::FLAG_CREATE | base::File::FLAG_WRITE |
329 base::File::FLAG_WRITE_ATTRIBUTES);
333 base::File::Info info;
338 base::Time now = base::Time::Now() + base::TimeDelta::FromSeconds(2);
345 base::Time creation_time = info.creation_time;
357 base::Time new_last_accessed =
358 info.last_accessed + base::TimeDelta::FromSeconds(234);
359 base::Time new_last_modified =
360 info.last_modified + base::TimeDelta::FromMinutes(567);
388 base::ScopedTempDir temp_dir;
392 base::File::FLAG_CREATE | base::File::FLAG_READ |
393 base::File::FLAG_WRITE);
400 EXPECT_EQ(0, file.Seek(base::File::FROM_BEGIN, 0));
412 base::ScopedTempDir temp_dir;
416 base::File::FLAG_CREATE | base::File::FLAG_READ |
417 base::File::FLAG_WRITE);
435 base::ScopedTempDir temp_dir;
439 base::File::FLAG_CREATE | base::File::FLAG_READ |
440 base::File::FLAG_WRITE);
444 EXPECT_EQ(kOffset, file.Seek(base::File::FROM_BEGIN, kOffset));
445 EXPECT_EQ(2 * kOffset, file.Seek(base::File::FROM_CURRENT, kOffset));
446 EXPECT_EQ(kOffset, file.Seek(base::File::FROM_CURRENT, -kOffset));
448 EXPECT_EQ(kOffset, file.Seek(base::File::FROM_END, -kOffset));
452 base::ScopedTempDir temp_dir;
455 File file(file_path,(base::File::FLAG_CREATE |
456 base::File::FLAG_READ |
457 base::File::FLAG_WRITE));
467 ASSERT_EQ(0, file.Seek(base::File::FROM_CURRENT, 0));
468 ASSERT_EQ(0, file2.Seek(base::File::FROM_CURRENT, 0));
470 ASSERT_EQ(kDataLen, file.Seek(base::File::FROM_CURRENT, 0));
471 ASSERT_EQ(kDataLen, file2.Seek(base::File::FROM_CURRENT, 0));
479 base::ScopedTempDir temp_dir;
482 File file(file_path,(base::File::FLAG_CREATE |
483 base::File::FLAG_READ |
484 base::File::FLAG_WRITE |
485 base::File::FLAG_DELETE_ON_CLOSE));
491 ASSERT_FALSE(base::PathExists(file_path));
496 base::ScopedTempDir temp_dir;
501 base::File dir(
511 base::File::Info info;