def test_xpcnativewrappers(err, xpi_package=None):
    """Tests the chrome.manifest file to ensure that it doesn't contain
    xpcnativewrappers objects."""

    # Don't even both with the test(s) if there's no chrome.manifest.
    chrome = err.get_resource('chrome.manifest')
    if not chrome:
        return None

    for entry in chrome.entries:
        # Test to make sure that the entry's subject is valid
        if entry['type'] == 'xpcnativewrappers':
            err.warning(('testcases_content',
                         'test_xpcnativewrappers',
                         'found_in_chrome_manifest'),
                        'xpcnativewrappers not allowed in chrome.manifest',
                        'chrome.manifest files are not allowed to contain '
                        'xpcnativewrappers directives.',
                        filename=entry['filename'],
                        line=entry['line'],
                        context=entry['context'])