class SandboxFileSystemBackendTest : public testing::Test {
protected:
- virtual void SetUp() {
+ void SetUp() override {
ASSERT_TRUE(data_dir_.CreateUniqueTempDir());
SetUpNewDelegate(CreateAllowFileAccessOptions());
}
"http://www.foo.com:8080/",
"http://www.foo.com:80/",
};
- size_t temporary_size = ARRAYSIZE_UNSAFE(temporary_origins);
- size_t persistent_size = ARRAYSIZE_UNSAFE(persistent_origins);
+ size_t temporary_size = arraysize(temporary_origins);
+ size_t persistent_size = arraysize(persistent_origins);
std::set<GURL> temporary_set, persistent_set;
for (size_t i = 0; i < temporary_size; ++i) {
CreateOriginTypeDirectory(GURL(temporary_origins[i]),
}
TEST_F(SandboxFileSystemBackendTest, GetRootPathCreateAndExamine) {
- std::vector<base::FilePath> returned_root_path(
- ARRAYSIZE_UNSAFE(kRootPathTestCases));
+ std::vector<base::FilePath> returned_root_path(arraysize(kRootPathTestCases));
SetUpNewBackend(CreateAllowFileAccessOptions());
// Create a new root directory.
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kRootPathTestCases); ++i) {
+ for (size_t i = 0; i < arraysize(kRootPathTestCases); ++i) {
SCOPED_TRACE(testing::Message() << "RootPath (create) #" << i << " "
<< kRootPathTestCases[i].expected_path);
// Get the root directory with create=false and see if we get the
// same directory.
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kRootPathTestCases); ++i) {
+ for (size_t i = 0; i < arraysize(kRootPathTestCases); ++i) {
SCOPED_TRACE(testing::Message() << "RootPath (get) #" << i << " "
<< kRootPathTestCases[i].expected_path);
TEST_F(SandboxFileSystemBackendTest,
GetRootPathCreateAndExamineWithNewBackend) {
- std::vector<base::FilePath> returned_root_path(
- ARRAYSIZE_UNSAFE(kRootPathTestCases));
+ std::vector<base::FilePath> returned_root_path(arraysize(kRootPathTestCases));
SetUpNewBackend(CreateAllowFileAccessOptions());
GURL origin_url("http://foo.com:1/");
SetUpNewBackend(CreateDisallowFileAccessOptions());
// Try to get a root directory without creating.
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kRootPathTestCases); ++i) {
+ for (size_t i = 0; i < arraysize(kRootPathTestCases); ++i) {
SCOPED_TRACE(testing::Message() << "RootPath (create=false) #" << i << " "
<< kRootPathTestCases[i].expected_path);
EXPECT_FALSE(GetRootPath(GURL(kRootPathTestCases[i].origin_url),
SetUpNewBackend(CreateIncognitoFileSystemOptions());
// Try to get a root directory.
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kRootPathTestCases); ++i) {
+ for (size_t i = 0; i < arraysize(kRootPathTestCases); ++i) {
SCOPED_TRACE(testing::Message() << "RootPath (incognito) #" << i << " "
<< kRootPathTestCases[i].expected_path);
EXPECT_FALSE(GetRootPath(GURL(kRootPathTestCases[i].origin_url),
TEST_F(SandboxFileSystemBackendTest, GetRootPathFileURI) {
SetUpNewBackend(CreateDisallowFileAccessOptions());
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kRootPathFileURITestCases); ++i) {
+ for (size_t i = 0; i < arraysize(kRootPathFileURITestCases); ++i) {
SCOPED_TRACE(testing::Message() << "RootPathFileURI (disallow) #"
<< i << " " << kRootPathFileURITestCases[i].expected_path);
EXPECT_FALSE(GetRootPath(GURL(kRootPathFileURITestCases[i].origin_url),
TEST_F(SandboxFileSystemBackendTest, GetRootPathFileURIWithAllowFlag) {
SetUpNewBackend(CreateAllowFileAccessOptions());
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kRootPathFileURITestCases); ++i) {
+ for (size_t i = 0; i < arraysize(kRootPathFileURITestCases); ++i) {
SCOPED_TRACE(testing::Message() << "RootPathFileURI (allow) #"
<< i << " " << kRootPathFileURITestCases[i].expected_path);
base::FilePath root_path;