#include <cstring>#include <memory>#include <vector>#include "flutter/fml/build_config.h"#include "flutter/fml/file.h"#include "flutter/fml/mapping.h"#include "flutter/fml/paths.h"#include "flutter/fml/unique_fd.h"#include "gtest/gtest.h"Go to the source code of this file.
Functions | |
| static bool | WriteStringToFile (const fml::UniqueFD &fd, const std::string &contents) |
| static std::string | ReadStringFromFile (const fml::UniqueFD &fd) |
| TEST (FileTest, CreateTemporaryAndUnlink) | |
| TEST (FileTest, ScopedTempDirIsValid) | |
| TEST (FileTest, CanOpenFileForWriting) | |
| TEST (FileTest, CanTruncateAndWrite) | |
| TEST (FileTest, CreateDirectoryStructure) | |
| TEST (FileTest, VisitFilesCanBeCalledTwice) | |
| TEST (FileTest, CanListFilesRecursively) | |
| TEST (FileTest, CanStopVisitEarly) | |
| TEST (FileTest, AtomicWriteTest) | |
| TEST (FileTest, IgnoreBaseDirWhenPathIsAbsolute) | |
| TEST (FileTest, EmptyMappingTest) | |
| TEST (FileTest, MappingDontNeedSafeTest) | |
| TEST (FileTest, FileTestsWork) | |
| TEST (FileTest, FileTestsSupportsUnicode) | |
|
static |
Definition at line 35 of file file_unittest.cc.
References fml::FileMapping::GetMapping(), and fml::FileMapping::GetSize().
| TEST | ( | FileTest | , |
| AtomicWriteTest | |||
| ) |
Definition at line 236 of file file_unittest.cc.
References data, fml::ScopedTemporaryDirectory::fd(), fml::kRead, fml::OpenFile(), ReadStringFromFile(), fml::UnlinkFile(), and fml::WriteAtomically().
| TEST | ( | FileTest | , |
| CanListFilesRecursively | |||
| ) |
Definition at line 168 of file file_unittest.cc.
References fml::CreateDirectory(), d, fml::ScopedTemporaryDirectory::fd(), fml::kReadWrite, fml::OpenFile(), fml::UnlinkDirectory(), fml::UnlinkFile(), and fml::VisitFilesRecursively().
| TEST | ( | FileTest | , |
| CanOpenFileForWriting | |||
| ) |
Definition at line 61 of file file_unittest.cc.
References fml::ScopedTemporaryDirectory::fd(), fml::UniqueObject< T, Traits >::is_valid(), fml::kWrite, fml::OpenFile(), and fml::UnlinkFile().
| TEST | ( | FileTest | , |
| CanStopVisitEarly | |||
| ) |
Definition at line 209 of file file_unittest.cc.
References fml::CreateDirectory(), d, fml::ScopedTemporaryDirectory::fd(), fml::kReadWrite, fml::UnlinkDirectory(), and fml::VisitFilesRecursively().
| TEST | ( | FileTest | , |
| CanTruncateAndWrite | |||
| ) |
Definition at line 72 of file file_unittest.cc.
References fml::ScopedTemporaryDirectory::fd(), fml::FileMapping::GetMapping(), fml::FileMapping::GetSize(), i, fml::UniqueObject< T, Traits >::is_valid(), fml::kRead, fml::kReadWrite, fml::FileMapping::kWrite, fml::OpenFile(), fml::TruncateFile(), and fml::UnlinkFile().
| TEST | ( | FileTest | , |
| CreateDirectoryStructure | |||
| ) |
Definition at line 112 of file file_unittest.cc.
References fml::CreateDirectory(), fml::ScopedTemporaryDirectory::fd(), fml::kRead, fml::kReadWrite, fml::OpenFile(), ReadStringFromFile(), fml::UnlinkDirectory(), fml::UnlinkFile(), and WriteStringToFile().
| TEST | ( | FileTest | , |
| CreateTemporaryAndUnlink | |||
| ) |
Definition at line 46 of file file_unittest.cc.
References fml::CreateTemporaryDirectory(), fml::kRead, fml::OpenDirectory(), and fml::UnlinkDirectory().
| TEST | ( | FileTest | , |
| EmptyMappingTest | |||
| ) |
Definition at line 283 of file file_unittest.cc.
References fml::ScopedTemporaryDirectory::fd(), fml::FileMapping::GetMapping(), fml::FileMapping::GetSize(), fml::FileMapping::IsValid(), fml::kReadWrite, fml::OpenFile(), and fml::UnlinkFile().
| TEST | ( | FileTest | , |
| FileTestsSupportsUnicode | |||
| ) |
Definition at line 343 of file file_unittest.cc.
References fml::ScopedTemporaryDirectory::fd(), fml::FileExists(), fml::UniqueObject< T, Traits >::is_valid(), fml::IsFile(), fml::paths::JoinPaths(), fml::kWrite, fml::OpenFile(), fml::ScopedTemporaryDirectory::path(), and fml::UnlinkFile().
| TEST | ( | FileTest | , |
| FileTestsWork | |||
| ) |
Definition at line 329 of file file_unittest.cc.
References fml::ScopedTemporaryDirectory::fd(), fml::FileExists(), fml::UniqueObject< T, Traits >::is_valid(), fml::IsFile(), fml::paths::JoinPaths(), fml::kWrite, fml::OpenFile(), fml::ScopedTemporaryDirectory::path(), and fml::UnlinkFile().
| TEST | ( | FileTest | , |
| IgnoreBaseDirWhenPathIsAbsolute | |||
| ) |
Definition at line 256 of file file_unittest.cc.
References fml::paths::AbsolutePath(), data, fml::ScopedTemporaryDirectory::fd(), fml::FileExists(), fml::paths::JoinPaths(), fml::kRead, fml::OpenFile(), fml::ScopedTemporaryDirectory::path(), ReadStringFromFile(), fml::UnlinkFile(), and fml::WriteAtomically().
| TEST | ( | FileTest | , |
| MappingDontNeedSafeTest | |||
| ) |
Definition at line 299 of file file_unittest.cc.
References fml::ScopedTemporaryDirectory::fd(), fml::FileMapping::GetMutableMapping(), fml::FileMapping::IsDontNeedSafe(), fml::FileMapping::IsValid(), fml::kRead, fml::FileMapping::kRead, fml::kReadWrite, fml::FileMapping::kWrite, fml::OpenFile(), fml::UnlinkFile(), and WriteStringToFile().
| TEST | ( | FileTest | , |
| ScopedTempDirIsValid | |||
| ) |
Definition at line 56 of file file_unittest.cc.
References fml::ScopedTemporaryDirectory::fd(), and fml::UniqueObject< T, Traits >::is_valid().
| TEST | ( | FileTest | , |
| VisitFilesCanBeCalledTwice | |||
| ) |
Definition at line 141 of file file_unittest.cc.
References fml::ScopedTemporaryDirectory::fd(), fml::kReadWrite, fml::OpenFile(), fml::UnlinkFile(), and fml::VisitFiles().
|
static |
Definition at line 16 of file file_unittest.cc.
References fml::FileMapping::kWrite, and fml::TruncateFile().