Closed Bug 1905331 Opened 7 months ago Closed 4 months ago

Findbar in PDF viewer doesn't play "not found" sound

Categories

(Toolkit :: Find Toolbar, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
133 Branch
Tracking Status
firefox133 --- fixed

People

(Reporter: bootleq, Assigned: bootleq)

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0

Steps to reproduce:

  1. With below about:config settings
  • accessibility.typeaheadfind.enablesound => true (default)
  • accessibility.typeaheadfind.soundURL => "beep" (default)
  1. Open a PDF file, by enter below URL
    https://bootleq.github.io/etc/findbar/sample.pdf
  2. Hit Ctrl+F to open the findbar, then type firr (the last r can't be found)

Actual results:

Findbar shows "Phrase not found", and NO sound was played.

Expected results:

The "not found" sound "beep" is played after typing last r.

The "not found" sound was initially implemented in cpp, then reworked
again in FinderParent (mjs) during fission migration.

Now completely move the implemention to JS as a new module. Make it
easier to be integrated by find controllers, also reduce typeaheadfind's
unnecessary responsibility.

To be clear, the FinderParent.sys.mjs affects the general findbar in
web pages, while Finder.sys.mjs affects non-remote pages e.g., chrome
pages like about:about (previously handled by nsTypeAheadFind.cpp).

Assignee: nobody → bootleq
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Where to test various Findbars:

(1/3) Most general findbar, handled by FinderParent.sys.mjs

(2/3) Non-remote findbar, handled by Finder.sys.mjs

(3/3) Findbar in PDF view, handled by PdfStreamConverter.sys.mjs

(4). Others situations like specific preferences change

  • typeaheadfind related

    • accessibility.typeaheadfind.enablesound (default: true)
    • accessibility.typeaheadfind.soundURL (default: beep)
  • findbar.modalHighlight (default: false)
    This feature is going to be removed.
    https://bugzilla.mozilla.org/show_bug.cgi?id=1872349
    I didn't find a way to enable it, so didn't test it.

Add MockSound to replace nsISound in test. Allow us to track play
calls by additional exposed played array.

The test fails when I run it locally:

toolkit/modules/tests/browser/browser_FinderSound.js
FAIL "beep" notfound sound - Structures begin differing at:
got[0] = Does not exist
expected[0] = "beep"

Stack trace:
chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.isDeeply:1983
chrome://mochitests/content/browser/toolkit/modules/tests/browser/browser_FinderSound.js:test_notfound_sound_with_preferences:27
...

(In reply to Neil Deakin from comment #5)

The test fails when I run it locally:

toolkit/modules/tests/browser/browser_FinderSound.js
FAIL "beep" notfound sound - Structures begin differing at:
got[0] = Does not exist
expected[0] = "beep"

It passes on my side, command ./mach test toolkit/modules/tests/browser/browser_FinderSound.js with code rebased after today's build after commit dee87b3ded.

Do we have remote CI to see test result, or we use email or chat to further investigate?

I did a test run at https://treeherder.mozilla.org/jobs?repo=try&revision=175e96755cab6938e8bc66b6eded0e5aa56d3439

Here it fails consistently on Linux. It also fails in verify mode (the ones labelled TV). You can check this by using the --verify flag when running the test.

Thanks, I've reproduced failures and made fixes.
Latest diff can be reviewed at https://phabricator.services.mozilla.com/D215306?vs=911592&id=913684#toc

Flags: needinfo?(enndeakin)
Pushed by dtownsend@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5632d6b41ee6 Move findbar sound handling to new JS module, r=NeilDeakin https://hg.mozilla.org/integration/autoland/rev/93742758f826 Add findbar "not found" sound to PDF view, r=pdfjs-reviewers,robwu https://hg.mozilla.org/integration/autoland/rev/e495bf9b0749 Add test for findbar sound, r=NeilDeakin,pdfjs-reviewers,robwu
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch
Flags: needinfo?(enndeakin)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: