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

Issue 2647243002: PaymentApp: Implement PaymentAppProvider for LayoutTest.

Created:
3 years, 11 months ago by zino
Modified:
3 years, 8 months ago
CC:
Aaron Boodman, abarth-chromium, chromium-reviews, darin (slow to review), darin-cc_chromium.org, einbinder+watch-test-runner_chromium.org, jam, jochen+watch_chromium.org, mlamouri+watch-test-runner_chromium.org, mlamouri+watch-content_chromium.org, Peter Beverloo, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

PaymentApp: Implement PaymentAppProvider for LayoutTest. This CL is implementing LayoutTestPaymentAppProvider class. The implementation is binded with testRunner and then provides the following APIs. - getAllPaymentAppIDs(): Get all IDs of registered SWs for payment app. - invokePaymentApp(): Invoke the specified payment app. This change is used by another CL[1] to test the behavior of invokePaymentApp(). [1] https://codereview.chromium.org/2646313002/ BUG=661608

Patch Set 1 #

Total comments: 8

Patch Set 2 : PaymentApp: Implement PaymentAppProvider for LayoutTest. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+206 lines, -3 lines) Patch
M components/test_runner/test_runner.cc View 3 chunks +17 lines, -0 lines 0 comments Download
M components/test_runner/test_runner_for_specific_view.h View 1 chunk +5 lines, -0 lines 0 comments Download
M components/test_runner/test_runner_for_specific_view.cc View 1 chunk +34 lines, -0 lines 0 comments Download
M components/test_runner/web_test_delegate.h View 1 chunk +5 lines, -0 lines 0 comments Download
M content/shell/BUILD.gn View 2 chunks +3 lines, -0 lines 0 comments Download
M content/shell/DEPS View 1 1 chunk +1 line, -0 lines 0 comments Download
M content/shell/browser/content_shell_browser_manifest_overlay.json View 1 chunk +2 lines, -1 line 0 comments Download
M content/shell/browser/layout_test/layout_test_content_browser_client.cc View 2 chunks +3 lines, -0 lines 0 comments Download
A content/shell/browser/layout_test/layout_test_payment_app_provider_impl.h View 1 chunk +32 lines, -0 lines 0 comments Download
A content/shell/browser/layout_test/layout_test_payment_app_provider_impl.cc View 1 1 chunk +67 lines, -0 lines 0 comments Download
A content/shell/common/layout_test/layout_test_payment_app_provider.mojom View 1 chunk +10 lines, -0 lines 0 comments Download
M content/shell/renderer/layout_test/blink_test_runner.h View 3 chunks +8 lines, -0 lines 0 comments Download
M content/shell/renderer/layout_test/blink_test_runner.cc View 3 chunks +19 lines, -2 lines 0 comments Download

Messages

Total messages: 27 (14 generated)
zino
PTAL pfeldman@ for components and content Tom Sepez@ for mojom rouslan@ and tommyt@ for payments
3 years, 11 months ago (2017-01-23 09:27:40 UTC) #6
please use gerrit instead
https://codereview.chromium.org/2647243002/diff/1/content/public/DEPS File content/public/DEPS (right): https://codereview.chromium.org/2647243002/diff/1/content/public/DEPS#newcode4 content/public/DEPS:4: "+components/payments/payment_app.mojom.h", This dependency seems unnecessary. https://codereview.chromium.org/2647243002/diff/1/content/public/browser/payment_app_provider.h File content/public/browser/payment_app_provider.h (right): ...
3 years, 11 months ago (2017-01-23 13:28:07 UTC) #7
zino
Thank you for review. https://codereview.chromium.org/2647243002/diff/1/content/public/DEPS File content/public/DEPS (right): https://codereview.chromium.org/2647243002/diff/1/content/public/DEPS#newcode4 content/public/DEPS:4: "+components/payments/payment_app.mojom.h", On 2017/01/23 13:28:07, rouslan ...
3 years, 11 months ago (2017-01-23 17:31:08 UTC) #8
please use gerrit instead
payments lgtm
3 years, 11 months ago (2017-01-23 17:48:57 UTC) #9
pfeldman
@esprehn: do you think layout test is the right approach here? there is fair amount ...
3 years, 11 months ago (2017-01-23 18:05:28 UTC) #15
Tom Sepez
lgtm
3 years, 11 months ago (2017-01-23 18:26:47 UTC) #16
esprehn
Please don't add new testRunner features. You want to use mojo mocks in JS like ...
3 years, 11 months ago (2017-01-23 23:59:52 UTC) #17
please use gerrit instead
Also see an example of mojo mocks in web payments: https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/payments/resources/payment-request-mock.js
3 years, 11 months ago (2017-01-24 15:10:37 UTC) #18
zino
On 2017/01/24 15:10:37, rouslan wrote: > Also see an example of mojo mocks in web ...
3 years, 11 months ago (2017-01-24 15:58:05 UTC) #19
zino
Could you please give me any guides? (and if my understanding is wrong, please correct ...
3 years, 11 months ago (2017-01-24 16:00:48 UTC) #20
esprehn
rbyers@ might be able to help you there. I think you need to add a ...
3 years, 11 months ago (2017-01-25 04:23:41 UTC) #22
zino
On 2017/01/25 04:23:41, esprehn wrote: > rbyers@ might be able to help you there. I ...
3 years, 10 months ago (2017-01-26 03:13:48 UTC) #23
Rick Byers
3 years, 8 months ago (2017-04-07 17:38:19 UTC) #27
On 2017/01/26 03:13:48, zino wrote:
> On 2017/01/25 04:23:41, esprehn wrote:
> > rbyers@ might be able to help you there. I think you need to add a way to
get
> a
> > fake user gesture in the tests. That might need to be an internal API. That
> > should be separate from the fake payment bits though.
> 
> Hi Rick,
> 
> Do you have any idea?
> Please help me :)
> 
> BTW, what's the internal API exactly?
> Is it the following link?
>   -
>
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/testing/I...
> If so, I have an experience doing it when working on canvas2d.
> But I'm not sure if we can simulate a event initiated from browser side.
> We might simulate a event initiated from renderer side. (and write browser
tests
> additionally?)

Sorry I missed this!  +mustaq who owns user gestures and is on the input team (I
don't do much input stuff anymore myself):

There are a variety of different ways of generating a user gesture from tests
depending on the type of test.  This style of test is new to me, so I'm not sure
offhand which approach is best.  You probably want to survey to existing
approaches and see which one fits best into this style of test.  Here's some
pointers:

LayoutTests - use EventSender to generate fake input, eg.
LayoutTests/fast/events/*
A browser test when running some JS:
RenderFrameHost::ExecuteJavascriptWithUseGestureForTests
A browser test by simulating input: eg. SimulateMouseClick in
browser_test_utils.cc
Browser tests of features which provide their own testing hook: eg.
SafeBrowsingNavigationObserverManager::RecordUserGestureForWebContents

Hope this helps!

Powered by Google App Engine
This is Rietveld 408576698