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

Issue 2742813004: [Payments] Refactor into PaymentRequestState and Spec (Closed)

Created:
3 years, 9 months ago by Mathieu
Modified:
3 years, 9 months ago
CC:
chromium-reviews, darin-cc_chromium.org, gogerald+paymentswatch_chromium.org, jam, mahmadi+paymentswatch_chromium.org, rouslan+payments_chromium.org, sebsg+paymentswatch_chromium.org, tfarina, tmartino
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Payments] Refactor into PaymentRequestState and Spec The result is more unit-testable. PaymentRequestState will contain everything about the user's state in the flow: what their selections are, and whether they are ready to pay. PaymentRequestSpec will contain everything about the merchant specification: are they requesting shipping info, payer's info, or what are their supported forms of payments. A further CL will attempt to remove the view controller's dependence on PaymentRequest and rather just pass the state and the spec pointers. BUG=701345 TEST=browser_tests, components_unittests Review-Url: https://codereview.chromium.org/2742813004 Cr-Commit-Position: refs/heads/master@{#457054} Committed: https://chromium.googlesource.com/chromium/src/+/f1a7a37514b2eda7e895b0e52d120e937d58b385

Patch Set 1 : Initial #

Patch Set 2 : fix tests #

Patch Set 3 : new unittest! #

Patch Set 4 : another set of tests (state) #

Total comments: 8

Patch Set 5 : deps fix #

Total comments: 10

Patch Set 6 : addressed comments #

Patch Set 7 : rebase #

Patch Set 8 : don't stop rebasin' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1155 lines, -478 lines) Patch
M chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc View 1 2 3 4 5 4 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/payments/credit_card_editor_view_controller_browsertest.cc View 1 6 chunks +6 lines, -5 lines 0 comments Download
M chrome/browser/ui/views/payments/order_summary_view_controller.h View 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/payments/order_summary_view_controller.cc View 1 2 3 4 5 6 7 4 chunks +17 lines, -12 lines 0 comments Download
M chrome/browser/ui/views/payments/payment_method_view_controller.cc View 1 2 3 4 5 3 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc View 1 2 3 4 5 4 chunks +8 lines, -7 lines 0 comments Download
M chrome/browser/ui/views/payments/payment_sheet_view_controller.h View 1 2 3 4 5 6 4 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/payments/payment_sheet_view_controller.cc View 1 2 3 4 5 6 14 chunks +34 lines, -24 lines 0 comments Download
M chrome/browser/ui/views/payments/profile_list_view_controller.h View 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/payments/profile_list_view_controller.cc View 1 2 3 4 5 3 chunks +12 lines, -10 lines 0 comments Download
M chrome/browser/ui/views/payments/shipping_option_view_controller.cc View 1 2 3 4 5 6 2 chunks +6 lines, -6 lines 0 comments Download
M components/payments/content/BUILD.gn View 1 2 3 4 5 6 7 2 chunks +9 lines, -0 lines 0 comments Download
M components/payments/content/payment_request.h View 1 2 3 4 5 6 7 5 chunks +22 lines, -132 lines 0 comments Download
M components/payments/content/payment_request.cc View 1 2 3 4 5 6 7 6 chunks +27 lines, -268 lines 0 comments Download
A components/payments/content/payment_request_spec.h View 1 2 3 4 5 6 7 1 chunk +76 lines, -0 lines 0 comments Download
A components/payments/content/payment_request_spec.cc View 1 2 3 4 5 6 7 1 chunk +115 lines, -0 lines 0 comments Download
A components/payments/content/payment_request_spec_unittest.cc View 1 2 1 chunk +212 lines, -0 lines 0 comments Download
A components/payments/content/payment_request_state.h View 1 2 3 4 5 1 chunk +170 lines, -0 lines 0 comments Download
A components/payments/content/payment_request_state.cc View 1 2 3 4 5 1 chunk +209 lines, -0 lines 0 comments Download
A components/payments/content/payment_request_state_unittest.cc View 1 2 3 4 5 6 1 chunk +218 lines, -0 lines 0 comments Download

