Skip to content
Browse files

Added compatibility tests for Thunderbird 18 (Bug 850029)

  • Loading branch information...
1 parent 318b2fb commit 551b4f9017c827078050e9c63929330045e7084d @wagnerand wagnerand committed Apr 20, 2013
View
23 tests/compat/test_tb18.py
@@ -0,0 +1,23 @@
+from helper import CompatTestCase
+from validator.compat import TB18_DEFINITION
+
+
+class TestTB18Compat(CompatTestCase):
+ """Test that compatibility tests for Thunderbird 18 are properly executed."""
+
+ VERSION = TB18_DEFINITION
+
+ def test_js_patterns(self):
+ """Test that these js patterns are flagged in Thunderbird 18."""
+ def test_pattern(self, pattern):
+ self.setUp()
+ self.run_regex_for_compat("var x = %s();" % pattern)
+ self.assert_compat_error(type_="notice")
+
+ yield test_pattern, self, "queryISupportsArray"
+
+ def test_prplIAccount_noNewlines(self):
+ for method in self.run_xpcom_for_compat(
+ "prplIAccount", ["noNewlines"]):
+ self.assert_silent()
+ self.assert_compat_error(type_="notice")
View
2 validator/compat.py
@@ -63,3 +63,5 @@ def _build_definition(maj_version_num, firefox=True, fennec=True,
TB18_DEFINITION = _build_definition(18, firefox=False, fennec=False)
TB19_DEFINITION = _build_definition(19, firefox=False, fennec=False)
TB20_DEFINITION = _build_definition(20, firefox=False, fennec=False)
+TB21_DEFINITION = _build_definition(21, firefox=False, fennec=False)
+TB22_DEFINITION = _build_definition(22, firefox=False, fennec=False)
View
19 validator/testcases/javascript/entity_values.py
@@ -3,7 +3,7 @@
from validator.compat import (FX10_DEFINITION, FX14_DEFINITION,
FX16_DEFINITION, FX19_DEFINITION,
TB14_DEFINITION, TB15_DEFINITION,
- TB16_DEFINITION)
+ TB16_DEFINITION, TB18_DEFINITION)
from validator.constants import BUGZILLA_BUG
@@ -333,3 +333,20 @@ def nsIImportMail_ImportMailbox(traverser):
message="This attribute has been changed from `nsILocalFile` to "
"`nsIFile`",
bug=749930)
+
+# Thunderbird 18 IDL changes
+@register_entity("prplIAccount.noNewlines")
+def prplIAccount_noNewlines(traverser):
+ traverser.err.notice(
+ err_id=("testcases_javascript_entity_values",
+ "prplIAccount_noNewlines"),
+ notice="Altered `prplIAccount.noNewlines` method in use.",
+ description="This add-on uses the `prplIAccount.noNewlines` property "
+ "which has been removed in `%s`." % BUGZILLA_BUG % 799068,
+ filename=traverser.filename,
+ line=traverser.line,
+ column=traverser.position,
+ context=traverser.context,
+ for_appversions=TB18_DEFINITION,
+ compatibility_type="error",
+ tier=5)
View
3 validator/testcases/javascript/predefinedentities.py
@@ -347,6 +347,9 @@
{u"saveURI":
{"return":
call_definitions.webbrowserpersist_saveuri}}},
+ u"prplIAccount":
+ {"value":
+ {u"noNewlines": entity("prplIAccount.noNewlines")}}
}
INTERFACE_ENTITIES = {u"nsIXMLHttpRequest":
View
53 validator/testcases/regex.py
@@ -10,7 +10,7 @@
FX20_DEFINITION, TB7_DEFINITION, TB10_DEFINITION,
TB11_DEFINITION, TB12_DEFINITION, TB13_DEFINITION,
TB14_DEFINITION, TB15_DEFINITION, TB16_DEFINITION,
- TB17_DEFINITION)
+ TB17_DEFINITION, TB18_DEFINITION)
from validator.contextgenerator import ContextGenerator
from markup.csstester import UNPREFIXED_MESSAGE
@@ -1277,3 +1277,54 @@ def tests(self):
"been flagged as having changed, removed, or deprecated "
"in Thunderbird 17." % pattern,
compat_type="error", log_function=self.err.notice)
+
+@register_generator
+class Thunderbird18RegexTests(CompatRegexTestHelper):
+ """Regex tests for the Thunderbird 18 update."""
+
+ VERSION = TB18_DEFINITION
+
+ def tests(self):
+ """String and JS changes for Thunderbird add-ons"""
+
+ # String changes for add-ons that use our localizations.
+ patterns = {r"fullZoomEnlargeCmd\.label": 738194,
+ r"fullZoomReduceCmd\.label": 738194,
+ r"fullZoomResetCmd\.label": 738194,
+ r"fullZoomToggleCmd\.label": 738194,
+ r"identitiesListDesc\.label": 314806,
+ r"connection\.error\.certError": 792046,
+ r"command\.wallops": 799068,
+ r"searchTermsInvalidMessage": 561762,
+ r"alreadyDefaultClientTitle": 595723,
+ r"alreadyDefault": 595723,
+ r"directoryUsedByOtherAccount": 577775}
+ for pattern, bug in patterns.items():
+ yield self.get_test_bug(
+ bug, pattern,
+ "Removed, renamed, or changed labels in use.",
+ "Some string matched the pattern `%s`, which has been "
+ "flagged as having changed in Thunderbird 18." % pattern,
+ compat_type="error")
+
+ js_patterns = {r"initContactList": 775105,
+ r"ircChannel\.prototype\.setMode": 799068,
+ r"SetUpToolbarButtons": 785980,
+ r"queryISupportsArray": 679696,
+ r"gAttachmentNotifier\.EditAction": 792979,
+ r"accountManagerContractID": 776705,
+ r"updateMoveTargetMode": 725488,
+ r"updatePurgeSpam": 725488,
+ r"gServer": 577775}
+
+ # Add restricting prefix for ( or word boundary to prevent substring matching.
+ js_patterns.update(dict(("(\b|\()" + k, v) for k, v in js_patterns.items()))
+
+ for pattern, bug in js_patterns.items():
+ yield self.get_test_bug(
+ bug, pattern,
+ "Removed, renamed, or changed methods in use.",
+ "A JavaScript function matched the pattern `%s`, which has "
+ "been flagged as having changed, removed, or deprecated "
+ "in Thunderbird 18." % pattern,
+ compat_type="error", log_function=self.err.notice)

0 comments on commit 551b4f9

Please sign in to comment.
Something went wrong with that request. Please try again.