• Home
  • Raw
  • Download

Lines Matching refs:file

21     File file;  in TEST()  local
22 EXPECT_FALSE(file.IsValid()); in TEST()
23 EXPECT_EQ(base::File::FILE_ERROR_FAILED, file.error_details()); in TEST()
32 File file(file_path, base::File::FLAG_OPEN | base::File::FLAG_READ); in TEST() local
33 EXPECT_FALSE(file.IsValid()); in TEST()
34 EXPECT_EQ(base::File::FILE_ERROR_NOT_FOUND, file.error_details()); in TEST()
39 File file(file_path, base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_READ); in TEST() local
40 EXPECT_TRUE(file.IsValid()); in TEST()
41 EXPECT_TRUE(file.created()); in TEST()
42 EXPECT_EQ(base::File::FILE_OK, file.error_details()); in TEST()
47 File file(file_path, base::File::FLAG_OPEN | base::File::FLAG_READ); in TEST() local
48 EXPECT_TRUE(file.IsValid()); in TEST()
49 EXPECT_FALSE(file.created()); in TEST()
50 EXPECT_EQ(base::File::FILE_OK, file.error_details()); in TEST()
53 file.Close(); in TEST()
54 EXPECT_FALSE(file.IsValid()); in TEST()
59 File file; in TEST() local
60 file.Initialize(file_path, base::File::FLAG_OPEN | base::File::FLAG_READ); in TEST()
61 EXPECT_TRUE(file.IsValid()); in TEST()
62 EXPECT_FALSE(file.created()); in TEST()
63 EXPECT_EQ(base::File::FILE_OK, file.error_details()); in TEST()
66 file.Close(); in TEST()
67 EXPECT_FALSE(file.IsValid()); in TEST()
72 File file(file_path, base::File::FLAG_CREATE | base::File::FLAG_READ); in TEST() local
73 EXPECT_FALSE(file.IsValid()); in TEST()
74 EXPECT_FALSE(file.created()); in TEST()
75 EXPECT_EQ(base::File::FILE_ERROR_EXISTS, file.error_details()); in TEST()
80 File file(file_path, in TEST() local
82 EXPECT_TRUE(file.IsValid()); in TEST()
83 EXPECT_TRUE(file.created()); in TEST()
84 EXPECT_EQ(base::File::FILE_OK, file.error_details()); in TEST()
90 File file(file_path, in TEST() local
93 EXPECT_TRUE(file.IsValid()); in TEST()
94 EXPECT_TRUE(file.created()); in TEST()
95 EXPECT_EQ(base::File::FILE_OK, file.error_details()); in TEST()
107 File file(file_path, base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_ASYNC); in TEST() local
108 EXPECT_TRUE(file.IsValid()); in TEST()
109 EXPECT_TRUE(file.async()); in TEST()
113 File file(file_path, base::File::FLAG_OPEN_ALWAYS); in TEST() local
114 EXPECT_TRUE(file.IsValid()); in TEST()
115 EXPECT_FALSE(file.async()); in TEST()
125 File file(file_path, in TEST() local
128 EXPECT_TRUE(file.IsValid()); in TEST()
129 EXPECT_TRUE(file.created()); in TEST()
130 EXPECT_EQ(base::File::FILE_OK, file.error_details()); in TEST()
136 EXPECT_TRUE(file.IsValid()); in TEST()
141 file.Close(); in TEST()
150 File file(file_path, in TEST() local
153 ASSERT_TRUE(file.IsValid()); in TEST()
159 int bytes_written = file.Write(0, data_to_write, 0); in TEST()
163 bytes_written = file.Write(0, data_to_write, kTestDataSize); in TEST()
168 int bytes_read = file.Read(kTestDataSize, data_read_1, kTestDataSize); in TEST()
173 bytes_read = file.Read(kPartialReadOffset, data_read_1, kTestDataSize); in TEST()
179 bytes_read = file.Read(0, data_read_1, 0); in TEST()
183 bytes_read = file.Read(0, data_read_1, kTestDataSize); in TEST()
189 bytes_read = file.ReadNoBestEffort(0, data_read_1, kTestDataSize); in TEST()
197 bytes_written = file.Write(kOffsetBeyondEndOfFile, in TEST()
208 bytes_read = file.Read(0, data_read_2, static_cast<int>(file_size)); in TEST()
222 File file(file_path, base::File::FLAG_CREATE | base::File::FLAG_APPEND); in TEST() local
223 ASSERT_TRUE(file.IsValid()); in TEST()
229 int bytes_written = file.Write(0, data_to_write, 0); in TEST()
233 bytes_written = file.Write(0, data_to_write, kTestDataSize); in TEST()
236 file.Close(); in TEST()
243 file = file2.Pass(); in TEST()
245 ASSERT_TRUE(file.IsValid()); in TEST()
251 bytes_written = file.Write(0, append_data_to_write, kAppendDataSize); in TEST()
256 int bytes_read = file.Read(0, data_read_1, in TEST()
270 File file(file_path, in TEST() local
273 ASSERT_TRUE(file.IsValid()); in TEST()
274 EXPECT_EQ(0, file.GetLength()); in TEST()
279 int bytes_written = file.Write(0, data_to_write, kTestDataSize); in TEST()
285 EXPECT_TRUE(file.SetLength(kExtendedFileLength)); in TEST()
286 EXPECT_EQ(kExtendedFileLength, file.GetLength()); in TEST()
292 int bytes_read = file.Read(0, data_read, static_cast<int>(file_size)); in TEST()
301 EXPECT_TRUE(file.SetLength(kTruncatedFileLength)); in TEST()
302 EXPECT_EQ(kTruncatedFileLength, file.GetLength()); in TEST()
307 bytes_read = file.Read(0, data_read, kTestDataSize); in TEST()
321 File file(temp_dir.path().AppendASCII("touch_get_info_file"), local
324 ASSERT_TRUE(file.IsValid());
328 EXPECT_TRUE(file.GetInfo(&info));
344 int bytes_written = file.Write(0, data, kTestDataSize);
356 EXPECT_TRUE(file.SetTimes(new_last_accessed, new_last_modified));
359 EXPECT_TRUE(file.GetInfo(&info));
385 File file(file_path, local
388 EXPECT_TRUE(file.IsValid());
392 EXPECT_EQ(kDataSize, file.Write(0, kData, kDataSize));
394 EXPECT_EQ(0, file.Seek(base::File::FROM_BEGIN, 0));
398 EXPECT_EQ(first_chunk_size, file.ReadAtCurrentPos(buffer, first_chunk_size));
400 file.ReadAtCurrentPos(buffer + first_chunk_size,
409 File file(file_path, local
412 EXPECT_TRUE(file.IsValid());
418 EXPECT_EQ(first_chunk_size, file.WriteAtCurrentPos(kData, first_chunk_size));
420 file.WriteAtCurrentPos(kData + first_chunk_size,
424 EXPECT_EQ(kDataSize, file.Read(0, buffer, kDataSize));
432 File file(file_path, local
435 ASSERT_TRUE(file.IsValid());
438 EXPECT_EQ(kOffset, file.Seek(base::File::FROM_BEGIN, kOffset));
439 EXPECT_EQ(2 * kOffset, file.Seek(base::File::FROM_CURRENT, kOffset));
440 EXPECT_EQ(kOffset, file.Seek(base::File::FROM_CURRENT, -kOffset));
441 EXPECT_TRUE(file.SetLength(kOffset * 2));
442 EXPECT_EQ(kOffset, file.Seek(base::File::FROM_END, -kOffset));