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

Issue 10855253: Convert the autofill pyauto tests to browser tests, and remove all the supporting automation hooks … (Closed)

Created:
8 years, 4 months ago by jam
Modified:
8 years, 4 months ago
CC:
chromium-reviews, kkania, Nirnimesh, dhollowa+watch_chromium.org, browser-components-watch_chromium.org, anantha, robertshield, dyu1, dennis_jeffrey, Ilya Sherman, Raghu Simha
Visibility:
Public.

Description

Convert the autofill pyauto tests to browser tests, and remove all the supporting automation hooks that are no longer necessary. Tests I left: -AutofillCrowdsourcing: this is a manual, non-automated test against the autofill server. I've been told it's not used, but I left it anyways. It was composed of two parts: testing chrome autofill works and sending the resulting form to the server. The former is tested in many tests already, so I took that out. -autofill edit address dialog tests: these are using webdriver. Also remove the autofill tests in sync.py since they used the same automation hooks. testAutofillProfileSync is redundant because many of the tests in two_client_autofill_sync_test.cc do this. For testNoCreditCardSync, I added a test case in two_client_autofill_sync_test.cc. BUG=143637 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=152560

Patch Set 1 #

Total comments: 4

Patch Set 2 : clang #

Patch Set 3 : remove sync autofill tests #

Patch Set 4 : sync and restore blank lines at end so patches apply #

Patch Set 5 : fix checkdeps after sync #

Total comments: 69

Patch Set 6 : review comments #

Patch Set 7 : review comments #

Total comments: 1

Patch Set 8 : review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+802 lines, -3074 lines) Patch
M chrome/browser/autofill/autofill_browsertest.cc View 1 2 3 4 5 6 7 5 chunks +745 lines, -17 lines 0 comments Download
M chrome/browser/autofill/personal_data_manager.h View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/automation/automation_provider_observers.h View 1 2 3 1 chunk +0 lines, -106 lines 0 comments Download
M chrome/browser/automation/automation_provider_observers.cc View 1 2 3 1 chunk +0 lines, -174 lines 0 comments Download
M chrome/browser/automation/testing_automation_provider.h View 1 2 3 3 chunks +0 lines, -68 lines 0 comments Download
M chrome/browser/automation/testing_automation_provider.cc View 1 2 3 4 chunks +0 lines, -445 lines 0 comments Download
M chrome/browser/sync/test/integration/autofill_helper.h View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/sync/test/integration/autofill_helper.cc View 1 2 3 1 chunk +11 lines, -0 lines 0 comments Download
M chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc View 1 2 3 4 chunks +25 lines, -0 lines 0 comments Download
A + chrome/test/data/autofill/autofill_confirmemail_form.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/test/data/autofill/autofill_creditcard_form.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/test/data/autofill/autofill_middleinit_form.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/test/data/autofill/autofill_test_form.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/test/data/autofill/cc_autocomplete_off_test.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/test/data/autofill/dataset.txt View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
A + chrome/test/data/autofill/dataset_2.txt View 1 2 3 1 chunk +6 lines, -8 lines 0 comments Download
A + chrome/test/data/autofill/dataset_no_address.txt View 1 2 3 1 chunk +6 lines, -6 lines 0 comments Download
A + chrome/test/data/autofill/duplicate_profiles_test.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/test/data/autofill/form_phones.html View 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/test/data/autofill/functional/autofill_confirmemail_form.html View 1 2 3 1 chunk +0 lines, -21 lines 0 comments Download
D chrome/test/data/autofill/functional/autofill_creditcard_form.html View 1 2 3 1 chunk +0 lines, -42 lines 0 comments Download
D chrome/test/data/autofill/functional/autofill_middleinit_form.html View 1 2 3 1 chunk +0 lines, -23 lines 0 comments Download
D chrome/test/data/autofill/functional/autofill_test_form.html View 1 2 3 1 chunk +0 lines, -25 lines 0 comments Download
D chrome/test/data/autofill/functional/cc_autocomplete_off_test.html View 1 2 3 1 chunk +0 lines, -44 lines 0 comments Download
D chrome/test/data/autofill/functional/crazy_autofill.txt View 1 2 3 1 chunk +0 lines, -22 lines 0 comments Download
D chrome/test/data/autofill/functional/crazy_creditcards.txt View 1 2 3 1 chunk +0 lines, -23 lines 0 comments Download
D chrome/test/data/autofill/functional/crowdsource_autofill.txt View 1 2 3 1 chunk +0 lines, -6 lines 0 comments Download
D chrome/test/data/autofill/functional/dataset.txt View 1 2 3 1 chunk +0 lines, -250 lines 0 comments Download
D chrome/test/data/autofill/functional/dataset_2.txt View 1 2 3 1 chunk +0 lines, -21 lines 0 comments Download
D chrome/test/data/autofill/functional/dataset_no_address.txt View 1 2 3 1 chunk +0 lines, -6 lines 0 comments Download
D chrome/test/data/autofill/functional/duplicate_profiles_test.html View 1 2 3 1 chunk +0 lines, -42 lines 0 comments Download
D chrome/test/data/autofill/functional/form_phones.html View 1 2 3 1 chunk +0 lines, -55 lines 0 comments Download
D chrome/test/data/autofill/functional/latency_after_submit_test.html View 1 2 3 1 chunk +0 lines, -38 lines 0 comments Download
D chrome/test/data/autofill/functional/phone_pexpected_autofill.txt View 1 2 3 1 chunk +0 lines, -15 lines 0 comments Download
D chrome/test/data/autofill/functional/phone_pinput_autofill.txt View 1 2 3 1 chunk +0 lines, -11 lines 0 comments Download
D chrome/test/data/autofill/functional/phonechecker.txt View 1 2 3 1 chunk +0 lines, -37 lines 0 comments Download
D chrome/test/data/autofill/functional/read_only_field_test.html View 1 2 3 1 chunk +0 lines, -31 lines 0 comments Download
A + chrome/test/data/autofill/latency_after_submit_test.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/test/data/autofill/read_only_field_test.html View 0 chunks +-1 lines, --1 lines 0 comments Download
M chrome/test/functional/PYAUTO_TESTS View 1 2 3 3 chunks +0 lines, -8 lines 0 comments Download
M chrome/test/functional/autofill.py View 1 2 3 3 chunks +6 lines, -682 lines 0 comments Download
D chrome/test/functional/autofill_dataset_converter.py View 1 2 3 1 chunk +0 lines, -227 lines 0 comments Download
D chrome/test/functional/autofill_dataset_generator.py View 1 2 3 1 chunk +0 lines, -307 lines 0 comments Download
M chrome/test/functional/sync.py View 1 2 3 1 chunk +0 lines, -67 lines 0 comments Download
M chrome/test/pyautolib/pyauto.py View 1 2 3 2 chunks +0 lines, -252 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
jam
8 years, 4 months ago (2012-08-20 21:12:57 UTC) #1
dyu1
http://codereview.chromium.org/10855253/diff/1/chrome/test/functional/autofill.py File chrome/test/functional/autofill.py (left): http://codereview.chromium.org/10855253/diff/1/chrome/test/functional/autofill.py#oldcode581 chrome/test/functional/autofill.py:581: def FormFillLatencyAfterSubmit(self): Is this partial test being covered by ...
8 years, 4 months ago (2012-08-20 21:23:26 UTC) #2
jam
http://codereview.chromium.org/10855253/diff/1/chrome/test/functional/autofill.py File chrome/test/functional/autofill.py (left): http://codereview.chromium.org/10855253/diff/1/chrome/test/functional/autofill.py#oldcode581 chrome/test/functional/autofill.py:581: def FormFillLatencyAfterSubmit(self): On 2012/08/20 21:23:26, dyu1 wrote: > Is ...
8 years, 4 months ago (2012-08-20 21:26:37 UTC) #3
jam
Tim: please take a look at the sync parts (patchset 2->3).
8 years, 4 months ago (2012-08-20 23:30:23 UTC) #4
jam
btw re the test failures: AutofillTest.ComparePhoneNumbers I've fixed (will upload trivial fix soon, as I'm ...
8 years, 4 months ago (2012-08-20 23:50:23 UTC) #5
tim (not reviewing)
sync changes LGTM, +FYI rsimha
8 years, 4 months ago (2012-08-21 00:05:08 UTC) #6
Ilya Sherman
Thanks again for migrating these tests :) It looks like some of the tests are ...
8 years, 4 months ago (2012-08-21 03:04:28 UTC) #7
jam
https://chromiumcodereview.appspot.com/10855253/diff/1045/chrome/browser/autofill/autofill_browsertest.cc File chrome/browser/autofill/autofill_browsertest.cc (right): https://chromiumcodereview.appspot.com/10855253/diff/1045/chrome/browser/autofill/autofill_browsertest.cc#newcode97 chrome/browser/autofill/autofill_browsertest.cc:97: content::NotificationService::AllSources()); On 2012/08/21 03:04:28, Ilya Sherman wrote: > This ...
8 years, 4 months ago (2012-08-21 06:20:06 UTC) #8
jam
On 2012/08/21 03:04:28, Ilya Sherman wrote: > Thanks again for migrating these tests :) > ...
8 years, 4 months ago (2012-08-21 06:33:00 UTC) #9
Ilya Sherman
LGTM On 2012/08/21 06:33:00, John Abd-El-Malek wrote: > On 2012/08/21 03:04:28, Ilya Sherman wrote: > ...
8 years, 4 months ago (2012-08-21 07:24:16 UTC) #10
jam
8 years, 4 months ago (2012-08-21 14:49:10 UTC) #11
https://chromiumcodereview.appspot.com/10855253/diff/1045/chrome/browser/auto...
File chrome/browser/autofill/autofill_browsertest.cc (right):

https://chromiumcodereview.appspot.com/10855253/diff/1045/chrome/browser/auto...
chrome/browser/autofill/autofill_browsertest.cc:898: }
On 2012/08/21 07:24:17, Ilya Sherman wrote:
> On 2012/08/21 06:20:06, John Abd-El-Malek wrote:
> > On 2012/08/21 03:04:28, Ilya Sherman wrote:
> > > I think this test is redundant with tests in
> > > chrome/browser/autofill/personal_data_manager_unittest.cc
> > 
> > I have ported all the tests and tried to do a straight translation so it
would
> > be less contentious (i.e. I did not go through the history of every test to
> see
> > if it was written as a regression test, or for other reasons). I don't know
> > enough about autofill to know if it's redundant with other unittests, or if
> > there's value in testing this in a browser test as opposed to a unit test.
> > 
> > if you feel strongly that we should remove this test, I'm ok with that.
> 
> This test is redundant with the unit test
> PersonalDataManagerTest.AddProfilesAndCreditCards, and hence should be
removed.

Done.

https://chromiumcodereview.appspot.com/10855253/diff/1045/chrome/browser/auto...
chrome/browser/autofill/autofill_browsertest.cc:915: }
On 2012/08/21 03:04:28, Ilya Sherman wrote:
> Ditto.

Done.

https://chromiumcodereview.appspot.com/10855253/diff/1045/chrome/browser/auto...
chrome/browser/autofill/autofill_browsertest.cc:1014: }
On 2012/08/21 07:24:17, Ilya Sherman wrote:
> On 2012/08/21 06:20:06, John Abd-El-Malek wrote:
> > On 2012/08/21 03:04:28, Ilya Sherman wrote:
> > > If this test is not redundant with existing PersonalDataManagerTest.*
tests,
> > it
> > > should probably be moved into that test suite.
> > 
> > I don't know all the tests there. if you find one that this is redundant
with,
> > let me know and I can delete it.
> > 
> > >  It doesn't look like this needs
> > > to be a browser test.
> > 
> > Again, I don't know if there's value in testing this through an actual
browser
> > or not. Since I don't know which tests are redundant, or unnecessary as a
> > browser test, I had opted for a straight translation.
> 
> This test does not need to be a browser_test; it can be a regular unit test. 
If
> you don't want to move it over as part of this CL, please add a
TODO(isherman):
> to move this over to be a unit test under PersonalDataManagerTest.

Done.

https://chromiumcodereview.appspot.com/10855253/diff/1045/chrome/browser/auto...
chrome/browser/autofill/autofill_browsertest.cc:1036: }
On 2012/08/21 07:24:17, Ilya Sherman wrote:
> On 2012/08/21 06:20:06, John Abd-El-Malek wrote:
> > On 2012/08/21 03:04:28, Ilya Sherman wrote:
> > > I think this test is redundant with tests in
> > > chrome/browser/autofill/personal_data_manager_unittest.cc
> > 
> > ditto
> 
> This test is meant to be a test of the WebUI at chrome://settings/autofill. 
> Admittedly, that is not actually what the PyAuto code was doing.  If you don't
> want to convert this over to being a WebUI test right now, please file a bug
for
> converting it.

Done.

