diff options
author | Matt A. Tobin <email@mattatobin.com> | 2018-06-26 16:09:08 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2018-06-26 16:09:08 -0400 |
commit | eda567b364a06e9e63efb865a6b1c73f1cb5232e (patch) | |
tree | 912ab15d877f733318e2c0394713bca33b830547 /toolkit/mozapps/extensions/test/browser/browser_bug590347.js | |
parent | 80eb356d57fc310cdf812cae63de30d6e56c1788 (diff) | |
download | UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar.gz UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar.lz UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar.xz UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.zip |
[AllAM] Remove Mozilla Tests
Diffstat (limited to 'toolkit/mozapps/extensions/test/browser/browser_bug590347.js')
-rw-r--r-- | toolkit/mozapps/extensions/test/browser/browser_bug590347.js | 120 |
1 files changed, 0 insertions, 120 deletions
diff --git a/toolkit/mozapps/extensions/test/browser/browser_bug590347.js b/toolkit/mozapps/extensions/test/browser/browser_bug590347.js deleted file mode 100644 index 8fe9c715e..000000000 --- a/toolkit/mozapps/extensions/test/browser/browser_bug590347.js +++ /dev/null @@ -1,120 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ - */ - -// Bug 590347 -// Tests if softblock notifications are exposed in preference to incompatible -// notifications when compatibility checking is disabled - -var gProvider; -var gManagerWindow; -var gCategoryUtilities; - -var gApp = document.getElementById("bundle_brand").getString("brandShortName"); -var gVersion = Services.appinfo.version; - -// Opens the details view of an add-on -function open_details(aId, aType, aCallback) { - requestLongerTimeout(2); - - gCategoryUtilities.openType(aType, function() { - var list = gManagerWindow.document.getElementById("addon-list"); - var item = list.firstChild; - while (item) { - if ("mAddon" in item && item.mAddon.id == aId) { - list.ensureElementIsVisible(item); - EventUtils.synthesizeMouseAtCenter(item, { clickCount: 1 }, gManagerWindow); - EventUtils.synthesizeMouseAtCenter(item, { clickCount: 2 }, gManagerWindow); - wait_for_view_load(gManagerWindow, aCallback); - return; - } - item = item.nextSibling; - } - ok(false, "Should have found the add-on in the list"); - }); -} - -function get_list_view_warning_node() { - let item = gManagerWindow.document.getElementById("addon-list").firstChild; - let found = false; - while (item) { - if (item.mAddon.name == "Test add-on") { - found = true; - break; - } - item = item.nextSibling; - } - ok(found, "Test add-on node should have been found."); - return item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "warning"); -} - -function get_detail_view_warning_node(aManagerWindow) { - if(aManagerWindow) - return aManagerWindow.document.getElementById("detail-warning"); -} - -function test() { - waitForExplicitFinish(); - - gProvider = new MockProvider(); - - gProvider.createAddons([{ - id: "addon1@tests.mozilla.org", - name: "Test add-on", - description: "A test add-on", - isCompatible: false, - blocklistState: Ci.nsIBlocklistService.STATE_SOFTBLOCKED, - }]); - - open_manager(null, function(aWindow) { - gManagerWindow = aWindow; - gCategoryUtilities = new CategoryUtilities(gManagerWindow); - run_next_test(); - }); -} - -function end_test() { - close_manager(gManagerWindow, function() { - finish(); - }); -} - -// Check with compatibility checking enabled -add_test(function() { - gCategoryUtilities.openType("extension", function() { - Services.prefs.setBoolPref(PREF_CHECK_COMPATIBILITY, true); - let warning_node = get_list_view_warning_node(); - is_element_visible(warning_node, "Warning message should be visible"); - is(warning_node.textContent, "Test add-on is incompatible with " + gApp + " " + gVersion + ".", "Warning message should be correct"); - run_next_test(); - }); -}); - -add_test(function() { - open_details("addon1@tests.mozilla.org", "extension", function() { - let warning_node = get_detail_view_warning_node(gManagerWindow); - is_element_visible(warning_node, "Warning message should be visible"); - is(warning_node.textContent, "Test add-on is incompatible with " + gApp + " " + gVersion + ".", "Warning message should be correct"); - Services.prefs.setBoolPref(PREF_CHECK_COMPATIBILITY, false); - run_next_test(); - }); -}); - -// Check with compatibility checking disabled -add_test(function() { - gCategoryUtilities.openType("extension", function() { - let warning_node = get_list_view_warning_node(); - is_element_visible(warning_node, "Warning message should be visible"); - is(warning_node.textContent, "Test add-on is known to cause security or stability issues.", "Warning message should be correct"); - run_next_test(); - }); -}); - -add_test(function() { - open_details("addon1@tests.mozilla.org", "extension", function() { - let warning_node = get_detail_view_warning_node(gManagerWindow); - is_element_visible(warning_node, "Warning message should be visible"); - is(warning_node.textContent, "Test add-on is known to cause security or stability issues.", "Warning message should be correct"); - run_next_test(); - }); -}); |