diff --git a/docshell/test/navigation/test_bug13871.html b/docshell/test/navigation/test_bug13871.html index 6e8534e2985..9ff0b9bb553 100644 --- a/docshell/test/navigation/test_bug13871.html +++ b/docshell/test/navigation/test_bug13871.html @@ -27,14 +27,10 @@ window.onload = function () { window3.close(); xpcCleanupWindows(); - SpecialPowers.setBoolPref("dom.block_multiple_popups", gBlockMultiplePopups); SimpleTest.finish(); }, 4); } -var gBlockMultiplePopups = SpecialPowers.getBoolPref("dom.block_multiple_popups"); -SpecialPowers.setBoolPref("dom.block_multiple_popups", false); - var window0 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/parent.html", "window0", "width=10,height=10"); var window1 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/parent.html", "window1", "width=10,height=10"); var window2 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/parent.html", "window2", "width=10,height=10"); diff --git a/docshell/test/navigation/test_bug270414.html b/docshell/test/navigation/test_bug270414.html index 81128095622..98dcf42f8df 100644 --- a/docshell/test/navigation/test_bug270414.html +++ b/docshell/test/navigation/test_bug270414.html @@ -9,9 +9,6 @@ iframe { width: 90%; height: 50px; } "); -} - -/** - * window.open followed by w.open with w being the first popup. - */ -function test2() -{ - prefs.setBoolPref("dom.block_multiple_popups", true); - - let gPopupsCount = 0; - - gBrowser.selectedTab.linkedBrowser.addEventListener("load", function () { - gBrowser.selectedTab.linkedBrowser.removeEventListener("load", arguments.callee, true); - - ww.registerNotification(function(aSubject, aTopic, aData) { - if (aTopic != "domwindowopened") { - return; - } - - gPopupsCount++; - - if (gPopupsCount > 1) { - return; - } - - executeSoon(function() { - executeSoon(function() { - executeSoon(function() { - executeSoon(function() { - ww.unregisterNotification(arguments.callee); - - is(gPopupsCount, 1, "Only one popup appeared"); - cleanUp(); - nextOrFinish(); - }); - }); - }); - }); - }); - - waitForFocus(function() { - var button = gBrowser.selectedTab.linkedBrowser.contentDocument.getElementsByTagName('button')[0]; - EventUtils.synthesizeMouseAtCenter(button, {}, gBrowser.selectedTab.linkedBrowser.contentWindow); - }); - }, true); - - gBrowser.selectedTab.linkedBrowser.loadURI("data:text/html,"); -} - -/** - * window.open followed by w.open with w being the first popup and the second popup being actually a tab. - */ -function test3() -{ - prefs.setBoolPref("dom.block_multiple_popups", true); - - let gPopupsCount = 0; - - gBrowser.selectedTab.linkedBrowser.addEventListener("load", function () { - gBrowser.selectedTab.linkedBrowser.removeEventListener("load", arguments.callee, true); - - ww.registerNotification(function(aSubject, aTopic, aData) { - if (aTopic != "domwindowopened") { - return; - } - - gPopupsCount++; - - if (gPopupsCount > 1) { - return; - } - - executeSoon(function() { - executeSoon(function() { - executeSoon(function() { - executeSoon(function() { - ww.unregisterNotification(arguments.callee); - - is(gPopupsCount, 1, "Only one popup appeared"); - cleanUp(); - nextOrFinish(); - }); - }); - }); - }); - }); - - waitForFocus(function() { - var button = gBrowser.selectedTab.linkedBrowser.contentDocument.getElementsByTagName('button')[0]; - EventUtils.synthesizeMouseAtCenter(button, {}, gBrowser.selectedTab.linkedBrowser.contentWindow); - }); - }, true); - - gBrowser.selectedTab.linkedBrowser.loadURI("data:text/html,"); -} - -/** - * window.open and .click() on the element opening the window. - */ -function test4() -{ - prefs.setBoolPref("dom.block_multiple_popups", true); - - gBrowser.selectedTab.linkedBrowser.addEventListener("load", function () { - gBrowser.selectedTab.linkedBrowser.removeEventListener("load", arguments.callee, true); - - gBrowser.addEventListener("DOMPopupBlocked", function() { - gBrowser.removeEventListener("DOMPopupBlocked", arguments.callee, true); - - ok(true, "The popup has been blocked"); - - cleanUp(); - nextOrFinish(); - }, true); - - waitForFocus(function() { - var button = gBrowser.selectedTab.linkedBrowser.contentDocument.getElementsByTagName('button')[0]; - EventUtils.synthesizeMouseAtCenter(button, {}, gBrowser.selectedTab.linkedBrowser.contentWindow); - }); - }, true); - - gBrowser.selectedTab.linkedBrowser.loadURI("data:text/html,"); -} - -/** - * Two window.open from the chrome. - */ -function test5() -{ - prefs.setBoolPref("dom.block_multiple_popups", true); - - let gPopupsCount = 0; - - ww.registerNotification(function(aSubject, aTopic, aData) { - if (aTopic != "domwindowopened") { - return; - } - - gPopupsCount++; - - if (gPopupsCount != 2) { - return; - } - - executeSoon(function() { - executeSoon(function() { - executeSoon(function() { - executeSoon(function() { - ww.unregisterNotification(arguments.callee); - - is(gPopupsCount, 2, "Both window appeared"); - cleanUp(); - nextOrFinish(); - }); - }); - }); - }); - }); - - window.open("data:text/html,foo", '', 'foo'); - window.open("data:text/html,foo", '', 'foo'); -} - -/** - * Two window.open with the pref being disabled. - */ -function test6() -{ - prefs.setBoolPref("dom.block_multiple_popups", false); - - let gPopupsCount = 0; - - gBrowser.selectedTab.linkedBrowser.addEventListener("load", function () { - gBrowser.selectedTab.linkedBrowser.removeEventListener("load", arguments.callee, true); - - ww.registerNotification(function(aSubject, aTopic, aData) { - if (aTopic != "domwindowopened") { - return; - } - - gPopupsCount++; - - if (gPopupsCount != 2) { - return; - } - - executeSoon(function() { - executeSoon(function() { - executeSoon(function() { - executeSoon(function() { - ww.unregisterNotification(arguments.callee); - - is(gPopupsCount, 2, "Both window appeared"); - cleanUp(); - nextOrFinish(); - }); - }); - }); - }); - }); - - waitForFocus(function() { - var button = gBrowser.selectedTab.linkedBrowser.contentDocument.getElementsByTagName('button')[0]; - EventUtils.synthesizeMouseAtCenter(button, {}, gBrowser.selectedTab.linkedBrowser.contentWindow); - }); - }, true); - - gBrowser.selectedTab.linkedBrowser.loadURI("data:text/html,"); -} diff --git a/dom/tests/mochitest/bugs/test_bug346659.html b/dom/tests/mochitest/bugs/test_bug346659.html index 612bc11fdcb..d8ff23e76a9 100644 --- a/dom/tests/mochitest/bugs/test_bug346659.html +++ b/dom/tests/mochitest/bugs/test_bug346659.html @@ -28,9 +28,6 @@ SimpleTest.waitForExplicitFinish(); var wins = []; -var gBlockMultiplePopups = SpecialPowers.getBoolPref("dom.block_multiple_popups"); -SpecialPowers.setBoolPref("dom.block_multiple_popups", false); - function r(base, tail) { return base.replace(/\/[^\/]*$/, "/" + tail); } @@ -156,7 +153,6 @@ function handleTestEnd() { setTimeout(startThirdBatch, 0); } } else if (!--numTestsSet3) { - SpecialPowers.setBoolPref("dom.block_multiple_popups", gBlockMultiplePopups); SimpleTest.finish(); } } diff --git a/dom/tests/mochitest/bugs/test_bug406375.html b/dom/tests/mochitest/bugs/test_bug406375.html index 0ee13c08147..cfade43c57a 100644 --- a/dom/tests/mochitest/bugs/test_bug406375.html +++ b/dom/tests/mochitest/bugs/test_bug406375.html @@ -23,13 +23,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=406375 SimpleTest.waitForExplicitFinish(); function runTest() { - var blockMultiplePopups = SpecialPowers.getBoolPref("dom.block_multiple_popups"); - SpecialPowers.setBoolPref("dom.block_multiple_popups", false); - window.showModalDialog("file_bug406375.html"); ok(true, "This test should not hang"); - - SpecialPowers.setBoolPref("dom.block_multiple_popups", blockMultiplePopups); SimpleTest.finish(); } diff --git a/dom/tests/mochitest/bugs/test_bug61098.html b/dom/tests/mochitest/bugs/test_bug61098.html index bdcd7b0d907..b1c3952880c 100644 --- a/dom/tests/mochitest/bugs/test_bug61098.html +++ b/dom/tests/mochitest/bugs/test_bug61098.html @@ -242,9 +242,6 @@ var expectedState; function runtests() { - var blockMultiplePopups = SpecialPowers.getBoolPref("dom.block_multiple_popups"); - SpecialPowers.setBoolPref("dom.block_multiple_popups", false); - registerMockPromptService(); enableDialogLoopBlocking(); @@ -351,8 +348,6 @@ function runtests() mockPromptFactoryRegisterer.unregister(); mockPromptServiceRegisterer.unregister(); - SpecialPowers.setBoolPref("dom.block_multiple_popups", blockMultiplePopups); - SimpleTest.finish(); } diff --git a/dom/tests/mochitest/chrome/test_popup_blocker_chrome.xul b/dom/tests/mochitest/chrome/test_popup_blocker_chrome.xul index 00c553efceb..d2e42165126 100644 --- a/dom/tests/mochitest/chrome/test_popup_blocker_chrome.xul +++ b/dom/tests/mochitest/chrome/test_popup_blocker_chrome.xul @@ -4,7 +4,7 @@ - @@ -12,9 +12,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=662519 Mozilla Bug 662519 - Mozilla Bug 675574 - @@ -23,93 +20,35 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=662519 /** Test for Bug 662519 **/ - let Cc = Components.classes; - let Ci = Components.interfaces; - SimpleTest.waitForExplicitFinish(); // We have to enable dom.disable_open_during_load which is disabled // by the test harness. - let prefs = Cc["@mozilla.org/preferences-service;1"] - .getService(Ci.nsIPrefBranch); - let gLastDomLoadValue = prefs.getBoolPref("dom.disable_open_during_load"); - let gMultiplePopupsPref = prefs.getBoolPref("dom.block_multiple_popups"); - + let prefs = Components.classes["@mozilla.org/preferences-service;1"] + .getService(Components.interfaces.nsIPrefBranch); + var gLastDomLoadValue = prefs.getBoolPref("dom.disable_open_during_load"); prefs.setBoolPref("dom.disable_open_during_load", true); - prefs.setBoolPref("dom.block_multiple_popups", true); - function test1() { - let w = window.open("data:text/html,foobar", "", "width=200,height=200"); - ok(w, "The window object shouldn't be null"); + let w = window.open("data:text/html,foobar", "", "width=200,height=200"); + ok(w, "The window object shouldn't be null"); + + SimpleTest.waitForFocus(function() { + w.close(); + ok(true, "The popup appeared"); SimpleTest.waitForFocus(function() { - w.close(); - ok(true, "The popup appeared"); + let w = window.open("data:text/html,foobar", "", "width=200,height=200"); + ok(w, "The window object shouldn't be null"); SimpleTest.waitForFocus(function() { - let w = window.open("data:text/html,foobar", "", "width=200,height=200"); - ok(w, "The window object shouldn't be null"); + w.close(); - SimpleTest.waitForFocus(function() { - w.close(); - - ok(true, "The popup appeared"); - test2(); - }, w, false); - }); - }, w, false); - } - - function test2() { - let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"] - .getService(Ci.nsIWindowWatcher); - - let gPopupsCount = 0; - - ww.registerNotification(function(aSubject, aTopic, aData) { - if (aTopic != "domwindowopened") { - return; - } - - gPopupsCount++; - - if (gPopupsCount != 2) { - return; - } - - SimpleTest.executeSoon(function() { - SimpleTest.executeSoon(function() { - SimpleTest.executeSoon(function() { - SimpleTest.executeSoon(function() { - ww.unregisterNotification(arguments.callee); - - is(gPopupsCount, 2, "Both window appeared"); - - // Clean-up and finish. - let windowEnumerator = wm.getEnumerator(null); - - while (windowEnumerator.hasMoreElements()) { - let win = windowEnumerator.getNext(); - - // Close all windows except ourself. - if (win != window && !win.closed) { - win.close(); - } - } - - prefs.setBoolPref("dom.block_multiple_popups", gMultiplePopupsPref); + ok(true, "The popup appeared"); prefs.setBoolPref("dom.disable_open_during_load", gLastDomLoadValue); SimpleTest.finish(); - }); - }); - }); - }); + }, w, false); }); - - EventUtils.synthesizeMouseAtCenter(document.getElementsByTagName('button')[0], {}); - } - - SimpleTest.waitForFocus(test1); + }, w, false); ]]> diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index b60882ac65c..213b1393b28 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -562,8 +562,6 @@ pref("capability.policy.default.Clipboard.cutcopy", "noAccess"); pref("capability.policy.default.Clipboard.paste", "noAccess"); // Scripts & Windows prefs -pref("dom.block_multiple_popups", true); - pref("dom.disable_image_src_set", false); pref("dom.disable_window_flip", false); pref("dom.disable_window_move_resize", false); diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/mixedContentTest.js b/security/manager/ssl/tests/mochitest/mixedcontent/mixedContentTest.js index 914b9f76757..1dead1c345f 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/mixedContentTest.js +++ b/security/manager/ssl/tests/mochitest/mixedcontent/mixedContentTest.js @@ -24,8 +24,6 @@ var testPage = ""; // Assign a function to this variable to have a clean up at the end var testCleanUp = null; -// Backup the dom.block_multiple_popups pref value to re-set it on finish. -var blockMultiplePopupsPref; // Internal variables var _windowCount = 0; @@ -69,8 +67,6 @@ window.onload = function onLoad() if (openTwoWindows) { _windowCount = 2; - blockMultiplePopupsPref = SpecialPowers.getBoolPref("dom.block_multiple_popups"); - SpecialPowers.setBoolPref("dom.block_multiple_popups", false); window.open(secureTestLocation, "_new1", ""); window.open(secureTestLocation, "_new2", ""); } @@ -92,10 +88,7 @@ function onMessageReceived(event) { if (testCleanUp) testCleanUp(); - - if (openTwoWindows) { - SpecialPowers.setBoolPref("dom.block_multiple_popups", blockMultiplePopupsPref); - } + SimpleTest.finish(); } break; diff --git a/toolkit/mozapps/extensions/test/xpinstall/browser_bug638292.js b/toolkit/mozapps/extensions/test/xpinstall/browser_bug638292.js index e4ebb3520c6..001434b967c 100644 --- a/toolkit/mozapps/extensions/test/xpinstall/browser_bug638292.js +++ b/toolkit/mozapps/extensions/test/xpinstall/browser_bug638292.js @@ -1,16 +1,8 @@ // ---------------------------------------------------------------------------- // Test whether an InstallTrigger.enabled is working - -let prefs = Cc["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefBranch); -let gMultiplePopupsPref; - function test() { waitForExplicitFinish(); - gMultiplePopupsPref = prefs.getBoolPref("dom.block_multiple_popups"); - prefs.setBoolPref("dom.block_multiple_popups", false); - gBrowser.selectedTab = gBrowser.addTab(); gBrowser.selectedBrowser.addEventListener("load", function() { gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true); @@ -54,7 +46,6 @@ function page_loaded() { check_load(function() { gBrowser.removeCurrentTab(); - prefs.setBoolPref("dom.block_multiple_popups", gMultiplePopupsPref); finish(); }); });