Messages

Total messages: 67 (53 generated)
Mathieu
Hi you two. This is not a functional change, but it has a big surface ...
3 years, 9 months ago (2017-03-14 14:04:53 UTC) #20
Mathieu
Hi, I added some unittests for PaymentRequestState. can you PTAL for realz? Thanks
3 years, 9 months ago (2017-03-14 15:35:06 UTC) #25
tmartino
On 2017/03/14 at 15:35:06, mathp wrote: > Hi, I added some unittests for PaymentRequestState. > ...
3 years, 9 months ago (2017-03-14 16:02:12 UTC) #31
please use gerrit instead
While I'm reviewing, can you make the description lines at most 72 chars long, please? ...
3 years, 9 months ago (2017-03-14 16:05:18 UTC) #32
please use gerrit instead
So wonderful to see all these tests! :-) https://codereview.chromium.org/2742813004/diff/140001/components/payments/content/payment_request.h File components/payments/content/payment_request.h (right): https://codereview.chromium.org/2742813004/diff/140001/components/payments/content/payment_request.h#newcode142 components/payments/content/payment_request.h:142: std::vector<std::unique_ptr<autofill::AutofillProfile>> ...
3 years, 9 months ago (2017-03-14 16:35:22 UTC) #33
anthonyvd
https://codereview.chromium.org/2742813004/diff/120001/components/payments/content/payment_request.h File components/payments/content/payment_request.h (right): https://codereview.chromium.org/2742813004/diff/120001/components/payments/content/payment_request.h#newcode92 components/payments/content/payment_request.h:92: // Uses CurrencyFormatter to get the formatted currency code ...
3 years, 9 months ago (2017-03-14 16:46:41 UTC) #34
Mathieu
Hi, I think everything is addressed. PTAL? https://codereview.chromium.org/2742813004/diff/120001/components/payments/content/payment_request.h File components/payments/content/payment_request.h (right): https://codereview.chromium.org/2742813004/diff/120001/components/payments/content/payment_request.h#newcode92 components/payments/content/payment_request.h:92: // Uses ...
3 years, 9 months ago (2017-03-14 18:05:39 UTC) #39
please use gerrit instead
lgtm
3 years, 9 months ago (2017-03-14 18:07:15 UTC) #41
anthonyvd
lgtm https://codereview.chromium.org/2742813004/diff/120001/components/payments/content/payment_request_state.h File components/payments/content/payment_request_state.h (right): https://codereview.chromium.org/2742813004/diff/120001/components/payments/content/payment_request_state.h#newcode40 components/payments/content/payment_request_state.h:40: virtual const std::string& GetApplicationLocale() = 0; On 2017/03/14 ...
3 years, 9 months ago (2017-03-14 18:11:24 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/2742813004/240001
3 years, 9 months ago (2017-03-15 02:12:14 UTC) #59
Mathieu
Thanks for the review! https://codereview.chromium.org/2742813004/diff/120001/components/payments/content/payment_request_state.h File components/payments/content/payment_request_state.h (right): https://codereview.chromium.org/2742813004/diff/120001/components/payments/content/payment_request_state.h#newcode40 components/payments/content/payment_request_state.h:40: virtual const std::string& GetApplicationLocale() = ...
3 years, 9 months ago (2017-03-15 02:51:14 UTC) #60
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/383762)
3 years, 9 months ago (2017-03-15 03:43:13 UTC) #62
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/2742813004/240001
3 years, 9 months ago (2017-03-15 10:47:23 UTC) #64
commit-bot: I haz the power
3 years, 9 months ago (2017-03-15 11:24:26 UTC) #67
Message was sent while issue was closed.
Committed patchset #8 (id:240001) as
https://chromium.googlesource.com/chromium/src/+/f1a7a37514b2eda7e895b0e52d12...

Powered by Google App Engine
This is Rietveld 408576698