// This macro helps avoid wrapped lines in the test structs.
// correctly, we need functions to create and delete reparse points.
// the call succeeds, false otherwise.
// The juction will not work if the target path does not start with \??\ .
// Manages a reparse point for a test.
// Creates a reparse point from |source| (an empty directory) to |target|.
FILE_FLAG_BACKUP_SEMANTICS, // Needed to open a directory.
// Provide a simple way to change the permissions bits on |path| in tests.
// calls to this function in ASSERT_NO_FATAL_FAILURE().
// interface to query whether a given file is present.
// The file should not be returned twice.
// Returns true if the enumerator found the file.
// Simple function to dump some text into a new file.
// Simple function to take out some text from a file.
// should return 53 bytes.
// we know it is not a link.
// must be the parent of the path holding file b.
// NormalizeFilePath() fails without crashing.
target_length -= (sub_a.value().length() + 1); // +1 for the sepperator '\'.
// Without making the path a bit shorter, CreateDirectory() fails.
// Normalize a junction free path: base_a\sub_a\file.txt .
// normalized to exclude junctions to_base_b and to_sub_a .
// do not cause a crash.
// path to deep.txt is longer than MAX_PATH.
// Get a drive letter.
// Get the NT style path to that drive.
// QueryDosDevice(). Expect the drive letter we started with.
// Check that DevicePathToDriveLetterPath fails.
// - the filesystem at |temp_dir_| supports long filenames.
// network file systems. E.g. AFS).
// Use the short form of the directory to create a temporary filename.
// Check that the long path can't be determined for |temp_file|.
// Link to a directory.
// The following test of NormalizeFilePath() require that we create a symlink.
// privileges required to create a symlink.
// Link one file to another.
// Check that NormalizeFilePath sees the link.
// Test that a loop in the links causes NormalizeFilePath() to return false.
// Create a symlink to the file.
// Delete the symbolic link.
// Make sure original file is not deleted.
// Create a non-existent file path.
// Create a symlink to the non-existent file.
// Make sure the symbolic link is exist.
// Make sure the symbolic link is deleted.
// Create a file path.
// Make sure the file is readable.
// Get rid of the read permission.
// Make sure the file can't be read.
// Give the read permission.
// Make sure the file can be read.
// Make sure the file is writable.
// Get rid of the write permission.
// Make sure the file can't be write.
// Make sure the file can be write.
// Create a directory path.
// Create a dummy file to enumerate.
// Make sure the directory has the all permissions.
// Get rid of the permissions from the directory.
// Make sure the file in the directory can't be enumerated.
// Give the permissions to the directory.
// Make sure the file in the directory can be enumerated.
// with the recursion flag. Also coincidentally tests PathExists.
// Tests non-recursive Delete() for a directory.
// Create a subdirectory and put a file and two directories inside.
// Tests recursive Delete() for a directory.
// Check everything has been moved.
// Create the destination directory.
// Create a file under the directory.
// Create a file under the subdirectory.
// Copy the directory recursively.
// Check everything has been copied.
// Copy the directory not recursively.
// Create from path with trailing separators.
// Sets the source file to read-only.
// On Windows, it involves setting a bit.
// assumption change, fix this unit test accordingly.
// FILE_ATTRIBUTE_NOT_CONTENT_INDEXED doesn't exist on XP.
// On all other platforms, it involves removing the write bit.
// Copy the file to another location using '..' in the path.
// Set the source file to read-only.
// to be a PlatformTest.
// We don't need equivalent functionality outside of Windows.
// Save the original $TMP.
// original_tmp may be NULL.
// Restore the original $TMP.
// Create; make sure they are open and exist.
// Make sure all names are unique.
#if !defined(OS_ANDROID) // Not implemented on Android.
// calling some OS functions which would just duplicate the implementation.
// So here we just test that it returns something "reasonable".
// CreateDirectory returns true if the DirectoryExists returns true.
// 1. The current directory always exists.
// 2. The root directory always exists.
// test that "creating" these directories succeeds.
// Test an empty directory.
// Test an empty directory, non-recursively, including "..".
// Only enumerate directories non-recursively.
// Only enumerate directories, non-recursively, including "..".
// Enumerate files and directories.
// Enumerate with a pattern.
// Make dir1 point to dir2.
// the file system so skip this test for XP.
// Enumerate the reparse point.
// No changes for non recursive operation.
// Should not enumerate inside dir1 when using recursion.
// query to allow TearDown to delete the directory.
// (we don't care what).
// Create a fresh, empty copy of this directory.
// Create a test file to be read.
// Make buffers with various size.
// Read the file with smaller buffer.
// Read the file with buffer which have exactly same size.
// Read the file with larger buffer.
// Make sure the return value is -1 if the file doesn't exist.
// to make it work on FAT too.
// modification times with 2s resolution.
// using a user id we control.
// with a common SetUp() method.
// Create a basic structure used by each test.
// Get the user and group files are created with from |base_dir_|.
ASSERT_EQ(uid_, getuid()); // This process should be the owner.
// set permissions on the directories we create.
// Make all files and directories non-world-writable.
// File does not exist.
// |base| not a subpath of |path|.
// An empty base path will fail to be a prefix for any path.
// Finding that a bad call fails proves nothing unless a good call succeeds.
// Symlinks in the path should cause failure.
// Symlink to the file at the end of the path.
// Symlink from one directory to another within the path.
// Symlinks in parents of base path are allowed.
// Get a uid that is not the uid of files we create.
// We control these paths.
// Another user does not control these paths.
// Another group does not control the paths.
// Make all files and directories writable only by their owner.
// Any group is okay because the path is not group-writable.
// if no group can write.
std::set<gid_t> no_gids; // Empty set of gids.
// Make all files and directories writable by their group.
// Now |ok_gids_| works, but |bad_gids_| fails.
// the union of good and bad gids passes.
// Initialy, we control all parts of the path.
// Make sub_dir_ world writable.
// Make text_file_ world writable.
// Make sub_dir_ non-world writable.
// Get the test image path.
// return the content URI.
// We should be able to read the file.
// Size should be smaller than 0.
// We should not be able to read the file.
// This is the only thread. This file descriptor should no longer be valid.
// Make sure read(2) won't block.
// Reading the pipe should EOF.
// Trying to close it should crash. This is important for security.