Closed Bug 759989 Opened 9 years ago Closed 9 years ago
Add test to ensure device sensors are shutdown when listeners are removed
follow up from 742376 * Adds test to verify that device sensors are being shutdown. * Adds a new method to nsIDeviceSensors that exposes if a window has a listener. * Fixes bug in nsGlobalWindow::DisableDeviceSensor where we call through to RemoveWindowListener while there are still valid listeners
Attachment #628592 - Flags: review?(bugs)
Attachment #628592 - Flags: review?(bugs) → review-
> We really don't want new enablePrivilege() calls. There are 55 other calls in that directory. I do not see the harm in adding more. When enablePrivilege is actually removed, someone is going to have to fix up all of these in the manner that you prescribed. if you insist, where exactly should this test live? > Wouldn't it be better to have two separate methods. every window can have n listeners for every type. > Looks like the file doesn't use Mozilla coding style, so perhaps no need to fix these to use I'll fix it, but I should really just send you a patch which is just ws changes.
converting test to use SpecialPowers.
dropping GetWindowListenerCount() in favor of listenerCount. we do not need hasRegisteredType at this point.
backed out. :( https://hg.mozilla.org/integration/mozilla-inbound/rev/e27433b51442 some other listeners is in mochitest-1 that is hurting this.
Comment on attachment 629826 [details] [diff] [review] patch v.3 we need this or devices may not be shutdown after use. Does change a uuid of an interface this is used internally.
change the test so that we record the number of listeners at the beginning of the test run, and ensure at the end of the test run we equal that number.
https://hg.mozilla.org/mozilla-central/rev/a9024396eeb7 (Merged by Ed Morley)
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
Comment on attachment 629826 [details] [diff] [review] patch v.3 similar to bug 742376 and 759354. Without this, we will not shutdown listeners.
Comment on attachment 629826 [details] [diff] [review] patch v.3 [Triage Comment] The IDL change is only in nsIDeviceSensors.idl, which as I understand it is unused externally. Approved for Aurora 15.
Attachment #629826 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.