Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #186 from Sancus/master

TB17 Compat Update for Bug 800466
  • Loading branch information...
commit 48bd89c2f594915c5d98733487146ebcef7ebaa0 2 parents 82f3177 + aed527d
@mattbasta authored
Showing with 74 additions and 1 deletion.
  1. +31 −0 tests/compat/test_tb17.py
  2. +43 −1 validator/testcases/regex.py
View
31 tests/compat/test_tb17.py
@@ -0,0 +1,31 @@
+from helper import CompatTestCase
+from validator.compat import TB17_DEFINITION
+
+
+class TestTB17Compat(CompatTestCase):
+ """
+ Test that compatibility tests for Thunderbird 17 are properly executed.
+ """
+
+ VERSION = TB17_DEFINITION
+
+ def test_js_patterns(self):
+ """Test that these js patterns are flagged in Thunderbird 17."""
+ 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, "(ChangeFeedShowSummaryPref"
+ yield test_pattern, self, "FeedSetContentViewToggle"
+ yield test_pattern, self, "FillAttachmentListPopup"
+
+ def test_unflagged_patterns(self):
+ """Test that these js patterns are _NOT_ flagged in Thunderbird 17."""
+ def test_pattern(self, pattern):
+ self.setUp()
+ self.run_regex_for_compat("var x = %s();" % pattern)
+ self.assert_compat_silent()
+
+ yield test_pattern, self, "MsgonShowAttachmentListContextMenu"
+ yield test_pattern, self, "ThisGetFeedOpenHandler"
View
44 validator/testcases/regex.py
@@ -8,7 +8,7 @@
FX17_DEFINITION,
TB7_DEFINITION, TB10_DEFINITION, TB11_DEFINITION,
TB12_DEFINITION, TB13_DEFINITION, TB14_DEFINITION,
- TB15_DEFINITION, TB16_DEFINITION)
+ TB15_DEFINITION, TB16_DEFINITION, TB17_DEFINITION)
from validator.contextgenerator import ContextGenerator
from markup.csstester import UNPREFIXED_MESSAGE
@@ -1060,3 +1060,45 @@ def tests(self):
"been flagged as having changed, removed, or deprecated "
"in Thunderbird 16." % pattern,
compat_type="error", log_function=self.err.notice)
+
+@register_generator
+class Thunderbird17RegexTests(CompatRegexTestHelper):
+ """Regex tests for the Thunderbird 17 update."""
+
+ VERSION = TB17_DEFINITION
+
+ def tests(self):
+ """String and JS changes for Thunderbird add-ons"""
+
+ # String changes for add-ons that use our localizations.
+ patterns = {r"searchTermListButtonsFlexValue": 743974,
+ r"sendWindow\.title": 255050,
+ r"addonsMgr\.label": 513164,
+ r"manageAddons(DescWin|DescUnix2)?\.(label|accesskey)": 513164}
+ 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 17." % pattern,
+ compat_type="error")
+
+ js_patterns = {r"(\b|\()onlineContacts": 775105,
+ r"(\b|\()initContactList": 775105,
+ r"(\b|\()onShowAttachmentListContextMenu": 780200,
+ r"(\b|\()FillAttachmentListPopup": 780200,
+ r"(\b|\()showAddonsMgr": 513164,
+ r"(\b|\()(Get|Change)FeedOpenHandler": 596234,
+ r"(\b|\()gShowFeedSummaryToggle": 596234,
+ r"(\b|\()ChangeFeedShowSummaryPref": 596234,
+ r"(\b|\()FeedSetContentView(Toggle)?": 596234,
+ r"(\b|\()FeedCheckContentFormat": 596234}
+
+ 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 17." % pattern,
+ compat_type="error", log_function=self.err.notice)
Please sign in to comment.
Something went wrong with that request. Please try again.