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

Side by Side Diff: content/browser/dom_storage/dom_storage_area_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 "https_www.google.com_0.localstorage", 436 "https_www.google.com_0.localstorage",
437 "https_www.google.com_0.localstorage-journal" }, 437 "https_www.google.com_0.localstorage-journal" },
438 { "http://www.google.com:8080/", 438 { "http://www.google.com:8080/",
439 "http_www.google.com_8080.localstorage", 439 "http_www.google.com_8080.localstorage",
440 "http_www.google.com_8080.localstorage-journal" }, 440 "http_www.google.com_8080.localstorage-journal" },
441 { "file:///", 441 { "file:///",
442 "file__0.localstorage", 442 "file__0.localstorage",
443 "file__0.localstorage-journal" }, 443 "file__0.localstorage-journal" },
444 }; 444 };
445 445
446 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kCases); ++i) { 446 for (size_t i = 0; i < arraysize(kCases); ++i) {
447 GURL origin = GURL(kCases[i].origin).GetOrigin(); 447 GURL origin = GURL(kCases[i].origin).GetOrigin();
448 base::FilePath file_name = 448 base::FilePath file_name =
449 base::FilePath().AppendASCII(kCases[i].file_name); 449 base::FilePath().AppendASCII(kCases[i].file_name);
450 base::FilePath journal_file_name = 450 base::FilePath journal_file_name =
451 base::FilePath().AppendASCII(kCases[i].journal_file_name); 451 base::FilePath().AppendASCII(kCases[i].journal_file_name);
452 452
453 EXPECT_EQ(file_name, 453 EXPECT_EQ(file_name,
454 DOMStorageArea::DatabaseFileNameFromOrigin(origin)); 454 DOMStorageArea::DatabaseFileNameFromOrigin(origin));
455 EXPECT_EQ(origin, 455 EXPECT_EQ(origin,
456 DOMStorageArea::OriginFromDatabaseFileName(file_name)); 456 DOMStorageArea::OriginFromDatabaseFileName(file_name));
457 EXPECT_EQ(journal_file_name, 457 EXPECT_EQ(journal_file_name,
458 DOMStorageDatabase::GetJournalFilePath(file_name)); 458 DOMStorageDatabase::GetJournalFilePath(file_name));
459 } 459 }
460 460
461 // Also test some DOMStorageDatabase::GetJournalFilePath cases here. 461 // Also test some DOMStorageDatabase::GetJournalFilePath cases here.
462 base::FilePath parent = base::FilePath().AppendASCII("a").AppendASCII("b"); 462 base::FilePath parent = base::FilePath().AppendASCII("a").AppendASCII("b");
463 EXPECT_EQ( 463 EXPECT_EQ(
464 parent.AppendASCII("file-journal"), 464 parent.AppendASCII("file-journal"),
465 DOMStorageDatabase::GetJournalFilePath(parent.AppendASCII("file"))); 465 DOMStorageDatabase::GetJournalFilePath(parent.AppendASCII("file")));
466 EXPECT_EQ( 466 EXPECT_EQ(
467 base::FilePath().AppendASCII("-journal"), 467 base::FilePath().AppendASCII("-journal"),
468 DOMStorageDatabase::GetJournalFilePath(base::FilePath())); 468 DOMStorageDatabase::GetJournalFilePath(base::FilePath()));
469 EXPECT_EQ( 469 EXPECT_EQ(
470 base::FilePath().AppendASCII(".extensiononly-journal"), 470 base::FilePath().AppendASCII(".extensiononly-journal"),
471 DOMStorageDatabase::GetJournalFilePath( 471 DOMStorageDatabase::GetJournalFilePath(
472 base::FilePath().AppendASCII(".extensiononly"))); 472 base::FilePath().AppendASCII(".extensiononly")));
473 } 473 }
474 474
475 } // namespace content 475 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/appcache/appcache_database_unittest.cc ('k') | content/browser/download/download_net_log_parameters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698