Closed Bug 1591620 Opened 5 years ago Closed 5 years ago

Allow adding different media control key listener to the event source directly

Categories

(Core :: Audio/Video: Playback, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Beside controlling media controller by corresponding media control keys event, the web extension also has a need to listener those events in order to support global media key usage.

Therefore, we should add a method to allow other customer to add or remove the event listener directly to the media control keys event source.

If the web extention also needs to implement its listener, they would definitely not need the current implementation in KeyPressed() for controlling media controller. Therefore, we should make MediaControlKeysEventListener as a pure interface and let inherited class to define their own KeyPressed().

Create methods to add or remove listener directly to the media control keys event source.

So if anyone has a need to monitor media control keys event, they can simply implement their own listener and use MediaControlService::GetMediaControlKeysManager() to add or remove a listener.

Depends on: 1591608
Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/daf24c18766f
part1 : make 'MediaControlKeysEventListener' as a pure interface. r=chunmin
https://hg.mozilla.org/integration/autoland/rev/9896df4aa26f
part2 : allow more customers to moniter media keys event by adding a listener to the event source. r=chunmin

Backed out 2 changesets (Bug 1591620) for mochitest-a11y leak at mozilla::dom::MediaControlService::MediaControlService.

Push with failure: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&classifiedState=unclassified&revision=9896df4aa26f3c29dec79e871fdd7df48baee0bf

https://treeherder.mozilla.org/#/jobs?repo=autoland&fromchange=afba5a084fe471a79a52184aa49a51a380198331&searchStr=linux%2Cx64%2Casan%2Cmochitests%2Cwithout%2Ce10s%2Ctest-linux64-asan%2Fopt-mochitest-a11y-1proc%2Cm-1proc%28a11y%29&selectedJob=273640215

The retriggers are green beacause: "Aryx: retriggers for first fail download wrong installer"

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=273640215&repo=autoland&lineNumber=3975

Backout link: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&classifiedState=unclassified&revision=90bdcedad2560f0a112313688804b3d805aead02

[task 2019-10-30T09:38:21.424Z] 09:38:21     INFO - GECKO(1166) | SUMMARY: AddressSanitizer: 16 byte(s) leaked in 1 allocation(s).
[task 2019-10-30T09:38:21.573Z] 09:38:21     INFO - TEST-INFO | Main app process: exit 0
[task 2019-10-30T09:38:21.573Z] 09:38:21     INFO - TEST-INFO | LeakSanitizer | To show the addresses of leaked objects add report_objects=1 to LSAN_OPTIONS
[task 2019-10-30T09:38:21.573Z] 09:38:21     INFO - TEST-INFO | LeakSanitizer | This can be done in testing/mozbase/mozrunner/mozrunner/utils.py
[task 2019-10-30T09:38:21.574Z] 09:38:21    ERROR - TEST-UNEXPECTED-FAIL | LeakSanitizer | leak at mozilla::dom::MediaControlService::MediaControlService, mozilla::dom::MediaControlService::GetService, mozilla::dom::NotifyMediaActiveChanged, mozilla::dom::NotifyMediaStarted
[task 2019-10-30T09:38:21.574Z] 09:38:21     INFO - runtests.py | Application ran for: 0:03:02.376598
[task 2019-10-30T09:38:21.574Z] 09:38:21     INFO - zombiecheck | Reading PID log: /tmp/tmpC9PncSpidlog
[task 2019-10-30T09:38:21.574Z] 09:38:21     INFO - ==> process 1166 launched child process 1183
[task 2019-10-30T09:38:21.574Z] 09:38:21     INFO - ==> process 1166 launched child process 1267
[task 2019-10-30T09:38:21.575Z] 09:38:21     INFO - ==> process 1166 launched child process 1303
[task 2019-10-30T09:38:21.575Z] 09:38:21     INFO - zombiecheck | Checking for orphan process with PID: 1303
[task 2019-10-30T09:38:21.575Z] 09:38:21     INFO - zombiecheck | Checking for orphan process with PID: 1267
[task 2019-10-30T09:38:21.575Z] 09:38:21     INFO - zombiecheck | Checking for orphan process with PID: 1183
[task 2019-10-30T09:38:21.575Z] 09:38:21     INFO - Stopping web server
[task 2019-10-30T09:38:21.583Z] 09:38:21     INFO - Stopping web socket server
[task 2019-10-30T09:38:21.591Z] 09:38:21     INFO - Stopping ssltunnel
[task 2019-10-30T09:38:21.612Z] 09:38:21  WARNING - leakcheck | refcount logging is off, so leaks can't be detected!
[task 2019-10-30T09:38:21.612Z] 09:38:21     INFO - runtests.py | Running tests: end.
[task 2019-10-30T09:38:21.632Z] 09:38:21     INFO - Buffered messages finished
[task 2019-10-30T09:38:21.633Z] 09:38:21     INFO - SUITE-END | took 183s
[task 2019-10-30T09:38:21.680Z] 09:38:21     INFO - Return code: 0
[task 2019-10-30T09:38:21.681Z] 09:38:21     INFO - TinderboxPrint: mochitest-mochitest-a11y<br/>407/0/0
[task 2019-10-30T09:38:21.682Z] 09:38:21    ERROR - # TBPL FAILURE #
[task 2019-10-30T09:38:21.682Z] 09:38:21  WARNING - setting return code to 2
[task 2019-10-30T09:38:21.682Z] 09:38:21    ERROR - The mochitest suite: mochitest-a11y ran with return status: FAILURE
[task 2019-10-30T09:38:21.683Z] 09:38:21     INFO - Running post-action listener: _package_coverage_data
[task 2019-10-30T09:38:21.683Z] 09:38:21     INFO - Running post-action listener: _resource_record_post_action
[task 2019-10-30T09:38:21.683Z] 09:38:21     INFO - Running post-action listener: process_java_coverage_data
[task 2019-10-30T09:38:21.683Z] 09:38:21     INFO - [mozharness: 2019-10-30 09:38:21.682596Z] Finished run-tests step (success)
[task 2019-10-30T09:38:21.683Z] 09:38:21     INFO - Running post-run listener: _resource_record_post_run
[task 2019-10-30T09:38:21.793Z] 09:38:21     INFO - Validating Perfherder data against /builds/worker/workspace/mozharness/external_tools/performance-artifact-schema.json
[task 2019-10-30T09:38:21.797Z] 09:38:21     INFO - PERFHERDER_DATA: {"framework": {"name": "job_resource_usage"}, "suites": [{"subtests": [{"name": "cpu_percent", "value": 43.766888888888886}, {"name": "io_write_bytes", "value": 2701148160}, {"name": "io.read_bytes", "value": 24518656}, {"name": "io_write_time", "value": 380640}, {"name": "io_read_time", "value": 1016}], "extraOptions": ["taskcluster-m5.large"], "name": "mochitest.mochitest-a11y.overall"}, {"subtests": [{"name": "time", "value": 0.024610042572021484}], "name": "mochitest.mochitest-a11y.start-pulseaudio"}, {"subtests": [{"name": "time", "value": 41.8727080821991}, {"name": "cpu_percent", "value": 50.525}], "name": "mochitest.mochitest-a11y.install"}, {"subtests": [{"name": "time", "value": 0.00021004676818847656}], "name": "mochitest.mochitest-a11y.stage-files"}, {"subtests": [{"name": "time", "value": 184.12295198440552}, {"name": "cpu_percent", "value": 42.2188524590164}], "name": "mochitest.mochitest-a11y.run-tests"}]}
[task 2019-10-30T09:38:21.798Z] 09:38:21     INFO - Total resource usage - Wall time: 225s; CPU: 42.0%; Read bytes: 24518656; Write bytes: 2701148160; Read time: 1016; Write time: 380640
[task 2019-10-30T09:38:21.798Z] 09:38:21     INFO - TinderboxPrint: CPU usage<br/>42.2%
[task 2019-10-30T09:38:21.798Z] 09:38:21     INFO - TinderboxPrint: I/O read bytes / time<br/>24,518,656 / 1,016
[task 2019-10-30T09:38:21.799Z] 09:38:21     INFO - TinderboxPrint: I/O write bytes / time<br/>2,701,148,160 / 380,640
[task 2019-10-30T09:38:21.799Z] 09:38:21     INFO - TinderboxPrint: CPU idle<br/>242.7 (54.2%)
[task 2019-10-30T09:38:21.799Z] 09:38:21     INFO - TinderboxPrint: CPU iowait<br/>9.0 (2.0%)
[task 2019-10-30T09:38:21.799Z] 09:38:21     INFO - TinderboxPrint: CPU system<br/>18.7 (4.2%)
[task 2019-10-30T09:38:21.800Z] 09:38:21     INFO - TinderboxPrint: CPU user<br/>177.5 (39.6%)
[task 2019-10-30T09:38:21.800Z] 09:38:21     INFO - TinderboxPrint: Swap in / out<br/>0 / 0
[task 2019-10-30T09:38:21.801Z] 09:38:21     INFO - start-pulseaudio - Wall time: 0s; CPU: Can't collect data; Read bytes: 0; Write bytes: 0; Read time: 0; Write time: 0
[task 2019-10-30T09:38:21.801Z] 09:38:21     INFO - install - Wall time: 42s; CPU: 51.0%; Read bytes: 0; Write bytes: 2158649344; Read time: 0; Write time: 321560
[task 2019-10-30T09:38:21.802Z] 09:38:21     INFO - stage-files - Wall time: 0s; CPU: Can't collect data; Read bytes: 0; Write bytes: 0; Read time: 0; Write time: 0
[task 2019-10-30T09:38:21.803Z] 09:38:21     INFO - run-tests - Wall time: 184s; CPU: 42.0%; Read bytes: 12533760; Write bytes: 542498816; Read time: 880; Write time: 59080
[task 2019-10-30T09:38:21.836Z] 09:38:21  WARNING - returning nonzero exit status 2
Flags: needinfo?(alwu)
Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bc569fb53ccd
part1 : make 'MediaControlKeysEventListener' as a pure interface. r=chunmin
https://hg.mozilla.org/integration/autoland/rev/9fd190b08922
part2 : allow more customers to moniter media keys event by adding a listener to the event source. r=chunmin
Regressions: 1592497
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
Flags: needinfo?(alwu)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: