Closed Bug 1920092 Opened 1 year ago Closed 1 year ago

[Fenix PDF] Make pdfs from Fenix downloads open in Fenix

Categories

(Firefox for Android :: General, task, P2)

All
Android
task

Tracking

()

VERIFIED FIXED
134 Branch
Tracking Status
firefox134 --- verified

People

(Reporter: rsainani, Assigned: npoon)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxdroid][group4])

Attachments

(3 files)

Consider adding a preference that allows user to enable/disable opening pdfs from Fenix in Fenix by default. This would give them the choice and would result in a much smoother experience for usecases like pdfs being opened from downloads.

Assignee: nobody → npoon
Status: NEW → ASSIGNED
Whiteboard: [fxdroid][group4]

Based on discussion from UX and the PDF team, we have decided to open PDFs from Fenix in Fenix, as this mirrors the behaviour in desktop. Changing the title to reflect this.

Summary: [Fenix PDF] Consider opening pdfs from downloads by default in Fenix → [Fenix PDF] Make pdfs from downloads open in Fenix
Summary: [Fenix PDF] Make pdfs from downloads open in Fenix → [Fenix PDF] Make pdfs from Fenix downloads open in Fenix
Attachment #9429990 - Attachment description: WIP: Bug 1920092 - Add a settings preference to enable and disable opening downloaded PDFs from fenix in fenix by default → Bug 1920092 - Make PDFs from Fenix downloads open in Fenix
Attachment #9429990 - Attachment description: Bug 1920092 - Make PDFs from Fenix downloads open in Fenix → Bug 1920092 - Make PDFs from Fenix open in Fenix
Pushed by npoon@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c491a504af88 Make PDFs from Fenix open in Fenix r=android-reviewers,rsainani

Hello, this affects some UI tests in how we handle or expect to handle intent handling of opening downloaded PDFs as they are now failing on autoland.

https://console.firebase.google.com/project/moz-fenix/testlab/histories/bh.66b7091e15d53d45/matrices/5520127331887211174/details?stepId=bs.23dc13a0e8a32e25&testCaseId=2&tabId=logs

https://firefox-ci-tc.services.mozilla.com/tasks/LUk4eDz4QOunYkiqo6WMyA

  • verifyPDFViewerDownloadButtonTest in org.mozilla.fenix.ui.PDFViewerTest
  • saveAsPdfFunctionalityTest in org.mozilla.fenix.ui.DownloadTest
  • saveAsPdfFunctionalityTest in org.mozilla.fenix.ui.RedesignedNavigationToolbarSmokeTest

As these also failed on your Try https://treeherder.mozilla.org/jobs?repo=try&revision=117dbdb8443c384c60c1defcc03bf4299d8d9057&selectedTaskRun=DfzOPMEaQOauWHycryPocw.0

I believe these tests previously expected com.google.android.apps.docs to handle the PDF on Open, so we need to assert that Firefox remains in foreground.

https://searchfox.org/mozilla-central/source/mobile/android/fenix/app/src/androidTest/java/org/mozilla/fenix/ui/DownloadTest.kt#354
https://searchfox.org/mozilla-central/source/mobile/android/fenix/app/src/androidTest/java/org/mozilla/fenix/ui/PDFViewerTest.kt#61

Flags: needinfo?(npoon)
Regressions: 1928136

Thanks for the breakdown :aaronmt! As discussed offline, we have agreed to disable these tests temporarily for investigation

Flags: needinfo?(npoon)
Pushed by npoon@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1ef6741894ad Temporarily disable some Android PDF UI tests for investigation r=aaronmt
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch

Can QA please verify the change?

We want to verify that opening a PDF from the following methods should open the PDF from fenix:

  1. After successfully downloading a PDF, there is a dialog shown at the bottom of the screen, showing an option to open the downloaded file. Click the open button.
  2. After successfully downloading a PDF, there is a notification showing that the download has completed. Clicking on this download should open this PDF from within fenix.
  3. Opening any downloaded PDF from fenix through Menu > Downloads should open the PDF from fenix.

It would be great if we can test 1 and 2 in custom tabs as well.

We also want to verify that the behaviour has not changed elsewhere. Specifically, if the user tries to open any PDF from their file explorer, the default PDF opener should be used or there should be a prompt to select which app to use to open the PDF (if a default hasn't been set)

Flags: qe-verify+

Hi,
I've verified the above mentioned scenarios:

  1. After successfully downloading a PDF, the open button from the dialog shown at the bottom of the screen, opens the PDF file in the browser.
  2. After successfully downloading a PDF, tapping on the notification showing that the download has completed, opens the PDF file in Fenix.
  3. Opening any downloaded PDF from fenix through Menu > Downloads opens the PDF in Fenix.
  4. Adding the page as custom tab, then downloading the PDF file behaves the same way as the normal tab on opening the file through the notification or through the open button from the dialog.
  5. There's an occasional error on custom tab, saying "App isn't installed" when trying to open it, I don't know if that has any connection with the change made here, but there are no issues regarding downloading and opening a PDF file.
  6. Opening a PDF file through the file explorer, is as mentioned above, if the PDF reader app is installed, it is opened in that app, if not, there is a prompt to select which app to use to open the PDF.

Tested build: Firefox Nightly 134.0a1 from 2024-11-01.
Tested devices: Samsung Galaxy S23 Ultra (Android 14) and Google Pixel 9 Pro XL (Android 14).
Marking the ticket as verified on 134.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: