summaryrefslogtreecommitdiffstats
path: root/chrome/browser/history/android
diff options
context:
space:
mode:
authormichaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-04 23:02:32 +0000
committermichaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-04 23:02:32 +0000
commit6315d166de217368aac830d79d0d26a6e408adef (patch)
tree69e018411ad0abb91a3f1645e89f3379d1445c0e /chrome/browser/history/android
parent5d328e4f383812f22fba1134b974908b45128f75 (diff)
downloadchromium_src-6315d166de217368aac830d79d0d26a6e408adef.zip
chromium_src-6315d166de217368aac830d79d0d26a6e408adef.tar.gz
chromium_src-6315d166de217368aac830d79d0d26a6e408adef.tar.bz2
Only clear the android_url table when it exists.
BUG= TEST=Passed the existing tests. Review URL: http://codereview.chromium.org/10209031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135476 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history/android')
-rw-r--r--chrome/browser/history/android/android_urls_database.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/history/android/android_urls_database.cc b/chrome/browser/history/android/android_urls_database.cc
index b76703a..f03cc63 100644
--- a/chrome/browser/history/android/android_urls_database.cc
+++ b/chrome/browser/history/android/android_urls_database.cc
@@ -141,7 +141,12 @@ bool AndroidURLsDatabase::UpdateAndroidURLRow(AndroidURLID id,
}
bool AndroidURLsDatabase::ClearAndroidURLRows() {
- return GetDB().Execute("DELETE FROM android_urls");
+ // The android_urls table might not exist if the Android content provider is
+ // never used, especially in the unit tests. See http://b/6385692.
+ if (GetDB().DoesTableExist("android_urls"))
+ return GetDB().Execute("DELETE FROM android_urls");
+
+ return true;
}
bool AndroidURLsDatabase::MigrateToVersion22() {