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

Unified Diff: webkit/browser/database/database_util_unittest.cc

Issue 199153003: Look closer at the components of vfsfilenames that are used filenames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: webkit/browser/database/database_util_unittest.cc
diff --git a/webkit/browser/database/database_util_unittest.cc b/webkit/browser/database/database_util_unittest.cc
index 6d3c08d9ba57fca57df854dc91fe78bde67753fc..2c7bc15b208bdb01f502572e81789735aaf58bd4 100644
--- a/webkit/browser/database/database_util_unittest.cc
+++ b/webkit/browser/database/database_util_unittest.cc
@@ -44,14 +44,17 @@ namespace webkit_database {
// Test DatabaseUtil::CrackVfsFilePath on various inputs.
TEST(DatabaseUtilTest, CrackVfsFilePathTest) {
- TestVfsFilePath(true, "origin/#", "origin", "", "");
- TestVfsFilePath(true, "origin/#suffix", "origin", "", "suffix");
- TestVfsFilePath(true, "origin/db_name#", "origin", "db_name", "");
- TestVfsFilePath(true, "origin/db_name#suffix", "origin", "db_name", "suffix");
- TestVfsFilePath(false, "origindb_name#");
- TestVfsFilePath(false, "origindb_name#suffix");
- TestVfsFilePath(false, "origin/db_name");
- TestVfsFilePath(false, "origin#db_name/suffix");
+ TestVfsFilePath(true, "http_origin_0/#", "http_origin_0", "", "");
+ TestVfsFilePath(true,
+ "http_origin_0/#suffix", "http_origin_0", "", "suffix");
+ TestVfsFilePath(true,
+ "http_origin_0/db_name#", "http_origin_0", "db_name", "");
+ TestVfsFilePath(true,
+ "http_origin_0/db_name#suffix", "http_origin_0", "db_name", "suffix");
+ TestVfsFilePath(false, "http_origin_0db_name#");
+ TestVfsFilePath(false, "http_origin_0db_name#suffix");
+ TestVfsFilePath(false, "http_origin_0/db_name");
+ TestVfsFilePath(false, "http_origin_0#db_name/suffix");
TestVfsFilePath(false, "/db_name#");
TestVfsFilePath(false, "/db_name#suffix");
}
@@ -65,10 +68,11 @@ TEST(DatabaseUtilTest, OriginIdentifiers) {
TEST(DatabaseUtilTest, IsValidOriginIdentifier) {
TestValidOriginIdentifier(true, "http_bar_0");
- TestValidOriginIdentifier(true, "");
+ TestValidOriginIdentifier(false, "");
TestValidOriginIdentifier(false, "bad..id");
TestValidOriginIdentifier(false, "bad/id");
TestValidOriginIdentifier(false, "bad\\id");
+ TestValidOriginIdentifier(false, "http_bad:0_2");
TestValidOriginIdentifier(false, std::string("bad\0id", 6));
}

Powered by Google App Engine
This is Rietveld 408576698