From 44241f31dbb49661a9c6639bd3384ca8e09d3c6e Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Fri, 14 Mar 2014 15:03:15 -0400 Subject: [PATCH] Bug 857427 - Fix more problems spotted by ttaubert --- .../content/test/general/browser_save_link-perwindowpb.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/browser/base/content/test/general/browser_save_link-perwindowpb.js b/browser/base/content/test/general/browser_save_link-perwindowpb.js index 8511ce26432..2fa68009b57 100644 --- a/browser/base/content/test/general/browser_save_link-perwindowpb.js +++ b/browser/base/content/test/general/browser_save_link-perwindowpb.js @@ -44,7 +44,7 @@ function triggerSave(aWindow, aCallback) { function contextMenuOpened(aWindow, event) { info("contextMenuOpened"); - event.currentTarget.removeEventListener("popupshown", contextMenuOpened, false); + aWindow.document.removeEventListener("popupshown", contextMenuOpened); // Create the folder the link will be saved into. var destDir = createTemporarySaveDirectory(); @@ -82,7 +82,7 @@ function triggerSave(aWindow, aCallback) { function onTransferComplete(aWindow, downloadSuccess, destDir) { ok(downloadSuccess, "Link should have been downloaded successfully"); - aWindow.gBrowser.removeCurrentTab(); + aWindow.close(); executeSoon(function() aCallback()); } @@ -92,7 +92,6 @@ function test() { info("Start the test"); waitForExplicitFinish(); - var windowsToClose = []; var gNumSet = 0; function testOnWindow(options, callback) { info("testOnWindow(" + options + ")"); @@ -119,9 +118,6 @@ function test() { info("Running the cleanup code"); mockTransferRegisterer.unregister(); MockFilePicker.cleanup(); - windowsToClose.forEach(function(win) { - win.close(); - }); Services.obs.removeObserver(observer, "http-on-modify-request"); Services.obs.removeObserver(observer, "http-on-examine-response"); info("Finished running the cleanup code");