# Path: validator/compat.py
# FX48_DEFINITION = _build_definition(48, fennec=False, android=False, thunderbird=False)


from helper import CompatTestCase
from validator.compat import FX48_DEFINITION
        assert warning[0]['compatibility_type'] == 'warning'

    def test_nsIIOService_newChannelFromURI_deprecated(self):
        """https://github.com/mozilla/addons-server/issues/2679"""
        expected = (
            'The "newChannel" functions have been deprecated in favor of '
            'their new versions (ending with 2).')

        script = '''
            var io = Components.classes["@mozilla.org/network/io-service;1"]
                .getService(Components.interfaces["nsIIOService"]);
            reqObj = io.newChannelFromURI(uri);
        '''

        self.run_script_for_compat(script)

        assert not self.compat_err.notices
        assert not self.compat_err.errors

        warning = [msg for msg in self.compat_err.warnings if msg['message'] == expected]
        assert warning
        assert warning[0]['compatibility_type'] == 'warning'

    def test_nsIIOService_newChannelFromURIWithProxyFlags(self):
        """https://github.com/mozilla/addons-server/issues/2679"""
        expected = (
            'The "newChannel" functions have been deprecated in favor of '
            'their new versions (ending with 2).')

        script = '''

# Path: validator/compat.py
# FX48_DEFINITION = _build_definition(48, fennec=False, android=False, thunderbird=False)


# Path: tests/compat/test_gecko48.py
from helper import CompatTestCase
from validator.compat import FX48_DEFINITION

        assert warning[0]['compatibility_type'] == 'warning'

    def test_nsIIOService_newChannelFromURI_deprecated(self):
        """https://github.com/mozilla/addons-server/issues/2679"""
        expected = (
            'The "newChannel" functions have been deprecated in favor of '
            'their new versions (ending with 2).')

        script = '''
            var io = Components.classes["@mozilla.org/network/io-service;1"]
                .getService(Components.interfaces["nsIIOService"]);
            reqObj = io.newChannelFromURI(uri);
        '''

        self.run_script_for_compat(script)

        assert not self.compat_err.notices
        assert not self.compat_err.errors

        warning = [msg for msg in self.compat_err.warnings if msg['message'] == expected]
        assert warning
        assert warning[0]['compatibility_type'] == 'warning'

    def test_nsIIOService_newChannelFromURIWithProxyFlags(self):
        """https://github.com/mozilla/addons-server/issues/2679"""
        expected = (
            'The "newChannel" functions have been deprecated in favor of '
            'their new versions (ending with 2).')

        script = '''

            var iOService = Components.classes["@mozilla.org/network/io-service;1"]