resource://gre/modules/Battery.jsm was introduced in bug 978857, and is only referenced by toolkit/modules/tests/browser/browser_Battery.js which tests it. It was meant as a test helper, so it should be packaged using TESTING_JS_MODULES instead of EXTRA_JS_MODULES. But given that no other test seems to be using it, I think we could also just remove it. Yoric, you r+'ed this file in bug 978857, how do you feel about us removing it?
Well, it was meant to be used by bug 978857, which would still be useful.
(In reply to David Teller [:Yoric] (please use "needinfo") from comment #1) > Well, it was meant to be used by bug 978857, which would still be useful. Wrong bug number I assume.
Sorry, it was bug 506975.
Ok, let's package it using TESTING_JS_MODULES then.
navigator.battery was removed in bug 1259335. Battery.jsm was only a stub implementation to return fake values during tests, but the navigator.battery API itself is totally gone now. In this case, I think we can remove this file, right?
Hmm I got confused, navigator.battery was non-standard, but navigator.getBattery() is still available for privileged code
I still think that bug 506975 would be useful for our energy use.
(In reply to Florian Quèze [:florian] (PTO until Jan 2) from comment #4) > Ok, let's package it using TESTING_JS_MODULES then. Can we still do this? Can you maybe write up a brief description of how to do this and make this a mentored bug?
Battery.jsm is currently packaged at https://searchfox.org/mozilla-central/rev/ecf61f8f3904549f5d65a8a511dbd7ea4fd1a51d/toolkit/modules/moz.build#186 We should move this line to the TESTING_JS_MODULES section a few lines above. The url to import in the code will then become "resource://testing-common/Battery.jsm" instead of the current "resource://gre/modules/Battery.jsm" used at https://searchfox.org/mozilla-central/source/toolkit/modules/tests/browser/browser_Battery.js#5 After doing this change, the file will no longer be shipped as part of Firefox, so it'll no longer be reported as unreferenced, ie https://searchfox.org/mozilla-central/rev/ecf61f8f3904549f5d65a8a511dbd7ea4fd1a51d/browser/base/content/test/static/browser_all_files_referenced.js#147-148 should be removed.
Assignee: nobody → felipc
Status: NEW → ASSIGNED
Priority: -- → P5
Summary: Stop shipping resource://gre/modules/Battery.jsm → Remove resource://gre/modules/Battery.jsm
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/3607e50ad27a Remove unused Battery.jsm. r=Yoric
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/f79d064a028c Remove unused Battery.jsm. r=Yoric
You need to log in before you can comment on or make changes to this bug.