mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 04:58:00 +00:00
Bug 963366 - Re-enable basic power & wakelock tests for desktop. r=jmaher
This commit is contained in:
parent
804bb1a165
commit
14bd4f69ec
@ -4,8 +4,7 @@
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
|
||||
TEST_DIRS += ['test']
|
||||
TEST_DIRS += ['test']
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIDOMWakeLockListener.idl',
|
||||
|
@ -6,5 +6,8 @@
|
||||
run-if = appname != "b2g"
|
||||
[test_power_basics.html]
|
||||
[test_power_set_cpusleepallowed.html]
|
||||
skip-if = toolkit != "gonk"
|
||||
[test_power_set_screen_brightness.html]
|
||||
skip-if = toolkit != "gonk"
|
||||
[test_power_set_screen_enabled.html]
|
||||
skip-if = toolkit != "gonk"
|
||||
|
@ -8,8 +8,6 @@
|
||||
|
||||
/** Test for Power API **/
|
||||
|
||||
ok('mozPower' in navigator, "navigator.mozPower should exist");
|
||||
|
||||
/** Test permission **/
|
||||
// In b2g, addPermission 'power' is only working after a document reload
|
||||
// See bug 802312
|
||||
@ -17,6 +15,12 @@ ok('mozPower' in navigator, "navigator.mozPower should exist");
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function startTest() {
|
||||
SpecialPowers.pushPermissions([
|
||||
{type: "power", allow: true, context: window.frames[0].document}
|
||||
], doTest1);
|
||||
}
|
||||
|
||||
function doTest1() {
|
||||
window.frames[0].frameElement.setAttribute('onload', 'doTest2()');
|
||||
power = window.frames[0].navigator.mozPower;
|
||||
ok(power, "Should be able to access power manager with permission.");
|
||||
|
Loading…
x
Reference in New Issue
Block a user