-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
fix: allow uploading large files on Android #27835
Conversation
Test results for "tests 1"1 failed 5 flaky25329 passed, 600 skipped Merge workflow run. |
browser._interceptSetInputFilePaths = async (page, files) => { | ||
const newLocalFiles = []; | ||
for (const file of files) { | ||
const localFileName = `/data/local/tmp/pw/${path.basename(file)}`; |
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.
this may clash with other file names
@@ -343,6 +345,35 @@ export class AndroidDevice extends SdkObject { | |||
validateBrowserContextOptions(options, browserOptions); | |||
|
|||
const browser = await CRBrowser.connect(this.attribution.playwright, androidBrowser, browserOptions); | |||
{ | |||
const androidArtifacts = new Set<string>(); | |||
browser._interceptSetInputFilePaths = async (page, 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.
This is quite a hack. I'd rather get createTempFile to create files on the android device, wdyt?
@@ -333,6 +333,8 @@ export class CRPage implements PageDelegate { | |||
} | |||
|
|||
async setInputFilePaths(progress: Progress, handle: dom.ElementHandle<HTMLInputElement>, files: string[]): Promise<void> { | |||
if (this._browserContext._browser._interceptSetInputFilePaths) |
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.
I'd rather revert the change that fixed lastModified, this becomes too hairy. Maybe we can move convertInputFiles
logic to the server and let it properly handle the android case?
#27792