https://chromiumcodereview.appspot.com/10855253/diff/1045/chrome/browser/auto...
chrome/browser/autofill/autofill_browsertest.cc:1038: // Test invalid credit
card numbers typed in prefs should be saved as-is.
On 2012/08/21 07:24:17, Ilya Sherman wrote:
> On 2012/08/21 06:20:06, John Abd-El-Malek wrote:
> > On 2012/08/21 03:04:28, Ilya Sherman wrote:
> > > This test is meant to be testing the settings page at
> > > chrome://chrome/settings/autofill.  In fact, maybe all of the above tests
> that
> > I
> > > mentioned are probably already unit tested are actually supposed to be
> testing
> > > the webui settings.  Right now, the test is skipping all the WebUI
> JavaScript
> > > and handlers, which rather defeats the point.
> > 
> > I think there is webui js harness already that is meant to test settings
page,
> > so it seems tests can use that.
> > 
> > Again, I was aiming for a straight translation. If you think this is
redundant
> > with other existing tests, then I'm happy to remove it.
> 
> Ditto with the above: This test is meant to be a test of the WebUI at
> chrome://settings/autofill.  Admittedly, that is not actually what the PyAuto
> code was doing.  If you don't want to convert this over to being a WebUI test
> right now, please file a bug for converting it.

Done.

https://chromiumcodereview.appspot.com/10855253/diff/1045/chrome/browser/auto...
chrome/browser/autofill/autofill_browsertest.cc:1312: ASSERT_NE(email,
readonly_field_value);
On 2012/08/21 07:24:17, Ilya Sherman wrote:
> On 2012/08/21 06:20:06, John Abd-El-Malek wrote:
> > On 2012/08/21 03:04:28, Ilya Sherman wrote:
> > > nit: ExpectFieldValue(), and compare to the field's original value?  (We
> > > shouldn't partially overwrite or clear a read-only field.)
> > 
> > this is ASSERT_NE
> 
> Please add a TODO(isherman): to fix this to be an ASSERT_EQ if you don't want
to
> change this right now.

ah I think I didn't understand you originally. now checking that it's empty.

https://chromiumcodereview.appspot.com/10855253/diff/1045/chrome/browser/auto...
chrome/browser/autofill/autofill_browsertest.cc:1393: // Entire form should be
filled with one user gesture.
On 2012/08/21 07:24:17, Ilya Sherman wrote:
> On 2012/08/21 06:20:06, John Abd-El-Malek wrote:
> > On 2012/08/21 03:04:28, Ilya Sherman wrote:
> > > This description makes me think that we should be checking the values of
all
> > of
> > > the fields in the form, not just one of the fields.
> > 
> > please feel free to improve the tests in followup change. my goal was to
> > translate them so we can remove the automation hooks.
> 
> Please add a TODO(isherman): to verify the entire form's contents.

Done.

https://chromiumcodereview.appspot.com/10855253/diff/1045/chrome/browser/auto...
chrome/browser/autofill/autofill_browsertest.cc:1480: (base::Time::Now() -
start_time).InSeconds() << " seconds.";
On 2012/08/21 07:24:17, Ilya Sherman wrote:
> On 2012/08/21 06:20:06, John Abd-El-Malek wrote:
> > On 2012/08/21 03:04:28, Ilya Sherman wrote:
> > > nit: Passing tests should be silent.  Is this log line important to the
> test,
> > or
> > > can it be removed?
> > 
> > I think one line is ok, at least in the beginning so that we know how long
> this
> > step takes on the slower bots (i.e. if it causes flakiness because it takes
> too
> > long).
> 
> Ok.  In that case, please add a TODO or file a bug to remove this once we've
> gathered the info from the bots.

Done.

https://chromiumcodereview.appspot.com/10855253/diff/1045/chrome/browser/auto...
chrome/browser/autofill/autofill_browsertest.cc:1525:
static_cast<int>(personal_data_manager()->profiles().size()));
On 2012/08/21 07:24:17, Ilya Sherman wrote:
> On 2012/08/21 06:20:06, John Abd-El-Malek wrote:
> > On 2012/08/21 03:04:28, Ilya Sherman wrote:
> > > This looks like it's only testing that we throw away or merge at least one
> > > profile, which is a weaker test than the above ones.  Is this test just
> > > redundant with those?  If so, let's get rid of it.
> > 
> > again, I don't know enough about autofill to know if I should throw this out
> or
> > not. if you think we can delete this, it's fine with me.
> 
> Please add a TODO(isherman): to investigate removing this test, as it is
likely
> redundant.

Done.

Powered by Google App Engine
This is Rietveld 408576698