summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/extensions/test/browser/browser_bug562854.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2018-06-26 16:09:08 -0400
committerMatt A. Tobin <email@mattatobin.com>2018-06-26 16:09:08 -0400
commiteda567b364a06e9e63efb865a6b1c73f1cb5232e (patch)
tree912ab15d877f733318e2c0394713bca33b830547 /toolkit/mozapps/extensions/test/browser/browser_bug562854.js
parent80eb356d57fc310cdf812cae63de30d6e56c1788 (diff)
downloadUXP-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_bug562854.js')
-rw-r--r--toolkit/mozapps/extensions/test/browser/browser_bug562854.js129
1 files changed, 0 insertions, 129 deletions
diff --git a/toolkit/mozapps/extensions/test/browser/browser_bug562854.js b/toolkit/mozapps/extensions/test/browser/browser_bug562854.js
deleted file mode 100644
index 4c06cebb7..000000000
--- a/toolkit/mozapps/extensions/test/browser/browser_bug562854.js
+++ /dev/null
@@ -1,129 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/**
- * Tests that double-click does not go to detail view if the target is a link or button.
- */
-
-function test() {
- requestLongerTimeout(2);
-
- waitForExplicitFinish();
-
- var gProvider = new MockProvider();
- gProvider.createAddons([{
- id: "test1@tests.mozilla.org",
- name: "Test add-on 1",
- description: "foo",
- operationsRequiringRestart: AddonManager.OP_NEEDS_RESTART_NONE
- }]);
-
- run_next_test();
-}
-
-function end_test() {
- finish();
-}
-
-function is_in_list(aManager, view) {
- var doc = aManager.document;
-
- is(doc.getElementById("categories").selectedItem.value, view, "Should be on the right category");
- is(doc.getElementById("view-port").selectedPanel.id, "list-view", "Should be on the right view");
-}
-
-function is_in_detail(aManager, view) {
- var doc = aManager.document;
-
- is(doc.getElementById("categories").selectedItem.value, view, "Should be on the right category");
- is(doc.getElementById("view-port").selectedPanel.id, "detail-view", "Should be on the right view");
-}
-
-// Check that double-click does something.
-add_test(function() {
- open_manager("addons://list/extension", function(aManager) {
- info("Part 1");
- is_in_list(aManager, "addons://list/extension");
-
- var addon = get_addon_element(aManager, "test1@tests.mozilla.org");
- addon.parentNode.ensureElementIsVisible(addon);
- EventUtils.synthesizeMouseAtCenter(addon, { clickCount: 1 }, aManager);
- EventUtils.synthesizeMouseAtCenter(addon, { clickCount: 2 }, aManager);
-
- wait_for_view_load(aManager, function(aManager) {
- info("Part 2");
- is_in_detail(aManager, "addons://list/extension");
-
- close_manager(aManager, run_next_test);
- });
- });
-});
-
-// Check that double-click does nothing when over the disable button.
-add_test(function() {
- open_manager("addons://list/extension", function(aManager) {
- info("Part 1");
- is_in_list(aManager, "addons://list/extension");
-
- var addon = get_addon_element(aManager, "test1@tests.mozilla.org");
- addon.parentNode.ensureElementIsVisible(addon);
- EventUtils.synthesizeMouseAtCenter(
- aManager.document.getAnonymousElementByAttribute(addon, "anonid", "disable-btn"),
- { clickCount: 1 },
- aManager
- );
- // The disable button is replaced by the enable button when clicked on.
- EventUtils.synthesizeMouseAtCenter(
- aManager.document.getAnonymousElementByAttribute(addon, "anonid", "enable-btn"),
- { clickCount: 2 },
- aManager
- );
-
- wait_for_view_load(aManager, function(aManager) {
- info("Part 2");
- is_in_list(aManager, "addons://list/extension");
-
- close_manager(aManager, run_next_test);
- });
- });
-});
-
-// Check that double-click does nothing when over the undo button.
-add_test(function() {
- open_manager("addons://list/extension", function(aManager) {
- info("Part 1");
- is_in_list(aManager, "addons://list/extension");
-
- var addon = get_addon_element(aManager, "test1@tests.mozilla.org");
- addon.parentNode.ensureElementIsVisible(addon);
- EventUtils.synthesizeMouseAtCenter(
- aManager.document.getAnonymousElementByAttribute(addon, "anonid", "remove-btn"),
- { clickCount: 1 },
- aManager
- );
-
- // The undo button is removed when clicked on.
- // We need to wait for the UI to catch up.
- setTimeout(function() {
- var target = aManager.document.getAnonymousElementByAttribute(addon, "anonid", "undo-btn");
- var rect = target.getBoundingClientRect();
- var addonRect = addon.getBoundingClientRect();
-
- EventUtils.synthesizeMouse(target, rect.width / 2, rect.height / 2, { clickCount: 1 }, aManager);
- EventUtils.synthesizeMouse(addon,
- rect.left - addonRect.left + rect.width / 2,
- rect.top - addonRect.top + rect.height / 2,
- { clickCount: 2 },
- aManager
- );
-
- wait_for_view_load(aManager, function(aManager) {
- info("Part 2");
- is_in_list(aManager, "addons://list/extension");
-
- close_manager(aManager, run_next_test);
- });
- }, 0);
- });
-});