summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authormberkowitz@google.com <mberkowitz@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-02 04:41:48 +0000
committermberkowitz@google.com <mberkowitz@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-02 04:41:48 +0000
commit2576814c1e3983d33c77123c4cc9fc60d3c2ae69 (patch)
treeb5545f54e1a139fb9fcbd8fae31ab986c4e2275c /chrome
parentd2c513cedd908259fa3a9c9d0aac79d4edffae99 (diff)
downloadchromium_src-2576814c1e3983d33c77123c4cc9fc60d3c2ae69.zip
chromium_src-2576814c1e3983d33c77123c4cc9fc60d3c2ae69.tar.gz
chromium_src-2576814c1e3983d33c77123c4cc9fc60d3c2ae69.tar.bz2
Pyauto test to clear Autofill profiles
testClearAutofillData: Verify that clearing autofill form data works. Includes personal profile and credit card info. TEST=none BUG=none Review URL: http://codereview.chromium.org/7793013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99320 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/test/functional/browsing_data.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/chrome/test/functional/browsing_data.py b/chrome/test/functional/browsing_data.py
index 19410f0..1e0a805 100644
--- a/chrome/test/functional/browsing_data.py
+++ b/chrome/test/functional/browsing_data.py
@@ -109,6 +109,38 @@ class BrowsingDataTest(pyauto.PyUITest):
self.assertFalse(history)
self.assertEqual(1, len(downloads))
+ def testClearAutofillData(self):
+ """Verify that clearing autofill form data works."""
+
+ # Add new profiles
+ profiles = [{'NAME_FIRST': ['Bill',],
+ 'NAME_LAST': ['Ding',],
+ 'ADDRESS_HOME_CITY': ['Mountain View',],
+ 'ADDRESS_HOME_STATE': ['CA',],
+ 'ADDRESS_HOME_ZIP': ['94043',],}]
+ credit_cards = [{'CREDIT_CARD_NAME': 'Bill Ding',
+ 'CREDIT_CARD_NUMBER': '4111111111111111',
+ 'CREDIT_CARD_EXP_MONTH': '01',
+ 'CREDIT_CARD_EXP_4_DIGIT_YEAR': '2012'}]
+
+ self.FillAutofillProfile(profiles=profiles, credit_cards=credit_cards)
+
+ # Verify that the added profiles exist.
+ profile = self.GetAutofillProfile()
+ self.assertEqual(profiles, profile['profiles'])
+ self.assertEqual(credit_cards, profile['credit_cards'])
+
+ # Clear the browser's autofill form data.
+ self.ClearBrowsingData(['FORM_DATA'], 'EVERYTHING')
+
+ def _ProfileCount(type):
+ profile = self.GetAutofillProfile()
+ return len(profile[type])
+
+ # Verify that all profiles have been cleared.
+ self.assertTrue(self.WaitUntil(lambda: 0 == _ProfileCount('profiles')))
+ self.assertTrue(self.WaitUntil(lambda: 0 == _ProfileCount('credit_cards')))
+
if __name__ == '__main__':
pyauto_functional.Main()