Lines Matching defs:file
3 // found in the LICENSE file.
15 #include "base/files/file.h"
36 // Convenience macro to create a file path from a string literal.
60 base::File* file) {
67 *file = base::File(
69 return file->IsValid();
112 // A virtual file system containing:
129 base::File file;
130 bool success = CreateFile(kFooContent, &file_path, &file);
132 files_[foo_txt_path] = std::move(file);
136 success = CreateFile(kBar1Content, &file_path, &file);
138 files_[bar1_txt_path] = std::move(file);
141 success = CreateFile(kBar2Content, &file_path, &file);
143 files_[bar2_txt_path] = std::move(file);
187 for (const base::FilePath& file : it->second.files) {
188 DCHECK(!file.empty());
189 files->push_back(file);
275 ASSERT_TRUE(base::PathExists(path)) << "no file " << path;
293 // It's a file, check its contents are what we zipped.
301 << "Original file '" << original_path << "' and unzipped file '"
317 // 1) Creates a test.txt file with the given last modification timestamp
341 // Adjusting the current timestamp to the resolution that the zip file
374 // Hard-coded contents of a known zip file.
377 // Hard-coded list of relative paths for a zip file created with ZipFiles.
402 // Unzip the zip file into a sub directory of test_dir_ so evil.zip
403 // won't create a persistent file outside test_dir_ in case of a
412 // The ZIP file contains a file with invalid UTF-8 in its file name.
473 // No rubbish file should be left behind.
494 // No rubbish file should be left behind.
510 // No rubbish file should be left behind.
520 // No rubbish file should be left behind.
550 EXPECT_EQ("First file", contents);
569 EXPECT_EQ("First file", contents);
588 EXPECT_EQ("First file", contents);
591 // TODO(crbug.com/1311140) Detect and rename reserved file names on Windows.
653 // file.
654 LOG(WARNING) << "Found unexpected file: " << std::quoted(path);
658 EXPECT_TRUE(ok) << "Found unexpected file: " << std::quoted(path);
667 EXPECT_TRUE(false) << "Cannot find expected file: " << std::quoted(path);
673 // Only the first file (with mixed case) is extracted.
715 // Only the first file (with mixed case) has been extracted.
855 "��server�share�file", //
866 // unexpected file.
867 LOG_IF(WARNING, !ok) << "Found unexpected file: " << std::quoted(path);
869 EXPECT_TRUE(ok) << "Found unexpected file: " << std::quoted(path);
874 EXPECT_TRUE(false) << "Cannot find expected file: " << std::quoted(path);
911 base::File file(GetDataDirectory().AppendASCII("test.zip"),
913 EXPECT_TRUE(zip::Unzip(file.GetPlatformFile(), writer, dir_creator));
938 base::File file(GetDataDirectory().AppendASCII("test.zip"),
940 EXPECT_TRUE(zip::Unzip(file.GetPlatformFile(), writer, dir_creator,
954 // Tests that a ZIP archive containing SJIS-encoded file names can be correctly
969 "This file's name contains 0x5c (backslash) as the 2nd byte of Japanese "
976 EXPECT_EQ("This file name is coded in Shift JIS in the archive.", contents);
979 // Tests that a ZIP archive containing SJIS-encoded file names can be extracted
980 // even if the encoding is not specified. In this case, file names are
1000 "This file's name contains 0x5c (backslash) as the 2nd byte of Japanese "
1007 EXPECT_EQ("This file name is coded in Shift JIS in the archive.", contents);
1060 // the year (2107-1980=127). To test that limit, the input file needs to be
1061 // touched, but the code that modifies the file access and modification times
1097 // sizes from 0 to 7 bytes respectively, but the metadata in the zip file says
1305 // Since the source files compress well, the destination ZIP file should be
1322 // Create a dummy ZIP file. This is not a valid ZIP file, but for the purpose
1332 // Zip the dummy ZIP file.
1336 // Since the dummy source (inner) ZIP file should simply be stored in the
1337 // destination (outer) ZIP file, the destination file should be bigger than
1338 // the source file, but not much bigger.
1348 // are correctly enumerated (crbug.com/1298347), and that the big file can be
1375 // Create a big dummy ZIP file. This is not a valid ZIP file, but for the
1380 LOG(INFO) << "Creating big file " << src_file;
1386 // Zip the dummy ZIP file.
1388 LOG(INFO) << "Zipping big file into " << dest_file;
1400 // Since the dummy source (inner) ZIP file should simply be stored in the
1401 // destination (outer) ZIP file, the destination file should be bigger than
1402 // the source file, but not much bigger.