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


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

    def test_BrowserOpenNewTabOrWindow_removed(self):
        """https://github.com/mozilla/amo-validator/issues/473"""
        expected = (
            'The function BrowserOpenNewTabOrWindow has been removed.')

        script = '''
            window.BrowserOpenNewTabOrWindow();
        '''
        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'].startswith(expected)]
        assert warning
        assert warning[0]['compatibility_type'] == 'error'

    def test_mozVisibilityState_unprefixed(self):
        """https://github.com/mozilla/amo-validator/issues/474"""
        expected = (
            'The mozVisibilityState and mozHidden properties are no longer '
            'prefixed.')

        script = '''
            var x = document.createElement('div');

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


# Path: tests/compat/test_gecko51.py
import pytest
from helper import CompatTestCase
from validator.compat import FX51_DEFINITION

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

    def test_BrowserOpenNewTabOrWindow_removed(self):
        """https://github.com/mozilla/amo-validator/issues/473"""
        expected = (
            'The function BrowserOpenNewTabOrWindow has been removed.')

        script = '''
            window.BrowserOpenNewTabOrWindow();
        '''
        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'].startswith(expected)]
        assert warning
        assert warning[0]['compatibility_type'] == 'error'

    def test_mozVisibilityState_unprefixed(self):
        """https://github.com/mozilla/amo-validator/issues/474"""
        expected = (
            'The mozVisibilityState and mozHidden properties are no longer '
            'prefixed.')

        script = '''
            var x = document.createElement('div');

            x.mozVisibilityState = true;