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

Unified Diff: chrome/test/functional/autofill.py

Issue 6246147: Test Autofill's ability to merge duplicate profiles and... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months 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
Index: chrome/test/functional/autofill.py
===================================================================
--- chrome/test/functional/autofill.py (revision 74040)
+++ chrome/test/functional/autofill.py (working copy)
@@ -5,6 +5,7 @@
import os
+import pickle
Nirnimesh 2011/02/07 23:26:20 group with os above. pickle is a system import
dyu1 2011/02/09 19:44:56 Done.
import pyauto_functional # Must be imported before pyauto
import pyauto
@@ -93,9 +94,9 @@
self.assertEqual([expected_credit_card],
self.GetAutoFillProfile()['credit_cards'])
- def testAutofillCrowdSourcing(self):
- """Test able to send POST request of web form to crowd source server.
- Require a loop of 1000 submits as the source server only collects 1% of
+ def testAutofillCrowdsourcing(self):
+ """Test able to send POST request of web form to Autofill server.
+ Require a loop of 1000 submits as the Autofill server only collects 1% of
the data posted."""
# HTML file needs to be run from a specific http:// url to be able to verify
# the results a few days later by visiting the same url.
@@ -124,6 +125,33 @@
'window.domAutomationController.send("done")',
0, 0)
+ def testMergeDuplicateProfilesInAutofill(self):
+ """Test Autofill ability to merge duplicate profiles and throw away junk
+ profiles. The goal is to submit a couple hundred profiles and see the merge
+ outcome."""
+ # HTML file needs to be run from a http:// url.
+ url = self.GetHttpURLForDataPath(
+ os.path.join('autofill', 'dup-profiles-test.html'))
+ # Add and set Autofill profiles.
+ file_path = os.path.join(self.DataDir(), 'autofill',
+ 'dataset_duplicate-profiles.txt')
Nirnimesh 2011/02/07 23:26:20 Why use this precooked file? Why not call the csv
dyu1 2011/02/09 19:44:56 Done.
+ profiles = self.EvalDataFrom(file_path)
+ self.FillAutoFillProfile(profiles=profiles)
+ for i in range(len(self.GetAutoFillProfile()['profiles'])):
+ self.NavigateToURL(url)
+ for key, value in self.GetAutoFillProfile()['profiles'][i].iteritems():
+ script = 'document.getElementById("%s").value = "%s"; ' \
+ 'window.domAutomationController.send("done")' % (key, value)
+ self.ExecuteJavascript(script, 0, 0)
+ self.ExecuteJavascript('document.getElementById("merge_dup").submit();'
+ 'window.domAutomationController.send("done")',
+ 0, 0)
+ # Write profile dictionary to a file.
+ profile_dict = self.GetAutoFillProfile()['profiles']
+ output = open('merged-profile.txt', 'wb')
+ pickle.dump(profile_dict, output)
+ output.close()
+
if __name__ == '__main__':
pyauto_functional.Main()

Powered by Google App Engine
This is Rietveld 408576698