Repository navigation
fix(android): include the from point in the swipe path
#42349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
26b2117
c658786
9b39365
6de3e90
332d291
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| /** | ||
| * Copyright 2020 Microsoft Corporation. All rights reserved. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| import { androidTest as test, expect } from './androidTest'; | ||
|
|
||
| test('androidInput.swipe should start from the given point', async ({ androidDevice }) => { | ||
| const context = await androidDevice.launchBrowser(); | ||
| const [page] = context.pages(); | ||
| await page.setContent(`<div style="height: 3000px">${'line<br>'.repeat(200)}</div>`); | ||
| // androidDevice.input.swipe() injects a raw touch event straight into the OS input | ||
| // pipeline, independent of the CDP connection used by setContent() above. Wait for | ||
| // the new content to actually be composited and presented on the device screen, | ||
| // otherwise the swipe can land on the previous (blank) frame and never scroll anything. | ||
| await page.evaluate(() => new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)))); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Switched to Worth noting the wait has never actually run on the emulator. The only Android job on this branch is run 32510988871, which built c658786, before the wait existed. If you re-apply CQ1 and it still fails, I will drop the test and leave only the fix. |
||
| await androidDevice.input.swipe({ x: 250, y: 1500 }, [{ x: 250, y: 500 }], 30); | ||
| await expect.poll(() => page.evaluate(() => window.scrollY)).toBeGreaterThan(0); | ||
| await context.close(); | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not 2020 anymore, look at other files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, copied it from the older files in this folder. Changed to the
Copyright (c) Microsoft Corporation.header in 6de3e90.