Permalink
Browse files

Fail certified apps that are listed (bug 826889)

  • Loading branch information...
1 parent 31b3caf commit 7ce68f9f3004f1bce8b2375eade83660d287aff6 @mattbasta committed Jan 7, 2013
@@ -4,6 +4,19 @@
class ErrorBundle(MetadataMixin, ManifestMixin, BaseErrorBundle):
+ """This class does all sorts of cool things. It gets passed around
+ from test to test and collects up all the errors like the candy man
+ 'separating the sorrow and collecting up all the cream.' It's
+ borderline magical.
+
+ Keyword Arguments:
+
+ **listed**
+ True if the add-on is destined for Mozilla, false if not
+ **spidermonkey**
+ Optional path to the local spidermonkey installation
+
+ """
def __init__(self, listed=True, spidermonkey=None, *args, **kwargs):
super(ErrorBundle, self).__init__(*args, **kwargs)
@@ -10,21 +10,13 @@
class BaseErrorBundle(object):
- """This class does all sorts of cool things. It gets passed around
- from test to test and collects up all the errors like the candy man
- 'separating the sorrow and collecting up all the cream.' It's
- borderline magical.
-
- Keyword Arguments:
+ """Keyword Arguments:
**determined**
Whether the validator should continue after a tier fails
- **listed**
- True if the add-on is destined for AMO, false if not
**instant**
Who knows what this does
- **spidermonkey**
- Optional path to the local spidermonkey installation
+
"""
def __init__(self, determined=True, instant=False, *args, **kwargs):
@@ -360,6 +360,14 @@ def process_type(self, node):
"Found value: '%s'" % node,
self.MORE_INFO])
+ if self.err.get_resource("listed") and node == "certified":
+ self.err.error(
+ err_id=("spec", "webapp", "type_denied"),
+ error="Certified apps cannot be listed on the Marketplace.",
+ description=["Apps marked as `certified` cannot be listed on "
+ "the Firefox Marketplace.",
+ self.MORE_INFO])
+
def process_act_href(self, node):
if not self._path_valid(node, can_be_absolute=True,
can_be_relative=True):
View
@@ -93,7 +93,8 @@ def setUp(self):
"touch", "geolocation", "webgl"
],
"orientation": "landscape",
- "fullscreen": "true"
+ "fullscreen": "true",
+ "type": "privileged",
}
def analyze(self):
@@ -536,6 +537,13 @@ def wrap(self, value):
for key in ("web", "privileged", "certified", ):
yield wrap, self, key
+ def test_type_not_certified(self):
+ """Test that certified apps cannot be listed in the marketplace."""
+ self.listed = True
+ self.data["type"] = "certified"
+ self.analyze()
+ self.assert_failed(with_errors=True)
+
def test_act_base(self):
"""Test that the most basic web activity passes."""

0 comments on commit 7ce68f9

Please sign in to comment.