Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Side by Side Diff: content/browser/fileapi/isolated_context_unittest.cc

Issue 654403002: Convert ARRAYSIZE_UNSAFE -> arraysize in content/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "storage/browser/fileapi/file_system_url.h" 9 #include "storage/browser/fileapi/file_system_url.h"
10 #include "storage/browser/fileapi/isolated_context.h" 10 #include "storage/browser/fileapi/isolated_context.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 #if defined(FILE_PATH_USES_WIN_SEPARATORS) 188 #if defined(FILE_PATH_USES_WIN_SEPARATORS)
189 # define SHOULD_FAIL_WITH_WIN_SEPARATORS false 189 # define SHOULD_FAIL_WITH_WIN_SEPARATORS false
190 #else 190 #else
191 # define SHOULD_FAIL_WITH_WIN_SEPARATORS true 191 # define SHOULD_FAIL_WITH_WIN_SEPARATORS true
192 #endif 192 #endif
193 { FPL("foo\\..\\baz"), SHOULD_FAIL_WITH_WIN_SEPARATORS }, 193 { FPL("foo\\..\\baz"), SHOULD_FAIL_WITH_WIN_SEPARATORS },
194 { FPL("foo/..\\baz"), SHOULD_FAIL_WITH_WIN_SEPARATORS }, 194 { FPL("foo/..\\baz"), SHOULD_FAIL_WITH_WIN_SEPARATORS },
195 }; 195 };
196 196
197 for (size_t i = 0; i < arraysize(kTestPaths); ++i) { 197 for (size_t i = 0; i < arraysize(kTestPaths); ++i) {
198 for (size_t j = 0; j < ARRAYSIZE_UNSAFE(relatives); ++j) { 198 for (size_t j = 0; j < arraysize(relatives); ++j) {
199 SCOPED_TRACE(testing::Message() << "Testing " 199 SCOPED_TRACE(testing::Message() << "Testing "
200 << kTestPaths[i].value() << " " << relatives[j].path); 200 << kTestPaths[i].value() << " " << relatives[j].path);
201 base::FilePath virtual_path = 201 base::FilePath virtual_path =
202 isolated_context()->CreateVirtualRootPath(id_).AppendASCII( 202 isolated_context()->CreateVirtualRootPath(id_).AppendASCII(
203 names_[i]).Append(relatives[j].path); 203 names_[i]).Append(relatives[j].path);
204 std::string cracked_id; 204 std::string cracked_id;
205 base::FilePath cracked_path; 205 base::FilePath cracked_path;
206 storage::FileSystemType cracked_type; 206 storage::FileSystemType cracked_type;
207 std::string cracked_inner_id; 207 std::string cracked_inner_id;
208 FileSystemMountOption cracked_option; 208 FileSystemMountOption cracked_option;
(...skipping 29 matching lines...) Expand all
238 #if defined(FILE_PATH_USES_WIN_SEPARATORS) 238 #if defined(FILE_PATH_USES_WIN_SEPARATORS)
239 # define SHOULD_FAIL_WITH_WIN_SEPARATORS false 239 # define SHOULD_FAIL_WITH_WIN_SEPARATORS false
240 #else 240 #else
241 # define SHOULD_FAIL_WITH_WIN_SEPARATORS true 241 # define SHOULD_FAIL_WITH_WIN_SEPARATORS true
242 #endif 242 #endif
243 { FPL("foo\\..\\baz"), SHOULD_FAIL_WITH_WIN_SEPARATORS }, 243 { FPL("foo\\..\\baz"), SHOULD_FAIL_WITH_WIN_SEPARATORS },
244 { FPL("foo/..\\baz"), SHOULD_FAIL_WITH_WIN_SEPARATORS }, 244 { FPL("foo/..\\baz"), SHOULD_FAIL_WITH_WIN_SEPARATORS },
245 }; 245 };
246 246
247 for (size_t i = 0; i < arraysize(kTestPaths); ++i) { 247 for (size_t i = 0; i < arraysize(kTestPaths); ++i) {
248 for (size_t j = 0; j < ARRAYSIZE_UNSAFE(relatives); ++j) { 248 for (size_t j = 0; j < arraysize(relatives); ++j) {
249 SCOPED_TRACE(testing::Message() << "Testing " 249 SCOPED_TRACE(testing::Message() << "Testing "
250 << kTestPaths[i].value() << " " << relatives[j].path); 250 << kTestPaths[i].value() << " " << relatives[j].path);
251 base::FilePath virtual_path = 251 base::FilePath virtual_path =
252 isolated_context()->CreateVirtualRootPath(id_).AppendASCII( 252 isolated_context()->CreateVirtualRootPath(id_).AppendASCII(
253 names_[i]).Append(relatives[j].path); 253 names_[i]).Append(relatives[j].path);
254 254
255 FileSystemURL cracked = isolated_context()->CreateCrackedFileSystemURL( 255 FileSystemURL cracked = isolated_context()->CreateCrackedFileSystemURL(
256 GURL("http://chromium.org"), kFileSystemTypeIsolated, virtual_path); 256 GURL("http://chromium.org"), kFileSystemTypeIsolated, virtual_path);
257 257
258 ASSERT_EQ(relatives[j].valid, cracked.is_valid()); 258 ASSERT_EQ(relatives[j].valid, cracked.is_valid());
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 FileSystemMountOption cracked_option; 352 FileSystemMountOption cracked_option;
353 ASSERT_TRUE(isolated_context()->CrackVirtualPath( 353 ASSERT_TRUE(isolated_context()->CrackVirtualPath(
354 whole_virtual_path, &cracked_id, NULL, &cracked_inner_id, 354 whole_virtual_path, &cracked_id, NULL, &cracked_inner_id,
355 &cracked_path, &cracked_option)); 355 &cracked_path, &cracked_option));
356 ASSERT_EQ(database_fsid, cracked_id); 356 ASSERT_EQ(database_fsid, cracked_id);
357 ASSERT_EQ(test_virtual_path, cracked_path); 357 ASSERT_EQ(test_virtual_path, cracked_path);
358 EXPECT_TRUE(cracked_inner_id.empty()); 358 EXPECT_TRUE(cracked_inner_id.empty());
359 } 359 }
360 360
361 } // namespace content 361 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/fileapi/file_writer_delegate_unittest.cc ('k') | content/browser/fileapi/obfuscated_file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698