Skip to content
This repository has been archived by the owner on Feb 1, 2019. It is now read-only.

Commit

Permalink
Compat test cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbasta committed Feb 9, 2013
1 parent 89aea7d commit 3d3dc9f
Show file tree
Hide file tree
Showing 21 changed files with 13 additions and 31 deletions.
1 change: 0 additions & 1 deletion tests/compat/test_gecko10.py
Expand Up @@ -63,4 +63,3 @@ def test_nsIBrowserHistory(self):
"nsIBrowserHistory", ["lastPageVisited"]):
self.assert_silent()
self.assert_compat_error(type_="error")

1 change: 0 additions & 1 deletion tests/compat/test_gecko11.py
Expand Up @@ -24,4 +24,3 @@ def test_patterns(self):
self.run_regex_for_compat(pattern)
self.assert_silent()
self.assert_compat_error()

1 change: 0 additions & 1 deletion tests/compat/test_gecko12.py
Expand Up @@ -24,4 +24,3 @@ def test_interfaces(self):
self.run_regex_for_compat("Components.interfaces.%s" % interface)
self.assert_silent()
self.assert_compat_error()

1 change: 0 additions & 1 deletion tests/compat/test_gecko13.py
Expand Up @@ -52,4 +52,3 @@ def test_nsIAccessNode(self):
self.run_regex_for_compat("nsIAccessNode")
self.assert_silent()
self.assert_compat_error()

1 change: 0 additions & 1 deletion tests/compat/test_gecko14.py
Expand Up @@ -78,4 +78,3 @@ def test_nsILocalFile(self):
self.run_regex_for_compat("nsILocalFile")
self.assert_silent()
self.assert_compat_warning(type_="warning")

3 changes: 1 addition & 2 deletions tests/compat/test_gecko5.py
Expand Up @@ -13,8 +13,7 @@ def test_navigator_language(self):
with Gecko 5.
"""

self.run_script_for_compat('alert(navigator.language);')
self.run_regex_for_compat('alert(navigator.language);', is_js=True)
self.assert_silent()

self.assert_compat_error(type_="notice")

1 change: 0 additions & 1 deletion tests/compat/test_gecko6.py
Expand Up @@ -81,4 +81,3 @@ def test(versions):
<bar insertbefore="something else" />
</foo>
""")

1 change: 0 additions & 1 deletion tests/compat/test_gecko7.py
Expand Up @@ -37,4 +37,3 @@ def test_nsIJSON(self):
"nsIJSON", ["encode()", "decode()"]):
self.assert_silent()
self.assert_compat_warning()

1 change: 0 additions & 1 deletion tests/compat/test_gecko8.py
Expand Up @@ -26,4 +26,3 @@ def test_getSelection(self):
self.run_script_for_compat("document.getSelection();")
self.assert_silent()
self.assert_compat_error(type_="notice")

10 changes: 5 additions & 5 deletions tests/compat/test_gecko9.py
Expand Up @@ -8,22 +8,23 @@ class TestGecko9Compat(CompatTestCase):
VERSION = FX9_DEFINITION

def test_taintEnabled(self):
self.run_script_for_compat("alert(navigator.taintEnabled);")
self.run_regex_for_compat("alert(navigator.taintEnabled);", is_js=True)
self.assert_silent()
self.assert_compat_warning(type_="warning")

def test_documentURIObject(self):
self.run_script_for_compat("alert(document.documentURIObject);")
self.run_regex_for_compat(
"alert(document.documentURIObject);", is_js=True)
self.assert_silent()
self.assert_compat_warning()

def test_nodePrincipal(self):
self.run_script_for_compat("alert(document.nodePrincipal);")
self.run_regex_for_compat("alert(document.nodePrincipal);", is_js=True)
self.assert_silent()
self.assert_compat_warning()

def test_baseURIObject(self):
self.run_script_for_compat("alert(document.baseURIObject);")
self.run_regex_for_compat("alert(document.baseURIObject);", is_js=True)
self.assert_silent()
self.assert_compat_warning()

