Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added compatibility tests for Thunderbird 20 (Bug 867956)

  • Loading branch information...
commit 0586035a50a9d27b8f802e97a5411bd26d5ec878 1 parent 1f559c9
@wagnerand wagnerand authored
View
47 tests/compat/test_tb20.py
@@ -0,0 +1,47 @@
+from helper import CompatTestCase
+from validator.compat import TB20_DEFINITION
+
+
+class TestTB20Compat(CompatTestCase):
+ """Test that compatibility tests for Thunderbird 20 are properly executed."""
+
+ VERSION = TB20_DEFINITION
+
+ def test_js_patterns(self):
+ """Test that these patterns are flagged in Thunderbird 20."""
+ self.setUp()
+ self.run_regex_for_compat("var x = %s();" "GetWindowByWindowType")
+ self.assert_compat_error(type_="notice")
+
+ def test_nsIMsgAccount_identities(self):
+ for method in self.run_xpcom_for_compat(
+ "nsIMsgAccount", ["identities"]):
+ self.assert_silent()
+ self.assert_compat_error(type_="warning")
+
+ def test_nsIMsgAccountManager(self):
+ for method in self.run_xpcom_for_compat(
+ "nsIMsgAccountManager",
+ ["allIdentities", "GetIdentitiesForServer", "accounts",
+ "GetServersForIdentity", "allServers"]):
+ self.assert_silent()
+ self.assert_compat_error(type_="warning")
+
+ def test_nsIMsgFolder_getExpansionArray(self):
+ for method in self.run_xpcom_for_compat(
+ "nsIMsgFolder", ["getExpansionArray"]):
+ self.assert_silent()
+ self.assert_compat_error(type_="warning")
+
+ def test_nsIMsgFilter(self):
+ for method in self.run_xpcom_for_compat(
+ "nsIMsgFilter", ["actionList", "getSortedActionList"]):
+ self.assert_silent()
+ self.assert_compat_error(type_="warning")
+
+ def test_nsIMsgFilterService_applyFiltersToFolders(self):
+ for method in self.run_xpcom_for_compat(
+ "nsIMsgFilterService", ["applyFiltersToFolders"]):
+ self.assert_silent()
+ self.assert_compat_error(type_="warning")
+
View
27 validator/testcases/javascript/entity_values.py
@@ -4,7 +4,7 @@
FX16_DEFINITION, FX19_DEFINITION,
TB14_DEFINITION, TB15_DEFINITION,
TB16_DEFINITION, TB18_DEFINITION,
- TB19_DEFINITION)
+ TB19_DEFINITION, TB20_DEFINITION)
from validator.constants import BUGZILLA_BUG
@@ -375,3 +375,28 @@ def prplIAccount_noNewlines(traverser):
register_changed_entities(version_definition=TB19_DEFINITION,
entities=TB19_ENTITIES, version_string="Thunderbird 19")
+# Thunderbird 20 IDL changes
+TB20_ENTITIES = [
+ {"name": "nsIMsgAccount.identities",
+ "status": "changed", "bug": 820377, "compat_type": "error"},
+ {"name": "nsIMsgAccountManager.allIdentities",
+ "status": "changed", "bug": 820377, "compat_type": "error"},
+ {"name": "nsIMsgAccountManager.GetIdentitiesForServer",
+ "status": "changed", "bug": 820377, "compat_type": "error"},
+ {"name": "nsIMsgAccountManager.accounts",
+ "status": "changed", "bug": 820377, "compat_type": "error"},
+ {"name": "nsIMsgAccountManager.GetServersForIdentity",
+ "status": "changed", "bug": 820377, "compat_type": "error"},
+ {"name": "nsIMsgAccountManager.allServers",
+ "status": "changed", "bug": 820377, "compat_type": "error"},
+ {"name": "nsIMsgFolder.getExpansionArray",
+ "status": "removed", "bug": 821236, "compat_type": "error"},
+ {"name": "nsIMsgFilter.getSortedActionList",
+ "status": "changed", "bug": 821253, "compat_type": "error"},
+ {"name": "nsIMsgFilter.actionList",
+ "status": "removed", "bug": 821743, "compat_type": "error"},
+ {"name": "nsIMsgFilterService.applyFiltersToFolders",
+ "status": "changed", "bug": 822131, "compat_type": "error"}
+]
+register_changed_entities(version_definition=TB20_DEFINITION,
+ entities=TB20_ENTITIES, version_string="Thunderbird 20")
View
23 validator/testcases/javascript/predefinedentities.py
@@ -142,8 +142,12 @@
entity("nsIMessenger.saveAttachmentToFolder")}},
u"nsIMsgAccountManager":
{"value":
- {u"folderUriForPath":
- entity("nsIMsgAccountManager.folderUriForPath")}},
+ {u"folderUriForPath": entity("nsIMsgAccountManager.folderUriForPath"),
+ u"allIdentities": entity("nsIMsgAccountManager.allIdentities"),
+ u"GetIdentitiesForServer": entity("nsIMsgAccountManager.GetIdentitiesForServer"),
+ u"accounts": entity("nsIMsgAccountManager.accounts"),
+ u"GetServersForIdentity": entity("nsIMsgAccountManager.GetServersForIdentity"),
+ u"allServers": entity("nsIMsgAccountManager.allServers")}},
u"nsIMsgLocalMailFolder":
{"value":
{u"addMessage":
@@ -174,12 +178,14 @@
u"nsIMsgFilterService":
{"value":
{u"OpenFilterList": entity("nsIMsgFilterService.OpenFilterList"),
- u"SaveFilterList": entity("nsIMsgFilterService.SaveFilterList")}},
+ u"SaveFilterList": entity("nsIMsgFilterService.SaveFilterList"),
+ u"applyFiltersToFolders": entity("nsIMsgFilterService.applyFiltersToFolders")}},
u"nsIMsgFolder":
{"value":
{u"offlineStoreOutputStream":
{"value": call_definitions.nsIMsgFolder_changed},
- u"filePath": entity("nsIMsgFolder.filePath")}},
+ u"filePath": entity("nsIMsgFolder.filePath"),
+ u"getExpansionArray": entity("nsIMsgFolder.getExpansionArray")}},
u"nsIMsgIdentity":
{"value":
{u"signature": entity("nsIMsgIdentity.signature")}},
@@ -355,7 +361,14 @@
{u"newshost": entity("nsIMsgCompFields.newshost")}},
u"nsIMsgSearchAdapter":
{"value":
- {u"CurrentUrlDone": entity("nsIMsgSearchAdapter.CurrentUrlDone")}}
+ {u"CurrentUrlDone": entity("nsIMsgSearchAdapter.CurrentUrlDone")}},
+ u"nsIMsgAccount":
+ {"value":
+ {u"identities": entity("nsIMsgAccount.identities")}},
+ u"nsIMsgFilter":
+ {"value":
+ {u"getSortedActionList": entity("nsIMsgFilter.getSortedActionList"),
+ u"actionList": entity("nsIMsgFilter.actionList")}}
}
INTERFACE_ENTITIES = {u"nsIXMLHttpRequest":
View
59 validator/testcases/regex.py
@@ -10,7 +10,8 @@
FX20_DEFINITION, TB7_DEFINITION, TB10_DEFINITION,
TB11_DEFINITION, TB12_DEFINITION, TB13_DEFINITION,
TB14_DEFINITION, TB15_DEFINITION, TB16_DEFINITION,
- TB17_DEFINITION, TB18_DEFINITION, TB19_DEFINITION)
+ TB17_DEFINITION, TB18_DEFINITION, TB19_DEFINITION,
+ TB20_DEFINITION)
from validator.contextgenerator import ContextGenerator
from markup.csstester import UNPREFIXED_MESSAGE
@@ -1382,3 +1383,59 @@ def tests(self):
"in Thunderbird 19." % pattern,
compat_type="error", log_function=self.err.notice)
+@register_generator
+class Thunderbird20RegexTests(CompatRegexTestHelper):
+ """Regex tests for the Thunderbird 20 update."""
+
+ VERSION = TB20_DEFINITION
+
+ def tests(self):
+ """String and JS changes for Thunderbird add-ons"""
+
+ # String changes for add-ons that use our localizations.
+ patterns = {r"appmenuButton.tooltip": 812630,
+ r"decreaseFontSize.key": 813295,
+ r"decreaseFontSize.key2": 813295,
+ r"increaseFontSize.key": 813295,
+ r"increaseFontSize.key2": 813295,
+ r"serverNameEmpty": 327812,
+ r"confirmDeferAccount": 734034}
+ 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 20." % pattern,
+ compat_type="error")
+
+ js_patterns = {r"gIdentity": 807101,
+ r"enabling": 807101,
+ r"cleanUpHostname": 327812,
+ r"gIOService": 794909,
+ r"gPromptService": 794909,
+ r"gIsOffline": 794909,
+ r"gIOService": 794909,
+ r"gPrefBranch": 795152,
+ r"GetWindowByWindowType": 795152,
+ r"specialTabs\.getApplicationUpgradeVersions": 795152,
+ r"specialTabs\.shouldShowTelemetryNotification": 795152,
+ r"specialTabs\.showTelemetryNotification": 795152,
+ r"specialTabs\.shouldShowAboutRightsNotification": 795152,
+ r"specialTabs\.showAboutRightsNotification": 795152,
+ r"FocusManager": 795152,
+ r"nsIWindowMediator": 795152,
+ r"nsIWindowWatcher": 795152,
+ r"gPrefs": 795152,
+ r"gAttachmentNotifier\.handleMutations": 823009}
+
+ # 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 20." % pattern,
+ compat_type="error", log_function=self.err.notice)
Please sign in to comment.
Something went wrong with that request. Please try again.