Permalink
Browse files

Added compatibility tests for Thunderbird 19 (Bug 851922)

  • Loading branch information...
1 parent 586ccb0 commit 1f559c9b23bfdfb03715e707a822ac640b214ee4 @wagnerand wagnerand committed May 2, 2013
View
@@ -0,0 +1,27 @@
+from helper import CompatTestCase
+from validator.compat import TB19_DEFINITION
+
+
+class TestTB19Compat(CompatTestCase):
+ """Test that compatibility tests for Thunderbird 19 are properly executed."""
+
+ VERSION = TB19_DEFINITION
+
+ def test_js_patterns(self):
+ """Test that these patterns are flagged in Thunderbird 19."""
+ self.setUp()
+ self.run_regex_for_compat("var x = %s();" "enableEditableFields")
+ self.assert_compat_error(type_="notice")
+
+ def test_nsIMsgCompFields_newshost(self):
+ for method in self.run_xpcom_for_compat(
+ "nsIMsgCompFields", ["newshost"]):
+ self.assert_silent()
+ self.assert_compat_error(type_="warning")
+
+ def test_nsIMsgSearchAdapter_CurrentUrlDone(self):
+ for method in self.run_xpcom_for_compat(
+ "nsIMsgSearchAdapter", ["CurrentUrlDone"]):
+ self.assert_silent()
+ self.assert_compat_error(type_="warning")
+
@@ -3,7 +3,8 @@
from validator.compat import (FX10_DEFINITION, FX14_DEFINITION,
FX16_DEFINITION, FX19_DEFINITION,
TB14_DEFINITION, TB15_DEFINITION,
- TB16_DEFINITION, TB18_DEFINITION)
+ TB16_DEFINITION, TB18_DEFINITION,
+ TB19_DEFINITION)
from validator.constants import BUGZILLA_BUG
@@ -34,7 +35,7 @@ def deprecated_entity(name, version, message, bug, status="deprecated",
compat_type="error"):
def wrap(traverser):
traverser.err.warning(
- err_id=("testcases_javascript_entity_values", name),
+ err_id=("js", "entities", name),
warning="`%s` has been %s." % (name, status),
description=[message,
"See %s for more information." % BUGZILLA_BUG % bug],
@@ -47,6 +48,15 @@ def wrap(traverser):
tier=5)
register_entity(name)(wrap)
+def register_changed_entities(version_definition, entities, version_string):
+ for entity in entities:
+ deprecated_entity(
+ name=entity["name"],
+ version=version_definition,
+ message="The method or property `%s` has been `%s` in `%s`."
+ % (entity["name"], entity["status"], version_string),
+ bug=entity["bug"],
+ compat_type=entity["compat_type"])
DEP_IHF_MESSAGE = ("The `importHTMLFromFile` and `importHTMLFromURI` functions "
"have been removed from the `nsIPlacesImportExportService` "
@@ -350,3 +360,18 @@ def prplIAccount_noNewlines(traverser):
for_appversions=TB18_DEFINITION,
compatibility_type="error",
tier=5)
+
+# Thunderbird 19 IDL changes
+TB19_ENTITIES = [
+ {"name":"nsIMsgCompFields.newshost",
+ "status": "changed",
+ "bug": 133605,
+ "compat_type": "error"},
+ {"name": "nsIMsgSearchAdapter.CurrentUrlDone",
+ "status": "changed",
+ "bug": 801383,
+ "compat_type": "error"}
+]
+register_changed_entities(version_definition=TB19_DEFINITION,
+ entities=TB19_ENTITIES, version_string="Thunderbird 19")
+
@@ -349,7 +349,13 @@
call_definitions.webbrowserpersist_saveuri}}},
u"prplIAccount":
{"value":
- {u"noNewlines": entity("prplIAccount.noNewlines")}}
+ {u"noNewlines": entity("prplIAccount.noNewlines")}},
+ u"nsIMsgCompFields":
+ {"value":
+ {u"newshost": entity("nsIMsgCompFields.newshost")}},
+ u"nsIMsgSearchAdapter":
+ {"value":
+ {u"CurrentUrlDone": entity("nsIMsgSearchAdapter.CurrentUrlDone")}}
}
INTERFACE_ENTITIES = {u"nsIXMLHttpRequest":
@@ -10,7 +10,7 @@
FX20_DEFINITION, TB7_DEFINITION, TB10_DEFINITION,
TB11_DEFINITION, TB12_DEFINITION, TB13_DEFINITION,
TB14_DEFINITION, TB15_DEFINITION, TB16_DEFINITION,
- TB17_DEFINITION, TB18_DEFINITION)
+ TB17_DEFINITION, TB18_DEFINITION, TB19_DEFINITION)
from validator.contextgenerator import ContextGenerator
from markup.csstester import UNPREFIXED_MESSAGE
@@ -1328,3 +1328,57 @@ def tests(self):
"been flagged as having changed, removed, or deprecated "
"in Thunderbird 18." % pattern,
compat_type="error", log_function=self.err.notice)
+
+@register_generator
+class Thunderbird19RegexTests(CompatRegexTestHelper):
+ """Regex tests for the Thunderbird 19 update."""
+
+ VERSION = TB19_DEFINITION
+
+ def tests(self):
+ """String and JS changes for Thunderbird add-ons"""
+
+ # String changes for add-ons that use our localizations.
+ patterns = {r"contextDesc\.accesskey": 775665,
+ r"contextIncoming\.label": 775665,
+ r"contextBoth\.label": 775665,
+ r"contextPostPlugin\.label": 775665,
+ r"contextPostPluginBoth\.label": 775665,
+ r"checkNow\.label": 804001,
+ r"checkNow\.acesskey": 804001,
+ r"outputFormatMenu\.label": 339887,
+ r"deliveryFormatMenu\.accesskey": 339887,
+ r"12564": 801383,
+ r"mime_multipartSignedBlurb": 800877,
+ r"command\.mode": 812921,
+ r"message\.mode": 812921}
+ 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 19." % pattern,
+ compat_type="error")
+
+ js_patterns = {r"toggleFilter": 783491,
+ r"gFilterContext": 775665,
+ r"determineFilterType": 775665,
+ r"KEY_ISP_DIRECTORY_LIST": 793599,
+ r"disableEditableFields": 271730,
+ r"enableEditableFields": 271730,
+ r"gSmtpHostNameIsIllegal": 80855,
+ r"hostnameIsIllegal": 80855,
+ r"gLastPurpleConvId": 812921}
+
+ # 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 19." % pattern,
+ compat_type="error", log_function=self.err.notice)
+

0 comments on commit 1f559c9

Please sign in to comment.