Lines Matching defs:db
29 ".db";
45 WebDatabase db;
47 ASSERT_EQ(sql::INIT_OK, db.Init(file_));
52 EXPECT_TRUE(db.GetLoginsTable()->GetAllLogins(&result, true));
70 EXPECT_TRUE(db.GetLoginsTable()->AddLogin(form));
71 EXPECT_TRUE(db.GetLoginsTable()->GetAllLogins(&result, true));
77 EXPECT_TRUE(db.GetLoginsTable()->GetLogins(form, &result));
88 EXPECT_TRUE(db.GetLoginsTable()->GetLogins(form2, &result));
98 EXPECT_TRUE(db.GetLoginsTable()->GetLogins(form3, &result));
109 EXPECT_TRUE(db.GetLoginsTable()->GetLogins(form4, &result));
113 EXPECT_TRUE(db.GetLoginsTable()->AddLogin(form4));
114 EXPECT_TRUE(db.GetLoginsTable()->GetAllLogins(&result, true));
121 EXPECT_TRUE(db.GetLoginsTable()->GetLogins(form4, &result));
127 EXPECT_TRUE(db.GetLoginsTable()->RemoveLogin(form));
128 EXPECT_TRUE(db.GetLoginsTable()->GetAllLogins(&result, true));
134 EXPECT_TRUE(db.GetLoginsTable()->GetLogins(form, &result));
143 EXPECT_TRUE(db.GetLoginsTable()->GetLogins(form5, &result));
155 EXPECT_TRUE(db.GetLoginsTable()->UpdateLogin(form6));
157 EXPECT_TRUE(db.GetLoginsTable()->GetLogins(form5, &result));
162 EXPECT_TRUE(db.GetLoginsTable()->GetAllLogins(&result, true));
172 EXPECT_TRUE(db.GetLoginsTable()->RemoveLogin(form4));
173 EXPECT_TRUE(db.GetLoginsTable()->GetAllLogins(&result, true));
177 static bool AddTimestampedLogin(WebDatabase* db, std::string url,
189 return db->GetLoginsTable()->AddLogin(form);
200 WebDatabase db;
202 ASSERT_EQ(sql::INIT_OK, db.Init(file_));
207 EXPECT_TRUE(db.GetLoginsTable()->GetAllLogins(&result, true));
214 EXPECT_TRUE(AddTimestampedLogin(&db, "1", "foo1", Time()));
216 EXPECT_TRUE(AddTimestampedLogin(&db, "2", "foo2", now - one_day));
217 EXPECT_TRUE(AddTimestampedLogin(&db, "3", "foo3", now));
218 EXPECT_TRUE(AddTimestampedLogin(&db, "4", "foo4", now + one_day));
221 EXPECT_TRUE(db.GetLoginsTable()->GetAllLogins(&result, true));
226 db.GetLoginsTable()->RemoveLoginsCreatedBetween(now, Time());
229 EXPECT_TRUE(db.GetLoginsTable()->GetAllLogins(&result, true));
234 db.GetLoginsTable()->RemoveLoginsCreatedBetween(Time(), Time());
237 EXPECT_TRUE(db.GetLoginsTable()->GetAllLogins(&result, true));
242 WebDatabase db;
244 ASSERT_EQ(sql::INIT_OK, db.Init(file_));
248 EXPECT_TRUE(db.GetLoginsTable()->GetAllLogins(&result, true));
263 EXPECT_TRUE(db.GetLoginsTable()->AddLogin(form));
266 EXPECT_TRUE(db.GetLoginsTable()->GetAllLogins(&result, false));
270 EXPECT_TRUE(db.GetLoginsTable()->GetLogins(form, &result));
275 EXPECT_TRUE(db.GetLoginsTable()->GetAllLogins(&result, true));