From b209b679debdf3b4cb853b2b32998e1c3cd9ab51 Mon Sep 17 00:00:00 2001 From: Eugen Sawin Date: Fri, 29 Apr 2016 15:43:51 +0200 Subject: [PATCH] Bug 1243431 - [5.2] Enable vibration permission for tests. r=bz --- .../mochitest/general/test_vibrator.html | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/dom/tests/mochitest/general/test_vibrator.html b/dom/tests/mochitest/general/test_vibrator.html index b9ee7d9543c9..2874c783bedf 100644 --- a/dom/tests/mochitest/general/test_vibrator.html +++ b/dom/tests/mochitest/general/test_vibrator.html @@ -73,14 +73,19 @@ function tests(aEnabled) { SimpleTest.finish(); } -// Test with the vibrator pref enabled. -SpecialPowers.pushPrefEnv({"set": [['dom.vibrator.enabled', true]]}, function() { - tests(true); - SpecialPowers.pushPrefEnv({"set": [['dom.vibrator.enabled', false]]}, tests(false)); -}); -// Everything should be the same when the vibrator is disabled -- in -// particular, a disabled vibrator shouldn't eat failures we'd otherwise -// observe. +SpecialPowers.pushPermissions([ + {type: 'vibration', allow: true, context: document} + ], function() { + // Test with the vibrator pref enabled. + SpecialPowers.pushPrefEnv({"set": [['dom.vibrator.enabled', true]]}, function() { + tests(true); + SpecialPowers.pushPrefEnv({"set": [['dom.vibrator.enabled', false]]}, tests(false)); + }); + // Everything should be the same when the vibrator is disabled -- in + // particular, a disabled vibrator shouldn't eat failures we'd otherwise + // observe. + } +);