Skip to content

Commit

Permalink
add tests for Thunderbird 6 compatibility, bug676092
Browse files Browse the repository at this point in the history
  • Loading branch information
Sancus committed Aug 4, 2011
1 parent 859e283 commit ae2c76a
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 5 deletions.
58 changes: 53 additions & 5 deletions validator/testcases/javascript/call_definitions.py
Expand Up @@ -35,7 +35,9 @@ def amp_rp_bug660359(wrapper, arguments, traverser):
column=traverser.position,
context=traverser.context,
for_appversions={'{ec8030f7-c20a-464f-9b0e-13a3a9e97384}':
version_range("firefox", "6.0a1", "7.0a1")},
version_range("firefox", "6.0a1", "7.0a1"),
'{3550f703-e582-4d05-9a08-453d09bdfdc6}':
version_range("thunderbird", "6.0a1", "7.0a1"),},
compatibility_type="error",
tier=5)

Expand Down Expand Up @@ -235,7 +237,7 @@ def math_round(wrapper, arguments, traverser):
def nsIDOMFile_deprec(wrapper, arguments, traverser):
"""Throw a compatibility error about removed XPCOM methods."""
traverser.err.notice(
err_id=("testcases_javascript_calldefintiions", "nsIDOMFile",
err_id=("testcases_javascript_calldefinitions", "nsIDOMFile",
"deprec"),
notice="Deprecated nsIDOMFile methods in use.",
description=("Your add-on uses methods that have been removed from "
Expand All @@ -247,7 +249,9 @@ def nsIDOMFile_deprec(wrapper, arguments, traverser):
context=traverser.context,
compatibility_type="error",
for_appversions={'{ec8030f7-c20a-464f-9b0e-13a3a9e97384}':
version_range("firefox", "7.0a1", "8.0a1")},
version_range("firefox", "7.0a1", "8.0a1"),
'{3550f703-e582-4d05-9a08-453d09bdfdc6}':
version_range("thunderbird", "7.0a1", "8.0a1"),},
tier=5)

return JSWrapper(JSObject(), traverser=traverser)
Expand All @@ -256,7 +260,7 @@ def nsIDOMFile_deprec(wrapper, arguments, traverser):
def nsIJSON_deprec(wrapper, arguments, traverser):
"""Throw a compatibility error about removed XPCOM methods."""
traverser.err.notice(
err_id=("testcases_javascript_calldefintiions", "nsIJSON",
err_id=("testcases_javascript_calldefinitions", "nsIJSON",
"deprec"),
notice="Deprecated nsIJSON methods in use.",
description=("The encode and decode methods in nsIJSON have been "
Expand All @@ -271,7 +275,51 @@ def nsIJSON_deprec(wrapper, arguments, traverser):
context=traverser.context,
compatibility_type="warning",
for_appversions={'{ec8030f7-c20a-464f-9b0e-13a3a9e97384}':
version_range("firefox", "7.0a1", "8.0a1")},
version_range("firefox", "7.0a1", "8.0a1"),
'{3550f703-e582-4d05-9a08-453d09bdfdc6}':
version_range("thunderbird", "7.0a1", "8.0a1"),},
tier=5)

return JSWrapper(JSObject(), traverser=traverser)

def nsIImapMailFolderSink_changed(wrapper, arguments, traverser):
"""Flag calls to nsIImapMailFolderSink for possible incompatibility with Thunderbird 6"""
traverser.err.notice(
err_id=("testcases_javascript_calldefinitions", "nsIImapMailFolderSink"),
notice="Modified nsIImapMailFolderSink method in use.",
description="This add-on appears to use nsIImapMailFolderSink.setUrlState, "
"which may no longer work correctly due to "
"changes made in Thunderbird 6. For more information, "
"please refer to "
"https://bugzilla.mozilla.org/show_bug.cgi?id=464126",
filename=traverser.filename,
line=traverser.line,
column=traverser.position,
context=traverser.context,
compatibility_type="error",
for_appversions={'{3550f703-e582-4d05-9a08-453d09bdfdc6}':
version_range("thunderbird", "6.0a1", "8.0a1")},
tier=5)

return JSWrapper(JSObject(), traverser=traverser)

def nsIImapProtocol_removed(wrapper, arguments, traverser):
"""Flag calls to nsIImapProtocol for incompatibility with Thunderbird 6"""
traverser.err.notice(
err_id=("testcases_javascript_calldefinitions", "nsIImapProtocol"),
notice="Removed nsIImapProtocol method in use.",
description="This add-on appears to use nsIImapProtocol.NotifyHdrsToDownload, "
"which may no longer work correctly due to "
"changes made in Thunderbird 6. For more information, "
"please refer to "
"https://bugzilla.mozilla.org/show_bug.cgi?id=464126",
filename=traverser.filename,
line=traverser.line,
column=traverser.position,
context=traverser.context,
compatibility_type="error",
for_appversions={'{3550f703-e582-4d05-9a08-453d09bdfdc6}':
version_range("thunderbird", "6.0a1", "8.0a1")},
tier=5)

return JSWrapper(JSObject(), traverser=traverser)
Expand Down
16 changes: 16 additions & 0 deletions validator/testcases/javascript/predefinedentities.py
Expand Up @@ -66,6 +66,14 @@
{"return": call_definitions.nsIJSON_deprec},
u"decode":
{"return": call_definitions.nsIJSON_deprec}}},
u"nsIImapMailFolderSink":
{"value":
{u"setUrlState":
{"return": call_definitions.nsIImapMailFolderSink_changed}}},
u"nsIImapProtocol":
{"value":
{u"NotifyHdrsToDownload":
{"return": call_definitions.nsIImapProtocol_removed}}},
u"nsIObserverService":
{"value":
{u"addObserver":
Expand Down Expand Up @@ -353,6 +361,14 @@ def build_quick_xpcom(method, interface, traverser):
{"xpcom_map":
lambda:
INTERFACES["nsIJSON"]},
u"nsIImapMailFolderSink":
{"xpcom_map":
lambda:
INTERFACES["nsIImapMailFolderSink"]},
u"nsIImapProtocol":
{"xpcom_map":
lambda:
INTERFACES["nsIImapProtocol"]},
u"nsIObserverService":
{"xpcom_map":
lambda:
Expand Down

0 comments on commit ae2c76a

Please sign in to comment.