mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
backout 4fb9e70a38b2 (bug 841350) for causing bug 847070
This commit is contained in:
parent
c92ed777f4
commit
9b831fc343
@ -202,10 +202,6 @@ XPCOMUtils.defineLazyGetter(this, "PageMenu", function() {
|
||||
* one listener that calls all real handlers.
|
||||
*/
|
||||
function pageShowEventHandlers(event) {
|
||||
// Filter out events that are not about the document load we are interested in
|
||||
if (event.target != content.document)
|
||||
return;
|
||||
|
||||
charsetLoadListener();
|
||||
XULBrowserWindow.asyncUpdateUI();
|
||||
|
||||
@ -1342,15 +1338,6 @@ var gBrowserInit = {
|
||||
|
||||
var isLoadingBlank = isBlankPageURL(uriToLoad);
|
||||
|
||||
gBrowser.addEventListener("pageshow", function(event) {
|
||||
// The XULWindow::mPrimaryContentShell isn't up-to-date when pageshow
|
||||
// is fired by a swapFrameLoaders() call (i.e. when we swap the docShells
|
||||
// of two tabs). Get around this by using setTimeout - everything should
|
||||
// be in the right state on the next tick.
|
||||
if (content)
|
||||
setTimeout(pageShowEventHandlers, 0, event);
|
||||
}, true);
|
||||
|
||||
if (uriToLoad && uriToLoad != "about:blank") {
|
||||
if (uriToLoad instanceof Ci.nsISupportsArray) {
|
||||
let count = uriToLoad.Count();
|
||||
@ -1409,6 +1396,12 @@ var gBrowserInit = {
|
||||
AddonManager.addAddonListener(AddonsMgrListener);
|
||||
WebrtcIndicator.init();
|
||||
|
||||
gBrowser.addEventListener("pageshow", function(event) {
|
||||
// Filter out events that are not about the document load we are interested in
|
||||
if (content && event.target == content.document)
|
||||
setTimeout(pageShowEventHandlers, 0, event);
|
||||
}, true);
|
||||
|
||||
// Ensure login manager is up and running.
|
||||
Services.logins;
|
||||
|
||||
|
@ -184,7 +184,6 @@ _BROWSER_FILES = \
|
||||
browser_pluginnotification.js \
|
||||
browser_plugins_added_dynamically.js \
|
||||
browser_CTPScriptPlugin.js \
|
||||
browser_CTP_drag_drop.js \
|
||||
browser_pluginplaypreview.js \
|
||||
browser_pluginplaypreview2.js \
|
||||
browser_private_browsing_window.js \
|
||||
|
@ -1,53 +0,0 @@
|
||||
let gHttpTestRoot = getRootDirectory(gTestPath).replace("chrome://mochitests/content/", "http://127.0.0.1:8888/");
|
||||
|
||||
let gNextTest = null;
|
||||
let gNewWindow = null;
|
||||
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
registerCleanupFunction(function() { Services.prefs.clearUserPref("plugins.click_to_play"); });
|
||||
Services.prefs.setBoolPref("plugins.click_to_play", true);
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("PluginBindingAttached", handleEvent, true, true);
|
||||
gNextTest = part1;
|
||||
gBrowser.selectedBrowser.contentDocument.location = gHttpTestRoot + "plugin_test.html";
|
||||
}
|
||||
|
||||
function handleEvent() {
|
||||
gNextTest();
|
||||
}
|
||||
|
||||
function part1() {
|
||||
gBrowser.selectedBrowser.removeEventListener("PluginBindingAttached", handleEvent);
|
||||
ok(PopupNotifications.getNotification("click-to-play-plugins", gBrowser.selectedBrowser), "Should have a click-to-play notification in the initial tab");
|
||||
|
||||
gNextTest = part2;
|
||||
gNewWindow = gBrowser.replaceTabWithWindow(gBrowser.selectedTab);
|
||||
gNewWindow.addEventListener("load", handleEvent, true);
|
||||
}
|
||||
|
||||
function part2() {
|
||||
gNewWindow.removeEventListener("load", handleEvent);
|
||||
let condition = function() PopupNotifications.getNotification("click-to-play-plugins", gNewWindow.gBrowser.selectedBrowser);
|
||||
waitForCondition(condition, part3, "Waited too long for click-to-play notification");
|
||||
}
|
||||
|
||||
function part3() {
|
||||
ok(PopupNotifications.getNotification("click-to-play-plugins", gNewWindow.gBrowser.selectedBrowser), "Should have a click-to-play notification in the tab in the new window");
|
||||
ok(!PopupNotifications.getNotification("click-to-play-plugins", gBrowser.selectedBrowser), "Should not have a click-to-play notification in the old window now");
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.swapBrowsersAndCloseOther(gBrowser.selectedTab, gNewWindow.gBrowser.selectedTab);
|
||||
let condition = function() PopupNotifications.getNotification("click-to-play-plugins", gBrowser.selectedBrowser);
|
||||
waitForCondition(condition, part4, "Waited too long for click-to-play notification");
|
||||
}
|
||||
|
||||
function part4() {
|
||||
ok(PopupNotifications.getNotification("click-to-play-plugins", gBrowser.selectedBrowser), "Should have a click-to-play notification in the initial tab again");
|
||||
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
}
|
Loading…
Reference in New Issue
Block a user