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

Unified Diff: chrome/browser/webdata/autofill_table_unittest.cc

Issue 8966003: Update webdata files to take advantage of DLOG(FATAL) in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add header comments for a couple tricky error cases. Created 9 years 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
« no previous file with comments | « chrome/browser/webdata/autofill_table.cc ('k') | chrome/browser/webdata/keyword_table.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/webdata/autofill_table_unittest.cc
diff --git a/chrome/browser/webdata/autofill_table_unittest.cc b/chrome/browser/webdata/autofill_table_unittest.cc
index 0dccfb75d243c5f4378d665cf588b0516147b947..52d457a963299245adca517ace4a0662939d3279 100644
--- a/chrome/browser/webdata/autofill_table_unittest.cc
+++ b/chrome/browser/webdata/autofill_table_unittest.cc
@@ -573,7 +573,7 @@ TEST_F(AutofillTableTest, AutofillProfile) {
"SELECT date_modified "
"FROM autofill_profiles WHERE guid=?"));
s_home.BindString(0, home_profile.guid());
- ASSERT_TRUE(s_home);
+ ASSERT_TRUE(s_home.is_valid());
ASSERT_TRUE(s_home.Step());
EXPECT_GE(s_home.ColumnInt64(0), pre_creation_time.ToTimeT());
EXPECT_LE(s_home.ColumnInt64(0), post_creation_time.ToTimeT());
@@ -598,7 +598,7 @@ TEST_F(AutofillTableTest, AutofillProfile) {
sql::Statement s_billing(db.GetSQLConnection()->GetUniqueStatement(
"SELECT date_modified FROM autofill_profiles WHERE guid=?"));
s_billing.BindString(0, billing_profile.guid());
- ASSERT_TRUE(s_billing);
+ ASSERT_TRUE(s_billing.is_valid());
ASSERT_TRUE(s_billing.Step());
EXPECT_GE(s_billing.ColumnInt64(0), pre_creation_time.ToTimeT());
EXPECT_LE(s_billing.ColumnInt64(0), post_creation_time.ToTimeT());
@@ -617,7 +617,7 @@ TEST_F(AutofillTableTest, AutofillProfile) {
sql::Statement s_billing_updated(db.GetSQLConnection()->GetUniqueStatement(
"SELECT date_modified FROM autofill_profiles WHERE guid=?"));
s_billing_updated.BindString(0, billing_profile.guid());
- ASSERT_TRUE(s_billing_updated);
+ ASSERT_TRUE(s_billing_updated.is_valid());
ASSERT_TRUE(s_billing_updated.Step());
EXPECT_GE(s_billing_updated.ColumnInt64(0),
pre_modification_time.ToTimeT());
@@ -649,7 +649,7 @@ TEST_F(AutofillTableTest, AutofillProfile) {
sql::Statement s_billing_updated_2(db.GetSQLConnection()->GetUniqueStatement(
"SELECT date_modified FROM autofill_profiles WHERE guid=?"));
s_billing_updated_2.BindString(0, billing_profile.guid());
- ASSERT_TRUE(s_billing_updated_2);
+ ASSERT_TRUE(s_billing_updated_2.is_valid());
ASSERT_TRUE(s_billing_updated_2.Step());
EXPECT_GE(s_billing_updated_2.ColumnInt64(0),
pre_modification_time_2.ToTimeT());
@@ -950,7 +950,7 @@ TEST_F(AutofillTableTest, CreditCard) {
"card_number_encrypted, date_modified "
"FROM credit_cards WHERE guid=?"));
s_work.BindString(0, work_creditcard.guid());
- ASSERT_TRUE(s_work);
+ ASSERT_TRUE(s_work.is_valid());
ASSERT_TRUE(s_work.Step());
EXPECT_GE(s_work.ColumnInt64(5), pre_creation_time.ToTimeT());
EXPECT_LE(s_work.ColumnInt64(5), post_creation_time.ToTimeT());
@@ -976,7 +976,7 @@ TEST_F(AutofillTableTest, CreditCard) {
"card_number_encrypted, date_modified "
"FROM credit_cards WHERE guid=?"));
s_target.BindString(0, target_creditcard.guid());
- ASSERT_TRUE(s_target);
+ ASSERT_TRUE(s_target.is_valid());
ASSERT_TRUE(s_target.Step());
EXPECT_GE(s_target.ColumnInt64(5), pre_creation_time.ToTimeT());
EXPECT_LE(s_target.ColumnInt64(5), post_creation_time.ToTimeT());
@@ -996,7 +996,7 @@ TEST_F(AutofillTableTest, CreditCard) {
"card_number_encrypted, date_modified "
"FROM credit_cards WHERE guid=?"));
s_target_updated.BindString(0, target_creditcard.guid());
- ASSERT_TRUE(s_target_updated);
+ ASSERT_TRUE(s_target_updated.is_valid());
ASSERT_TRUE(s_target_updated.Step());
EXPECT_GE(s_target_updated.ColumnInt64(5), pre_modification_time.ToTimeT());
EXPECT_LE(s_target_updated.ColumnInt64(5), post_modification_time.ToTimeT());
@@ -1034,7 +1034,7 @@ TEST_F(AutofillTableTest, UpdateAutofillProfile) {
const time_t mock_creation_date = Time::Now().ToTimeT() - 13;
sql::Statement s_mock_creation_date(db.GetSQLConnection()->GetUniqueStatement(
"UPDATE autofill_profiles SET date_modified = ?"));
- ASSERT_TRUE(s_mock_creation_date);
+ ASSERT_TRUE(s_mock_creation_date.is_valid());
s_mock_creation_date.BindInt64(0, mock_creation_date);
ASSERT_TRUE(s_mock_creation_date.Run());
@@ -1046,7 +1046,7 @@ TEST_F(AutofillTableTest, UpdateAutofillProfile) {
EXPECT_EQ(profile, *db_profile);
sql::Statement s_original(db.GetSQLConnection()->GetUniqueStatement(
"SELECT date_modified FROM autofill_profiles"));
- ASSERT_TRUE(s_original);
+ ASSERT_TRUE(s_original.is_valid());
ASSERT_TRUE(s_original.Step());
EXPECT_EQ(mock_creation_date, s_original.ColumnInt64(0));
EXPECT_FALSE(s_original.Step());
@@ -1063,7 +1063,7 @@ TEST_F(AutofillTableTest, UpdateAutofillProfile) {
EXPECT_EQ(profile, *db_profile);
sql::Statement s_updated(db.GetSQLConnection()->GetUniqueStatement(
"SELECT date_modified FROM autofill_profiles"));
- ASSERT_TRUE(s_updated);
+ ASSERT_TRUE(s_updated.is_valid());
ASSERT_TRUE(s_updated.Step());
EXPECT_LT(mock_creation_date, s_updated.ColumnInt64(0));
EXPECT_FALSE(s_updated.Step());
@@ -1073,7 +1073,7 @@ TEST_F(AutofillTableTest, UpdateAutofillProfile) {
sql::Statement s_mock_modification_date(
db.GetSQLConnection()->GetUniqueStatement(
"UPDATE autofill_profiles SET date_modified = ?"));
- ASSERT_TRUE(s_mock_modification_date);
+ ASSERT_TRUE(s_mock_modification_date.is_valid());
s_mock_modification_date.BindInt64(0, mock_modification_date);
ASSERT_TRUE(s_mock_modification_date.Run());
@@ -1088,7 +1088,7 @@ TEST_F(AutofillTableTest, UpdateAutofillProfile) {
EXPECT_EQ(profile, *db_profile);
sql::Statement s_unchanged(db.GetSQLConnection()->GetUniqueStatement(
"SELECT date_modified FROM autofill_profiles"));
- ASSERT_TRUE(s_unchanged);
+ ASSERT_TRUE(s_unchanged.is_valid());
ASSERT_TRUE(s_unchanged.Step());
EXPECT_EQ(mock_modification_date, s_unchanged.ColumnInt64(0));
EXPECT_FALSE(s_unchanged.Step());
@@ -1110,7 +1110,7 @@ TEST_F(AutofillTableTest, UpdateCreditCard) {
const time_t mock_creation_date = Time::Now().ToTimeT() - 13;
sql::Statement s_mock_creation_date(db.GetSQLConnection()->GetUniqueStatement(
"UPDATE credit_cards SET date_modified = ?"));
- ASSERT_TRUE(s_mock_creation_date);
+ ASSERT_TRUE(s_mock_creation_date.is_valid());
s_mock_creation_date.BindInt64(0, mock_creation_date);
ASSERT_TRUE(s_mock_creation_date.Run());
@@ -1122,7 +1122,7 @@ TEST_F(AutofillTableTest, UpdateCreditCard) {
EXPECT_EQ(credit_card, *db_credit_card);
sql::Statement s_original(db.GetSQLConnection()->GetUniqueStatement(
"SELECT date_modified FROM credit_cards"));
- ASSERT_TRUE(s_original);
+ ASSERT_TRUE(s_original.is_valid());
ASSERT_TRUE(s_original.Step());
EXPECT_EQ(mock_creation_date, s_original.ColumnInt64(0));
EXPECT_FALSE(s_original.Step());
@@ -1139,7 +1139,7 @@ TEST_F(AutofillTableTest, UpdateCreditCard) {
EXPECT_EQ(credit_card, *db_credit_card);
sql::Statement s_updated(db.GetSQLConnection()->GetUniqueStatement(
"SELECT date_modified FROM credit_cards"));
- ASSERT_TRUE(s_updated);
+ ASSERT_TRUE(s_updated.is_valid());
ASSERT_TRUE(s_updated.Step());
EXPECT_LT(mock_creation_date, s_updated.ColumnInt64(0));
EXPECT_FALSE(s_updated.Step());
@@ -1149,7 +1149,7 @@ TEST_F(AutofillTableTest, UpdateCreditCard) {
sql::Statement s_mock_modification_date(
db.GetSQLConnection()->GetUniqueStatement(
"UPDATE credit_cards SET date_modified = ?"));
- ASSERT_TRUE(s_mock_modification_date);
+ ASSERT_TRUE(s_mock_modification_date.is_valid());
s_mock_modification_date.BindInt64(0, mock_modification_date);
ASSERT_TRUE(s_mock_modification_date.Run());
@@ -1164,7 +1164,7 @@ TEST_F(AutofillTableTest, UpdateCreditCard) {
EXPECT_EQ(credit_card, *db_credit_card);
sql::Statement s_unchanged(db.GetSQLConnection()->GetUniqueStatement(
"SELECT date_modified FROM credit_cards"));
- ASSERT_TRUE(s_unchanged);
+ ASSERT_TRUE(s_unchanged.is_valid());
ASSERT_TRUE(s_unchanged.Step());
EXPECT_EQ(mock_modification_date, s_unchanged.ColumnInt64(0));
EXPECT_FALSE(s_unchanged.Step());
@@ -1213,7 +1213,7 @@ TEST_F(AutofillTableTest, RemoveAutofillProfilesAndCreditCardsModifiedBetween) {
sql::Statement s_autofill_profiles_bounded(
db.GetSQLConnection()->GetUniqueStatement(
"SELECT date_modified FROM autofill_profiles"));
- ASSERT_TRUE(s_autofill_profiles_bounded);
+ ASSERT_TRUE(s_autofill_profiles_bounded.is_valid());
ASSERT_TRUE(s_autofill_profiles_bounded.Step());
EXPECT_EQ(11, s_autofill_profiles_bounded.ColumnInt64(0));
ASSERT_TRUE(s_autofill_profiles_bounded.Step());
@@ -1230,7 +1230,7 @@ TEST_F(AutofillTableTest, RemoveAutofillProfilesAndCreditCardsModifiedBetween) {
sql::Statement s_credit_cards_bounded(
db.GetSQLConnection()->GetUniqueStatement(
"SELECT date_modified FROM credit_cards"));
- ASSERT_TRUE(s_credit_cards_bounded);
+ ASSERT_TRUE(s_credit_cards_bounded.is_valid());
ASSERT_TRUE(s_credit_cards_bounded.Step());
EXPECT_EQ(47, s_credit_cards_bounded.ColumnInt64(0));
ASSERT_TRUE(s_credit_cards_bounded.Step());
@@ -1249,7 +1249,7 @@ TEST_F(AutofillTableTest, RemoveAutofillProfilesAndCreditCardsModifiedBetween) {
sql::Statement s_autofill_profiles_unbounded(
db.GetSQLConnection()->GetUniqueStatement(
"SELECT date_modified FROM autofill_profiles"));
- ASSERT_TRUE(s_autofill_profiles_unbounded);
+ ASSERT_TRUE(s_autofill_profiles_unbounded.is_valid());
ASSERT_TRUE(s_autofill_profiles_unbounded.Step());
EXPECT_EQ(11, s_autofill_profiles_unbounded.ColumnInt64(0));
ASSERT_TRUE(s_autofill_profiles_unbounded.Step());
@@ -1261,7 +1261,7 @@ TEST_F(AutofillTableTest, RemoveAutofillProfilesAndCreditCardsModifiedBetween) {
sql::Statement s_credit_cards_unbounded(
db.GetSQLConnection()->GetUniqueStatement(
"SELECT date_modified FROM credit_cards"));
- ASSERT_TRUE(s_credit_cards_unbounded);
+ ASSERT_TRUE(s_credit_cards_unbounded.is_valid());
ASSERT_TRUE(s_credit_cards_unbounded.Step());
EXPECT_EQ(47, s_credit_cards_unbounded.ColumnInt64(0));
EXPECT_FALSE(s_credit_cards_unbounded.Step());
@@ -1276,14 +1276,14 @@ TEST_F(AutofillTableTest, RemoveAutofillProfilesAndCreditCardsModifiedBetween) {
sql::Statement s_autofill_profiles_empty(
db.GetSQLConnection()->GetUniqueStatement(
"SELECT date_modified FROM autofill_profiles"));
- ASSERT_TRUE(s_autofill_profiles_empty);
+ ASSERT_TRUE(s_autofill_profiles_empty.is_valid());
EXPECT_FALSE(s_autofill_profiles_empty.Step());
ASSERT_EQ(1UL, credit_card_guids.size());
EXPECT_EQ("00000000-0000-0000-0000-000000000009", credit_card_guids[0]);
sql::Statement s_credit_cards_empty(
db.GetSQLConnection()->GetUniqueStatement(
"SELECT date_modified FROM credit_cards"));
- ASSERT_TRUE(s_credit_cards_empty);
+ ASSERT_TRUE(s_credit_cards_empty.is_valid());
EXPECT_FALSE(s_credit_cards_empty.Step());
}
« no previous file with comments | « chrome/browser/webdata/autofill_table.cc ('k') | chrome/browser/webdata/keyword_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698