diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-07-18 08:24:24 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-07-18 08:24:24 +0200 |
commit | fc61780b35af913801d72086456f493f63197da6 (patch) | |
tree | f85891288a7bd988da9f0f15ae64e5c63f00d493 /toolkit/mozapps/extensions/test/browser/browser_about.js | |
parent | 69f7f9e5f1475891ce11cc4f431692f965b0cd30 (diff) | |
parent | 50d3e596bbe89c95615f96eb71f6bc5be737a1db (diff) | |
download | UXP-fc61780b35af913801d72086456f493f63197da6.tar UXP-fc61780b35af913801d72086456f493f63197da6.tar.gz UXP-fc61780b35af913801d72086456f493f63197da6.tar.lz UXP-fc61780b35af913801d72086456f493f63197da6.tar.xz UXP-fc61780b35af913801d72086456f493f63197da6.zip |
Merge commit '50d3e596bbe89c95615f96eb71f6bc5be737a1db' into Basilisk-releasev2018.07.18
# Conflicts:
# browser/app/profile/firefox.js
# browser/components/preferences/jar.mn
Diffstat (limited to 'toolkit/mozapps/extensions/test/browser/browser_about.js')
-rw-r--r-- | toolkit/mozapps/extensions/test/browser/browser_about.js | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/toolkit/mozapps/extensions/test/browser/browser_about.js b/toolkit/mozapps/extensions/test/browser/browser_about.js deleted file mode 100644 index f781cf146..000000000 --- a/toolkit/mozapps/extensions/test/browser/browser_about.js +++ /dev/null @@ -1,84 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ - */ - -/** - * Tests the default and custom "about" dialogs of add-ons. - * - * Test for bug 610661 <https://bugzilla.mozilla.org/show_bug.cgi?id=610661>: - * Addon object not passed to custom about dialogs. - */ - -var gManagerWindow; - -const URI_ABOUT_DEFAULT = "chrome://mozapps/content/extensions/about.xul"; -const URI_ABOUT_CUSTOM = CHROMEROOT + "addon_about.xul"; - -function test() { - requestLongerTimeout(2); - - waitForExplicitFinish(); - - var gProvider = new MockProvider(); - gProvider.createAddons([{ - id: "test1@tests.mozilla.org", - name: "Test add-on 1", - description: "foo" - }, - { - id: "test2@tests.mozilla.org", - name: "Test add-on 2", - description: "bar", - aboutURL: URI_ABOUT_CUSTOM - }]); - - open_manager("addons://list/extension", function(aManager) { - gManagerWindow = aManager; - - test_about_window("Test add-on 1", URI_ABOUT_DEFAULT, function() { - test_about_window("Test add-on 2", URI_ABOUT_CUSTOM, function() { - close_manager(gManagerWindow, finish); - }); - }); - }); -} - -function test_about_window(aAddonItemName, aExpectedAboutUri, aCallback) { - var addonList = gManagerWindow.document.getElementById("addon-list"); - for (var addonItem of addonList.childNodes) { - if (addonItem.hasAttribute("name") && - addonItem.getAttribute("name") === aAddonItemName) - break; - } - - info("Waiting for about dialog"); - Services.ww.registerNotification(function TEST_ww_observer(aSubject, aTopic, - aData) { - if (aTopic == "domwindowclosed") { - Services.ww.unregisterNotification(TEST_ww_observer); - - info("About dialog closed, waiting for focus on browser window"); - waitForFocus(() => executeSoon(aCallback)); - } else if (aTopic == "domwindowopened") { - info("About dialog opened, waiting for focus"); - - let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget); - waitForFocus(function() { - info("Saw about dialog"); - - is(win.location, - aExpectedAboutUri, - "The correct add-on about window should have opened"); - - is(win.arguments && win.arguments[0] && win.arguments[0].name, - aAddonItemName, - "window.arguments[0] should refer to the add-on object"); - - executeSoon(() => win.close()); - }, win); - } - }); - - gManagerWindow.gViewController.doCommand("cmd_showItemAbout", - addonItem.mAddon); -} |