зеркало из 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();
|
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;
|
var expectedState;
|
||||||
|
|
||||||
function runtests()
|
function runtests()
|
||||||
|
{
|
||||||
|
SpecialPowers.pushPrefEnv({'set': [["dom.successive_dialog_time_limit", 3]]},
|
||||||
|
runtestsInner);
|
||||||
|
}
|
||||||
|
|
||||||
|
function runtestsInner()
|
||||||
{
|
{
|
||||||
registerMockPromptService();
|
registerMockPromptService();
|
||||||
enableDialogLoopBlocking();
|
|
||||||
|
|
||||||
// Test that alert() works normally and then gets blocked on the
|
// Test that alert() works normally and then gets blocked on the
|
||||||
// second call.
|
// second call.
|
||||||
|
@ -338,8 +327,6 @@ function runtests()
|
||||||
|
|
||||||
w.close();
|
w.close();
|
||||||
|
|
||||||
resetDialogLoopBlocking();
|
|
||||||
|
|
||||||
mockPromptFactoryRegisterer.unregister();
|
mockPromptFactoryRegisterer.unregister();
|
||||||
mockPromptServiceRegisterer.unregister();
|
mockPromptServiceRegisterer.unregister();
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче