From acae1440a6dcff4bf72e13da3695c8ec7e6f947a Mon Sep 17 00:00:00 2001 From: Margaret Leibovic Date: Mon, 6 Jun 2011 08:15:13 -0700 Subject: [PATCH] tests for Bug 661819 - Values for All Sites in about:permissions displays last selected site's values. r=gavin --- .../preferences/tests/browser_permissions.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/browser/components/preferences/tests/browser_permissions.js b/browser/components/preferences/tests/browser_permissions.js index 05ffa8b4e016..f9665aadf0de 100644 --- a/browser/components/preferences/tests/browser_permissions.js +++ b/browser/components/preferences/tests/browser_permissions.js @@ -25,6 +25,11 @@ const TEST_PERMS = { "popup": PERM_DENY }; +const NO_GLOBAL_ALLOW = [ + "geo", + "indexedDB" +]; + // number of managed permissions in the interface const TEST_PERMS_COUNT = 5; @@ -143,6 +148,12 @@ var tests = [ ok(gBrowser.contentDocument.getElementById("cookies-count").hidden, "cookies count is hidden"); + // Test to make sure "Allow" items hidden for certain permission types + NO_GLOBAL_ALLOW.forEach(function(aType) { + let menuitem = gBrowser.contentDocument.getElementById(aType + "-" + PERM_ALLOW); + ok(menuitem.hidden, aType + " allow menuitem hidden for all sites"); + }); + runNextTest(); }, @@ -195,6 +206,12 @@ var tests = [ ok(!gBrowser.contentDocument.getElementById("cookies-count").hidden, "cookies count is not hidden"); + // Test to make sure "Allow" items are *not* hidden for certain permission types + NO_GLOBAL_ALLOW.forEach(function(aType) { + let menuitem = gBrowser.contentDocument.getElementById(aType + "-" + PERM_ALLOW); + ok(!menuitem.hidden, aType + " allow menuitem not hidden for single site"); + }); + runNextTest(); },