aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2014-10-26 21:55:22 +0000
committerStephen Blott2014-10-26 21:55:22 +0000
commit2e8ac9c4847d0088443b5d961c44096c293cd1c0 (patch)
treef6c5a075cee20002e922dae03f5eaab0434bc3b6
parentaa2b4eb5447e225179d0d2037f124bf94b4f1492 (diff)
downloadvimium-2e8ac9c4847d0088443b5d961c44096c293cd1c0.tar.bz2
Reduce max removeTab to chrome.session.MAX_SESSION_RESULTS.
-rw-r--r--background_scripts/commands.coffee4
-rw-r--r--tests/unit_tests/commands_test.coffee4
2 files changed, 7 insertions, 1 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee
index 4bb6255e..0ade35ec 100644
--- a/background_scripts/commands.coffee
+++ b/background_scripts/commands.coffee
@@ -318,7 +318,9 @@ commandDescriptions =
createTab: ["Create new tab", { background: true, repeatLimit: 20 }]
duplicateTab: ["Duplicate current tab", { background: true, repeatLimit: 20 }]
- removeTab: ["Close current tab", { background: true, repeatLimit: 50 }]
+ removeTab: ["Close current tab", { background: true, repeatLimit:
+ # Require confirmation to remove more tabs than we can restore.
+ (if chrome.session then chrome.session.MAX_SESSION_RESULTS else 25) }]
restoreTab: ["Restore closed tab", { background: true, repeatLimit: 20 }]
moveTabToNewWindow: ["Move tab to new window", { background: true }]
diff --git a/tests/unit_tests/commands_test.coffee b/tests/unit_tests/commands_test.coffee
index 7a1b43ab..a739884c 100644
--- a/tests/unit_tests/commands_test.coffee
+++ b/tests/unit_tests/commands_test.coffee
@@ -1,3 +1,7 @@
+root.chrome =
+ session:
+ MAX_SESSION_RESULTS: 25
+
require "./test_helper.js"
{Commands} = require "../../background_scripts/commands.js"