зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1241252, part 1 - Use pushPrefEnv in test_bug61098.html. r=mrbkap
This commit is contained in:
Родитель
5ed098eee8
Коммит
0eaac2edd6
|
@ -217,28 +217,17 @@ function registerMockPromptService()
|
|||
mockPromptFactoryRegisterer.register();
|
||||
};
|
||||
|
||||
function enableDialogLoopBlocking()
|
||||
{
|
||||
var prefs = SpecialPowers.Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(SpecialPowers.Ci.nsIPrefBranch);
|
||||
|
||||
prefs.setIntPref("dom.successive_dialog_time_limit", 3);
|
||||
}
|
||||
|
||||
function resetDialogLoopBlocking()
|
||||
{
|
||||
var prefs = SpecialPowers.Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(SpecialPowers.Ci.nsIPrefBranch);
|
||||
|
||||
prefs.setIntPref("dom.successive_dialog_time_limit", 0);
|
||||
}
|
||||
|
||||
var expectedState;
|
||||
|
||||
function runtests()
|
||||
{
|
||||
SpecialPowers.pushPrefEnv({'set': [["dom.successive_dialog_time_limit", 3]]},
|
||||
runtestsInner);
|
||||
}
|
||||
|
||||
function runtestsInner()
|
||||
{
|
||||
registerMockPromptService();
|
||||
enableDialogLoopBlocking();
|
||||
|
||||
// Test that alert() works normally and then gets blocked on the
|
||||
// second call.
|
||||
|
@ -338,8 +327,6 @@ function runtests()
|
|||
|
||||
w.close();
|
||||
|
||||
resetDialogLoopBlocking();
|
||||
|
||||
mockPromptFactoryRegisterer.unregister();
|
||||
mockPromptServiceRegisterer.unregister();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче