diff options
author | sdefresne <sdefresne@chromium.org> | 2014-09-24 19:05:24 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-25 02:05:49 +0000 |
commit | 32977338f1cd4b588d4244e49860f35bdda7c3a6 (patch) | |
tree | 02f85d7ef01740ab67e24651291c154bca0ba80d /components | |
parent | 7a6ab65086f1a3b63dc51f02f42708ed30b8e596 (diff) | |
download | chromium_src-32977338f1cd4b588d4244e49860f35bdda7c3a6.zip chromium_src-32977338f1cd4b588d4244e49860f35bdda7c3a6.tar.gz chromium_src-32977338f1cd4b588d4244e49860f35bdda7c3a6.tar.bz2 |
Order returning profiles and card by descending date_modified
The unittests (WebDataServiceAutofillTest.CreditUpdate) assume that the
newly modified credit card information will be the first one returned.
Since it has the highest date_modified value, this imply a descending
ordering of the cards when iterating.
The unittests were previously flaky as the precision of date_modified
is not high enough and both card ended up with the same value most of
the time. When the test was taking slightly more time to run, then the
modified car would end up last and the test would fail.
BUG=None
Review URL: https://codereview.chromium.org/600873002
Cr-Commit-Position: refs/heads/master@{#296623}
Diffstat (limited to 'components')
-rw-r--r-- | components/autofill/core/browser/webdata/autofill_table.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/autofill/core/browser/webdata/autofill_table.cc b/components/autofill/core/browser/webdata/autofill_table.cc index b5a3a4e..08b5b61 100644 --- a/components/autofill/core/browser/webdata/autofill_table.cc +++ b/components/autofill/core/browser/webdata/autofill_table.cc @@ -930,7 +930,7 @@ bool AutofillTable::GetAutofillProfiles( sql::Statement s(db_->GetUniqueStatement( "SELECT guid " "FROM autofill_profiles " - "ORDER BY date_modified, guid")); + "ORDER BY date_modified DESC, guid")); while (s.Step()) { std::string guid = s.ColumnString(0); @@ -1069,7 +1069,7 @@ bool AutofillTable::GetCreditCards( sql::Statement s(db_->GetUniqueStatement( "SELECT guid " "FROM credit_cards " - "ORDER BY date_modified, guid")); + "ORDER BY date_modified DESC, guid")); while (s.Step()) { std::string guid = s.ColumnString(0); |