diff options
author | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-11 11:32:43 +0000 |
---|---|---|
committer | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-11 11:32:43 +0000 |
commit | 883fb988aa9864e79dba8d2a2ca4fdb460aa5efe (patch) | |
tree | e6de02084c2c268382534a8f4d94c890cd135b44 /content/browser/database_util_unittest.cc | |
parent | 519f500af69665604d57500ac7055edd87932d3f (diff) | |
download | chromium_src-883fb988aa9864e79dba8d2a2ca4fdb460aa5efe.zip chromium_src-883fb988aa9864e79dba8d2a2ca4fdb460aa5efe.tar.gz chromium_src-883fb988aa9864e79dba8d2a2ca4fdb460aa5efe.tar.bz2 |
Look closer at the components of vfsfilenames that are used filenames.
BUG=352447
TBR=sky
Review URL: https://codereview.chromium.org/199153003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276348 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/database_util_unittest.cc')
-rw-r--r-- | content/browser/database_util_unittest.cc | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/content/browser/database_util_unittest.cc b/content/browser/database_util_unittest.cc index 4b11a18..23f0a47 100644 --- a/content/browser/database_util_unittest.cc +++ b/content/browser/database_util_unittest.cc @@ -44,14 +44,17 @@ namespace content { // 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)); } |