summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/extensions/test/xpcshell/test_bug514327_2.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2018-02-11 07:03:16 -0500
committerMatt A. Tobin <email@mattatobin.com>2018-02-11 07:03:16 -0500
commit203eb0f61a09372310a2a8fb57e169cb3f47800b (patch)
tree8490329d3dae4de3c7ffd127bce1f65fdc009abd /toolkit/mozapps/extensions/test/xpcshell/test_bug514327_2.js
parente45706ca3acbb6530419433212becc61d5953a2d (diff)
parent8f6d3dab81c7f8f97ef197e26ab9439b09735b8f (diff)
downloadUXP-ed96a7148c31f5448b81800287c09ce7169223cc.tar
UXP-ed96a7148c31f5448b81800287c09ce7169223cc.tar.gz
UXP-ed96a7148c31f5448b81800287c09ce7169223cc.tar.lz
UXP-ed96a7148c31f5448b81800287c09ce7169223cc.tar.xz
UXP-ed96a7148c31f5448b81800287c09ce7169223cc.zip
Merge branch 'ext-work'FF_Checkpoint_1
Diffstat (limited to 'toolkit/mozapps/extensions/test/xpcshell/test_bug514327_2.js')
-rw-r--r--toolkit/mozapps/extensions/test/xpcshell/test_bug514327_2.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_bug514327_2.js b/toolkit/mozapps/extensions/test/xpcshell/test_bug514327_2.js
new file mode 100644
index 000000000..a8c369f1b
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug514327_2.js
@@ -0,0 +1,42 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+const Cc = Components.classes;
+const Ci = Components.interfaces;
+
+const nsIBLS = Ci.nsIBlocklistService;
+
+// Finds the test nsIPluginTag
+function get_test_plugintag() {
+ var host = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
+ var tags = host.getPluginTags();
+ for (let tag of tags) {
+ if (tag.name == "Test Plug-in")
+ return tag;
+ }
+ return null;
+}
+
+function run_test() {
+ createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
+
+ copyBlocklistToProfile(do_get_file("data/test_bug514327_2.xml"));
+
+ var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].getService(nsIBLS);
+ var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
+
+ var plugin = get_test_plugintag();
+ if (!plugin)
+ do_throw("Plugin tag not found");
+
+ //run the code after the blocklist is closed
+ Services.obs.notifyObservers(null, "addon-blocklist-closed", null);
+ do_execute_soon(function() {
+ // should be marked as outdated by the blocklist
+ do_check_true(blocklist.getPluginBlocklistState(plugin, "1", "1.9") == nsIBLS.STATE_OUTDATED);
+
+ // should indicate that a warning should be shown
+ do_check_true(prefs.getBoolPref("plugins.update.notifyUser"));
+ });
+}