Lines Matching refs:db

52 int RowCount(TextDatabase* db) {
60 db->GetTextMatches("COUNTTAG", options, &results, &unique_urls,
66 void AddAllTestData(TextDatabase* db) {
67 EXPECT_TRUE(db->AddPageData(
69 EXPECT_TRUE(db->AddPageData(
71 EXPECT_TRUE(db->AddPageData(
73 EXPECT_EQ(3, RowCount(db));
108 TextDatabase* db = new TextDatabase(temp_dir_.path(), id, allow_create);
111 file_util::Delete(db->file_name(), false);
113 if (!db->Init()) {
114 delete db;
117 return db;
158 scoped_ptr<TextDatabase> db(CreateDB(kIdee1, true, true));
159 ASSERT_TRUE(!!db.get());
160 URLID id1 = db->AddPageData(
163 URLID id2 = db->AddPageData(
166 URLID id3 = db->AddPageData(
169 EXPECT_EQ(3, RowCount(db.get()));
172 db->DeletePageData(Time::FromInternalValue(kTime1), kURL1);
173 EXPECT_EQ(2, RowCount(db.get()));
176 db.reset(new TextDatabase(temp_dir_.path(), kIdee1, false));
177 EXPECT_TRUE(db->Init());
180 EXPECT_EQ(2, RowCount(db.get()));
181 db->DeletePageData(Time::FromInternalValue(kTime2), kURL2);
182 EXPECT_EQ(1, RowCount(db.get()));
188 scoped_ptr<TextDatabase> db(CreateDB(kIdee1, true, true));
189 EXPECT_TRUE(!!db.get());
190 AddAllTestData(db.get());
199 db->GetTextMatches("COUNTTAG", options, &results, &unique_urls,
237 scoped_ptr<TextDatabase> db(CreateDB(kIdee1, true, true));
238 ASSERT_TRUE(!!db.get());
239 AddAllTestData(db.get());
250 db->GetTextMatches("COUNTTAG", options, &results, &unique_urls,
268 db->GetTextMatches("COUNTTAG", options, &results, &unique_urls,
284 db->GetTextMatches("COUNTTAG", options, &results, &unique_urls,
294 scoped_ptr<TextDatabase> db(CreateDB(kIdee1, true, true));
295 ASSERT_TRUE(!!db.get());
296 AddAllTestData(db.get());
308 db->GetTextMatches("google", options, &results, &unique_urls,