• Home
  • Raw
  • Download

Lines Matching refs:base

18 using base::File;
19 using base::FilePath;
22 base::ScopedTempDir temp_dir; in TEST()
30 EXPECT_EQ(base::File::FILE_ERROR_FAILED, file.error_details()); in TEST()
32 File file2(base::File::FILE_ERROR_TOO_MANY_OPENED); in TEST()
34 EXPECT_EQ(base::File::FILE_ERROR_TOO_MANY_OPENED, file2.error_details()); in TEST()
39 File file(file_path, base::File::FLAG_OPEN | base::File::FLAG_READ); in TEST()
41 EXPECT_EQ(base::File::FILE_ERROR_NOT_FOUND, file.error_details()); in TEST()
42 EXPECT_EQ(base::File::FILE_ERROR_NOT_FOUND, base::File::GetLastFileError()); in TEST()
47 File file(file_path, base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_READ); in TEST()
50 EXPECT_EQ(base::File::FILE_OK, file.error_details()); in TEST()
55 File file(file_path, base::File::FLAG_OPEN | base::File::FLAG_READ); in TEST()
58 EXPECT_EQ(base::File::FILE_OK, file.error_details()); in TEST()
68 file.Initialize(file_path, base::File::FLAG_OPEN | base::File::FLAG_READ); in TEST()
71 EXPECT_EQ(base::File::FILE_OK, file.error_details()); in TEST()
80 File file(file_path, base::File::FLAG_CREATE | base::File::FLAG_READ); in TEST()
83 EXPECT_EQ(base::File::FILE_ERROR_EXISTS, file.error_details()); in TEST()
84 EXPECT_EQ(base::File::FILE_ERROR_EXISTS, base::File::GetLastFileError()); in TEST()
90 base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE); in TEST()
93 EXPECT_EQ(base::File::FILE_OK, file.error_details()); in TEST()
100 base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_READ | in TEST()
101 base::File::FLAG_DELETE_ON_CLOSE); in TEST()
104 EXPECT_EQ(base::File::FILE_OK, file.error_details()); in TEST()
107 EXPECT_FALSE(base::PathExists(file_path)); in TEST()
111 base::ScopedTempDir temp_dir; in TEST()
115 base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_DELETE_ON_CLOSE); in TEST()
121 base::ScopedTempDir temp_dir; in TEST()
126 File file(file_path, base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_ASYNC); in TEST()
132 File file(file_path, base::File::FLAG_OPEN_ALWAYS); in TEST()
139 base::ScopedTempDir temp_dir; in TEST()
145 base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_READ | in TEST()
146 base::File::FLAG_SHARE_DELETE); in TEST()
149 EXPECT_EQ(base::File::FILE_OK, file.error_details()); in TEST()
153 base::File::FLAG_OPEN | base::File::FLAG_DELETE_ON_CLOSE | in TEST()
154 base::File::FLAG_READ); in TEST()
157 EXPECT_EQ(base::File::FILE_OK, same_file.error_details()); in TEST()
162 EXPECT_FALSE(base::PathExists(file_path)); in TEST()
166 base::ScopedTempDir temp_dir; in TEST()
170 base::File::FLAG_CREATE | base::File::FLAG_READ | in TEST()
171 base::File::FLAG_WRITE); in TEST()
249 base::ScopedTempDir temp_dir; in TEST()
261 base::ScopedTempDir temp_dir; in TEST()
264 File file(file_path, base::File::FLAG_CREATE | base::File::FLAG_APPEND); in TEST()
284 base::File::FLAG_OPEN | base::File::FLAG_READ | in TEST()
285 base::File::FLAG_APPEND); in TEST()
313 base::ScopedTempDir temp_dir; in TEST()
317 base::File::FLAG_CREATE | base::File::FLAG_READ | in TEST()
318 base::File::FLAG_WRITE); in TEST()
362 base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE); in TEST()
372 base::ScopedTempDir temp_dir;
375 base::File::FLAG_CREATE | base::File::FLAG_WRITE |
376 base::File::FLAG_WRITE_ATTRIBUTES);
380 base::File::Info info;
385 base::Time now = base::Time::Now() + base::TimeDelta::FromSeconds(2);
392 base::Time creation_time = info.creation_time;
404 base::Time new_last_accessed =
405 info.last_accessed + base::TimeDelta::FromSeconds(234);
406 base::Time new_last_modified =
407 info.last_modified + base::TimeDelta::FromMinutes(567);
435 base::ScopedTempDir temp_dir;
440 base::File::FLAG_CREATE | base::File::FLAG_READ |
441 base::File::FLAG_WRITE);
448 EXPECT_EQ(0, file.Seek(base::File::FROM_BEGIN, 0));
460 base::ScopedTempDir temp_dir;
465 base::File::FLAG_CREATE | base::File::FLAG_READ |
466 base::File::FLAG_WRITE);
484 base::ScopedTempDir temp_dir;
488 base::File::FLAG_CREATE | base::File::FLAG_READ |
489 base::File::FLAG_WRITE);
493 EXPECT_EQ(kOffset, file.Seek(base::File::FROM_BEGIN, kOffset));
494 EXPECT_EQ(2 * kOffset, file.Seek(base::File::FROM_CURRENT, kOffset));
495 EXPECT_EQ(kOffset, file.Seek(base::File::FROM_CURRENT, -kOffset));
497 EXPECT_EQ(kOffset, file.Seek(base::File::FROM_END, -kOffset));
501 base::ScopedTempDir temp_dir;
504 File file(file_path,(base::File::FLAG_CREATE |
505 base::File::FLAG_READ |
506 base::File::FLAG_WRITE));
516 ASSERT_EQ(0, file.Seek(base::File::FROM_CURRENT, 0));
517 ASSERT_EQ(0, file2.Seek(base::File::FROM_CURRENT, 0));
519 ASSERT_EQ(kDataLen, file.Seek(base::File::FROM_CURRENT, 0));
520 ASSERT_EQ(kDataLen, file2.Seek(base::File::FROM_CURRENT, 0));
528 base::ScopedTempDir temp_dir;
531 File file(file_path,(base::File::FLAG_CREATE |
532 base::File::FLAG_READ |
533 base::File::FLAG_WRITE |
534 base::File::FLAG_DELETE_ON_CLOSE));
540 ASSERT_FALSE(base::PathExists(file_path));
550 base::ScopedTempDir temp_dir;
554 (base::File::FLAG_CREATE | base::File::FLAG_READ |
555 base::File::FLAG_WRITE | base::File::FLAG_DELETE_ON_CLOSE));
572 base::ScopedTempDir temp_dir;
578 base::File dir(
588 base::File::Info info;
596 base::ScopedTempDir temp_dir;
602 (base::File::FLAG_CREATE | base::File::FLAG_READ |
603 base::File::FLAG_WRITE | base::File::FLAG_CAN_DELETE_ON_CLOSE));
606 ASSERT_TRUE(base::PathExists(file_path));
610 base::ScopedTempDir temp_dir;
617 (base::File::FLAG_CREATE | base::File::FLAG_READ |
618 base::File::FLAG_WRITE | base::File::FLAG_CAN_DELETE_ON_CLOSE));
622 ASSERT_FALSE(base::PathExists(file_path));
626 base::ScopedTempDir temp_dir;
633 (base::File::FLAG_CREATE | base::File::FLAG_READ |
634 base::File::FLAG_WRITE | base::File::FLAG_CAN_DELETE_ON_CLOSE));
639 ASSERT_TRUE(base::PathExists(file_path));
643 base::ScopedTempDir temp_dir;
650 (base::File::FLAG_CREATE | base::File::FLAG_READ |
651 base::File::FLAG_WRITE | base::File::FLAG_DELETE_ON_CLOSE |
652 base::File::FLAG_SHARE_DELETE | base::File::FLAG_CAN_DELETE_ON_CLOSE));
661 ASSERT_FALSE(base::PathExists(file_path));
665 base::ScopedTempDir temp_dir;
672 (base::File::FLAG_CREATE | base::File::FLAG_READ |
673 base::File::FLAG_WRITE | base::File::FLAG_DELETE_ON_CLOSE |
674 base::File::FLAG_SHARE_DELETE | base::File::FLAG_CAN_DELETE_ON_CLOSE));
679 (base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE |
680 base::File::FLAG_SHARE_DELETE | base::File::FLAG_CAN_DELETE_ON_CLOSE));
685 ASSERT_TRUE(base::PathExists(file_path));
687 ASSERT_FALSE(base::PathExists(file_path));
691 base::ScopedTempDir temp_dir;
697 File file(file_path, (base::File::FLAG_CREATE | base::File::FLAG_READ |
698 base::File::FLAG_WRITE));
702 ASSERT_TRUE(base::PathExists(file_path));
706 base::ScopedTempDir temp_dir;
712 File file(file_path, (base::File::FLAG_CREATE | base::File::FLAG_READ |
713 base::File::FLAG_WRITE));
717 (base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE |
718 base::File::FLAG_DELETE_ON_CLOSE | base::File::FLAG_SHARE_DELETE));
722 ASSERT_TRUE(base::PathExists(file_path));
726 base::ScopedTempDir temp_dir;
732 (base::File::FLAG_CREATE | base::File::FLAG_READ |
733 base::File::FLAG_WRITE | base::File::FLAG_CAN_DELETE_ON_CLOSE));
738 base::MemoryMappedFile mapping;
746 ASSERT_TRUE(base::PathExists(file_path));
751 base::ScopedTempDir temp_dir;
755 File file(file_path, base::File::FLAG_CREATE | base::File::FLAG_WRITE |
756 base::File::FLAG_ASYNC);