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

Issue 2744933004: [Autofill] Rewrite Autofill unitttests to use INSTANTIATE_TEST_CASE_P (Closed)

Created:
3 years, 9 months ago by wuandy
Modified:
3 years, 9 months ago
Reviewers:
Mathieu, sebsg
CC:
chromium-reviews, rouslan+autofill_chromium.org, rogerm+autofillwatch_chromium.org, sebsg+autofillwatch_chromium.org, browser-components-watch_chromium.org, mathp+autofillwatch_chromium.org, vabr+watchlistautofill_chromium.org, estade+watch_chromium.org, Mathieu
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Rewrite Autofill unitttests under components to use INSTANTIATE_TEST_CASE_P Many tests under component are like this: const struct { const char* input; bool expected_result; } kTestCases[] = { {"ab", true}, {"abc", true}, {"abde", true} }; for (const auto& test_case : kTestCases) { EXPECT_EQ(test_case.expected_result, SomeFunction(test_case.input)); } They should be rewritten using INSTANTIATE_TEST_CASE_P, it will create separate test cases for each testing input given. BUG=700512 TEST=components_unittests Review-Url: https://codereview.chromium.org/2744933004 Cr-Commit-Position: refs/heads/master@{#456843} Committed: https://chromium.googlesource.com/chromium/src/+/23ff72c5f2fc95e16f8eb996767d614976605193

Patch Set 1 #

Patch Set 2 : More unit test rewrites #

Patch Set 3 : More unit tests rewrites #

Total comments: 10

Patch Set 4 : Last batch of unittest(more complicated ones) to rewrite. #

Patch Set 5 : Debugging failed windows build #

Patch Set 6 : isolate where window build fails #

Patch Set 7 : comment out one test that is causing windows compilers complain and address reviewer comments. #

Total comments: 2

Patch Set 8 : remove commented test case. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2756 lines, -2082 lines) Patch
M components/autofill/core/browser/address_i18n_unittest.cc View 1 2 1 chunk +81 lines, -51 lines 0 comments Download
M components/autofill/core/browser/autofill_data_model_unittest.cc View 1 1 chunk +57 lines, -47 lines 0 comments Download
M components/autofill/core/browser/autofill_data_util_unittest.cc View 1 2 3 4 5 6 1 chunk +154 lines, -139 lines 0 comments Download
M components/autofill/core/browser/autofill_field_unittest.cc View 1 2 3 4 5 6 3 chunks +442 lines, -321 lines 0 comments Download
M components/autofill/core/browser/contact_info_unittest.cc View 1 2 chunks +208 lines, -190 lines 0 comments Download
M components/autofill/core/browser/credit_card_field.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M components/autofill/core/browser/credit_card_field_unittest.cc View 1 2 3 3 chunks +146 lines, -117 lines 0 comments Download
M components/autofill/core/browser/credit_card_unittest.cc View 1 2 3 4 5 6 7 4 chunks +499 lines, -384 lines 0 comments Download
M components/autofill/core/browser/personal_data_manager.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M components/autofill/core/browser/personal_data_manager_unittest.cc View 1 2 3 5 chunks +434 lines, -337 lines 0 comments Download
M components/autofill/core/browser/phone_number_i18n_unittest.cc View 1 1 chunk +71 lines, -55 lines 0 comments Download
M components/autofill/core/browser/ui/card_unmask_prompt_controller_impl_unittest.cc View 1 2 3 3 chunks +141 lines, -73 lines 0 comments Download
M components/autofill/core/browser/webdata/autofill_profile_syncable_service_unittest.cc View 1 2 1 chunk +118 lines, -68 lines 0 comments Download
M components/autofill/core/browser/webdata/autofill_table_unittest.cc View 1 2 1 chunk +95 lines, -44 lines 0 comments Download
M components/autofill/core/common/autofill_regexes_unittest.cc View 1 1 chunk +182 lines, -159 lines 0 comments Download
M components/autofill/core/common/autofill_util_unittest.cc View 1 2 3 4 5 6 2 chunks +125 lines, -96 lines 0 comments Download

Messages

Total messages: 51 (39 generated)
sebsg
Nice! Just a couple comments. Could you add a constructor for the struct when there ...
3 years, 9 months ago (2017-03-13 14:56:11 UTC) #13
sebsg
Also, could you do the same thing for tests in credit_card_unittest.cc and personal_data_manager_unittest.cc? Very appreciated ...
3 years, 9 months ago (2017-03-13 15:00:50 UTC) #14
sebsg
Also, could you do the same thing for tests in credit_card_unittest.cc and personal_data_manager_unittest.cc? Very appreciated ...
3 years, 9 months ago (2017-03-13 15:00:51 UTC) #15
wuandy
On 2017/03/13 15:00:51, sebsg wrote: > Also, could you do the same thing for tests ...
3 years, 9 months ago (2017-03-13 19:47:29 UTC) #26
wuandy
windows builds are failing for some reason..not sure if this is related to my patch ...
3 years, 9 months ago (2017-03-13 20:02:41 UTC) #29
Mathieu
Thanks Andy, wow I didn't know there were so many! Since Seb already started the ...
3 years, 9 months ago (2017-03-14 00:08:28 UTC) #35
wuandy
commented out test failing to compile on windows and addressed other comments. https://codereview.chromium.org/2744933004/diff/40001/components/autofill/core/browser/autofill_data_util_unittest.cc File components/autofill/core/browser/autofill_data_util_unittest.cc ...
3 years, 9 months ago (2017-03-14 19:05:36 UTC) #39
sebsg
One last comment! Almost there :) https://codereview.chromium.org/2744933004/diff/120001/components/autofill/core/browser/credit_card_unittest.cc File components/autofill/core/browser/credit_card_unittest.cc (right): https://codereview.chromium.org/2744933004/diff/120001/components/autofill/core/browser/credit_card_unittest.cc#newcode1003 components/autofill/core/browser/credit_card_unittest.cc:1003: // TODO(wuandy): rewriting ...
3 years, 9 months ago (2017-03-14 19:15:24 UTC) #40
wuandy
https://codereview.chromium.org/2744933004/diff/120001/components/autofill/core/browser/credit_card_unittest.cc File components/autofill/core/browser/credit_card_unittest.cc (right): https://codereview.chromium.org/2744933004/diff/120001/components/autofill/core/browser/credit_card_unittest.cc#newcode1003 components/autofill/core/browser/credit_card_unittest.cc:1003: // TODO(wuandy): rewriting this test with INSTANTIATE_TEST_CASE_P seems to ...
3 years, 9 months ago (2017-03-14 19:27:45 UTC) #41
sebsg
LGTM!
3 years, 9 months ago (2017-03-14 20:01:18 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2744933004/140001
3 years, 9 months ago (2017-03-14 21:29:56 UTC) #48
commit-bot: I haz the power
3 years, 9 months ago (2017-03-14 21:41:54 UTC) #51
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/23ff72c5f2fc95e16f8eb996767d...

Powered by Google App Engine
This is Rietveld 408576698