Created attachment 628592 [details] [diff] [review] patch v.1 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
> 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.
Created attachment 629811 [details] [diff] [review] patch v.2 converting test to use SpecialPowers.
Created attachment 629826 [details] [diff] [review] patch v.3 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)
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.