summaryrefslogtreecommitdiffstats
path: root/webkit/database/database_tracker_unittest.cc
diff options
context:
space:
mode:
authordumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-13 01:30:45 +0000
committerdumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-13 01:30:45 +0000
commit3c5ed2c5747de75351c18fbf1e969eccc263d1d5 (patch)
tree75ba30df50a1f0bd4ecd90d51051b3bb057c2a51 /webkit/database/database_tracker_unittest.cc
parentdad1e3bc1d2894be09c2a5bcb98708044aa1664d (diff)
downloadchromium_src-3c5ed2c5747de75351c18fbf1e969eccc263d1d5.zip
chromium_src-3c5ed2c5747de75351c18fbf1e969eccc263d1d5.tar.gz
chromium_src-3c5ed2c5747de75351c18fbf1e969eccc263d1d5.tar.bz2
Changing the file naming scheme. Creating a directory for each origin,
and naming files according to the row ID of the respective DB in the tracker database. Also, fixing a bug: caching the renderer process handle in DatabaseDispatcherHost after it was set in ResourceMessageFilter. TEST=none BUG=none Review URL: http://codereview.chromium.org/385051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31874 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/database/database_tracker_unittest.cc')
-rw-r--r--webkit/database/database_tracker_unittest.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/webkit/database/database_tracker_unittest.cc b/webkit/database/database_tracker_unittest.cc
index 7fadeff..0d0b635 100644
--- a/webkit/database/database_tracker_unittest.cc
+++ b/webkit/database/database_tracker_unittest.cc
@@ -82,12 +82,13 @@ TEST(DatabaseTrackerTest, TestIt) {
// Open three new databases.
int64 database_size = 0;
int64 space_available = 0;
- const string16 kOrigin1 = ASCIIToUTF16("kOrigin1");
- const string16 kOrigin2 = ASCIIToUTF16("kOrigin2");
- const string16 kDB1 = ASCIIToUTF16("kDB1");
- const string16 kDB2 = ASCIIToUTF16("kDB2");
- const string16 kDB3 = ASCIIToUTF16("kDB3");
- const string16 kDescription = ASCIIToUTF16("database_kDescription");
+ const string16 kOrigin1 = ASCIIToUTF16("origin1");
+ const string16 kOrigin2 = ASCIIToUTF16("origin2");
+ const string16 kDB1 = ASCIIToUTF16("db1");
+ const string16 kDB2 = ASCIIToUTF16("db2");
+ const string16 kDB3 = ASCIIToUTF16("db3");
+ const string16 kDescription = ASCIIToUTF16("database_description");
+
tracker->DatabaseOpened(kOrigin1, kDB1, kDescription, 0,
&database_size, &space_available);
EXPECT_EQ(0, database_size);
@@ -109,6 +110,10 @@ TEST(DatabaseTrackerTest, TestIt) {
// Write some data to each file and check that the listeners are
// called with the appropriate values.
+ EXPECT_TRUE(file_util::CreateDirectory(tracker->DatabaseDirectory().Append(
+ FilePath::FromWStringHack(UTF16ToWide(kOrigin1)))));
+ EXPECT_TRUE(file_util::CreateDirectory(tracker->DatabaseDirectory().Append(
+ FilePath::FromWStringHack(UTF16ToWide(kOrigin2)))));
EXPECT_EQ(1, file_util::WriteFile(
tracker->GetFullDBFilePath(kOrigin1, kDB1), "a", 1));
EXPECT_EQ(2, file_util::WriteFile(