Expand Down Expand Up @@ -152,4 +153,3 @@ def test_geo_prefs(self):
""")
self.assert_silent()
self.assert_compat_error()

1 change: 0 additions & 1 deletion tests/compat/test_tb10.py
Expand Up @@ -19,4 +19,3 @@ def test_functions(self):
self.assert_silent()
assert self.compat_err.warnings or self.compat_err.notices
assert self.compat_err.compat_summary["errors"]

1 change: 0 additions & 1 deletion tests/compat/test_tb11.py
Expand Up @@ -19,4 +19,3 @@ def test_interfaces(self):
"nsIMailtoUrl", ["GetMessageContents()"]):
self.assert_silent()
self.assert_compat_error(type_="notice")

1 change: 0 additions & 1 deletion tests/compat/test_tb12.py
Expand Up @@ -19,4 +19,3 @@ def test_interfaces(self):
"nsIMsgDatabase", ["Open()"]):
self.assert_silent()
self.assert_compat_error(type_="notice")

5 changes: 2 additions & 3 deletions tests/compat/test_tb13.py
Expand Up @@ -25,14 +25,13 @@ def test_functions(self):
"serverPageUnload", "loginPageValidate", "setupBccTextbox",
"setupCcTextbox"]
for pattern in patterns:
self.run_regex_for_compat("var x = %s();" % pattern)
self.run_regex_for_compat("var x = %s();" % pattern, is_js=True)
self.assert_silent()
assert self.compat_err.notices
assert self.compat_err.compat_summary["errors"]

# Extra tests for similar functions.
for pattern in ["serverPage", "clientPageInit"]:
self.run_regex_for_compat("var x = %s();" % pattern)
self.run_regex_for_compat("var x = %s();" % pattern, is_js=True)
self.assert_silent()
self.assert_compat_silent()

5 changes: 2 additions & 3 deletions tests/compat/test_tb14.py
Expand Up @@ -26,10 +26,9 @@ def test_functions(self):
assert self.compat_err.compat_summary["errors"]

# These patterns should not be flagged.
for pattern in ["cvsPrefs()", "mailnews()",
for pattern in ["cvsPrefs()", "mailnews()",
"CollapseSectionHeaderators()",
"msgMailSession", "msgPrefs",]:
self.run_regex_for_compat("var x = %s();" % pattern)
self.run_regex_for_compat("var x = %s();" % pattern, is_js=True)
self.assert_silent()
self.assert_compat_silent()

5 changes: 2 additions & 3 deletions tests/compat/test_tb15.py
Expand Up @@ -19,7 +19,7 @@ def test_js_patterns(self):
"""Test that these js patterns are flagged in Thunderbird 15."""
def test_pattern(self, pattern):
self.setUp()
self.run_regex_for_compat("var x = %s();" % pattern)
self.run_regex_for_compat("var x = %s();" % pattern, is_js=True)
self.assert_compat_error(type_="notice")

for r in ["testConfigurator", ".capabilityPref", "(getFeedUrlsInFolder",
Expand All @@ -30,10 +30,9 @@ def test_unflagged_patterns(self):
"""Test that these js patterns are _NOT_ flagged in Thunderbird 15."""
def test_pattern(self, pattern):
self.setUp()
self.run_regex_for_compat("var x = %s();" % pattern)
self.run_regex_for_compat("var x = %s();" % pattern, is_js=True)
self.assert_compat_silent()

for r in ["getaddFeed", "sometimeswaitForBuddyInfo", "DC_RSS_NS",
"msgFeedSubscriptionsWindow", "msgetNodeValue"]:
yield test_pattern, self, r

1 change: 0 additions & 1 deletion tests/compat/test_tb6.py
Expand Up @@ -18,4 +18,3 @@ def test_nsIImapProtocol(self):
"nsIImapProtocol", ["NotifyHdrsToDownload()"]):
self.assert_silent()
self.assert_compat_error(type_="notice")

1 change: 0 additions & 1 deletion tests/compat/test_tb7.py
Expand Up @@ -47,4 +47,3 @@ def test_deRDF_addressbook(self):
""")
self.assert_silent()
self.assert_compat_error(type_="notice")

1 change: 0 additions & 1 deletion tests/compat/test_tb8.py
Expand Up @@ -12,4 +12,3 @@ def test_nsIMsgSearchScopeTerm(self):
"nsIMsgSearchScopeTerm", ["mailFile()", "inputStream()"]):
self.assert_silent()
self.assert_compat_error(type_="notice")

1 change: 0 additions & 1 deletion tests/compat/test_tb9.py
Expand Up @@ -14,4 +14,3 @@ def test_functions(self):
self.run_script_for_compat("%s();" % pattern)
self.assert_silent()
self.assert_compat_error(type_="notice")

1 change: 1 addition & 0 deletions validator/testcases/regex.py
Expand Up @@ -536,6 +536,7 @@ def tests(self):
"than 0 or -1.", compat_type="error",
log_function=self.err.notice)


@register_generator
class Gecko13RegexTests(CompatRegexTestHelper):
"""Regex tests for Gecko 13 updates."""
Expand Down

0 comments on commit 3d3dc9f

Please sign in to comment.