# Path: validator/decorator.py
# TEST_TIERS = {}
# CLEANUP_FUNCTIONS = []
# def register_test(tier=1, expected_type=None, simple=False, versions=None):
#     def wrap(function):
# def register_cleanup(cleanup):
# def cleanup():
# def get_tiers():
# def get_tests(tier, type_=None):
# def version_range(guid, version, before=None, app_versions=None):
# 
# Path: validator/submain.py
# def prepare_package(err, path, expectation=0, for_appversions=None,
#                     timeout=-1):
#         def timeout_handler(signum, frame):
# def test_search(err, package, expectation=0):
# def test_package(err, file_, name, expectation=PACKAGE_ANY,
#                  for_appversions=None):
# def _load_install_rdf(err, package, expectation):
# def _load_package_json(err, package, expectation):
# def _load_manifest_json(err, package, expectation):
# def populate_chrome_manifest(err, xpi_package):
#         def get_linked_manifest(path, from_path, from_chrome, from_triple):
# def test_inner_package(err, xpi_package, for_appversions=None):
# 
# Path: validator/unicodehelper.py
# UNICODE_BOMS = [
#     (codecs.BOM_UTF8, 'utf-8'),
#     (codecs.BOM_UTF32_LE, 'utf-32-le'),
#     (codecs.BOM_UTF32_BE, 'utf-32-be'),
#     (codecs.BOM_UTF16_LE, 'utf-16-le'),
#     (codecs.BOM_UTF16_BE, 'utf-16-be'),
# ]
# COMMON_ENCODINGS = ('latin_1', 'utf-16')
# NON_ASCII_FILTER = re.compile(r'[^\t\r\n\x20-\x7f]+')
# def decode(data):


import hashlib
import os
import re
import validator.testcases.markup.markuptester as testendpoint_markup
import validator.testcases.markup.csstester as testendpoint_css
import validator.testcases.scripting as testendpoint_js
import validator.testcases.langpack as testendpoint_langpack
from StringIO import StringIO
from zipfile import BadZipfile
from regex import run_regex_tests
from validator.constants import MAX_JS_THRESHOLD
from validator import decorator
from validator import submain as testendpoint_validator
from validator import unicodehelper
from validator.constants import (BUGZILLA_BUG, PACKAGE_LANGPACK,
                                 PACKAGE_SUBPACKAGE, PACKAGE_THEME)
from validator.xpi import XPIManager



FLAGGED_FILES = set(['.DS_Store', 'Thumbs.db'])
FLAGGED_EXTENSIONS = set(['.orig', '.old', '~'])
OSX_REGEX = re.compile('__MACOSX')

hash_library_allowed = {}
for hash_list in 'hashes-allowed.txt', 'static_hashes.txt':
    with open(os.path.join(os.path.dirname(__file__), hash_list)) as f:
        hash_library_allowed.update(s.strip().split(None, 1) for s in f)

hash_library_warning = {}
with open(os.path.join(os.path.dirname(__file__), "hashes-warning.txt")) as f:
        hash_library_warning.update(s.strip().split(None, 1) for s in f)

hash_library_error = {}
with open(os.path.join(os.path.dirname(__file__), "hashes-error.txt")) as f:
        hash_library_error.update(s.strip().split(None, 1) for s in f)


# Path: validator/decorator.py
# TEST_TIERS = {}
# CLEANUP_FUNCTIONS = []
# def register_test(tier=1, expected_type=None, simple=False, versions=None):
#     def wrap(function):
# def register_cleanup(cleanup):
# def cleanup():
# def get_tiers():
# def get_tests(tier, type_=None):
# def version_range(guid, version, before=None, app_versions=None):
# 
# Path: validator/submain.py
# def prepare_package(err, path, expectation=0, for_appversions=None,
#                     timeout=-1):
#         def timeout_handler(signum, frame):
# def test_search(err, package, expectation=0):
# def test_package(err, file_, name, expectation=PACKAGE_ANY,
#                  for_appversions=None):
# def _load_install_rdf(err, package, expectation):
# def _load_package_json(err, package, expectation):
# def _load_manifest_json(err, package, expectation):
# def populate_chrome_manifest(err, xpi_package):
#         def get_linked_manifest(path, from_path, from_chrome, from_triple):
# def test_inner_package(err, xpi_package, for_appversions=None):
# 
# Path: validator/unicodehelper.py
# UNICODE_BOMS = [
#     (codecs.BOM_UTF8, 'utf-8'),
#     (codecs.BOM_UTF32_LE, 'utf-32-le'),
#     (codecs.BOM_UTF32_BE, 'utf-32-be'),
#     (codecs.BOM_UTF16_LE, 'utf-16-le'),
#     (codecs.BOM_UTF16_BE, 'utf-16-be'),
# ]
# COMMON_ENCODINGS = ('latin_1', 'utf-16')
# NON_ASCII_FILTER = re.compile(r'[^\t\r\n\x20-\x7f]+')
# def decode(data):


# Path: validator/testcases/content.py
import hashlib
import os
import re
import validator.testcases.markup.markuptester as testendpoint_markup
import validator.testcases.markup.csstester as testendpoint_css
import validator.testcases.scripting as testendpoint_js
import validator.testcases.langpack as testendpoint_langpack
from StringIO import StringIO
from zipfile import BadZipfile
from regex import run_regex_tests
from validator.constants import MAX_JS_THRESHOLD
from validator import decorator
from validator import submain as testendpoint_validator
from validator import unicodehelper
from validator.constants import (BUGZILLA_BUG, PACKAGE_LANGPACK,
                                 PACKAGE_SUBPACKAGE, PACKAGE_THEME)
from validator.xpi import XPIManager




FLAGGED_FILES = set(['.DS_Store', 'Thumbs.db'])
FLAGGED_EXTENSIONS = set(['.orig', '.old', '~'])
OSX_REGEX = re.compile('__MACOSX')

hash_library_allowed = {}
for hash_list in 'hashes-allowed.txt', 'static_hashes.txt':
    with open(os.path.join(os.path.dirname(__file__), hash_list)) as f:
        hash_library_allowed.update(s.strip().split(None, 1) for s in f)

hash_library_warning = {}
with open(os.path.join(os.path.dirname(__file__), "hashes-warning.txt")) as f:
        hash_library_warning.update(s.strip().split(None, 1) for s in f)

hash_library_error = {}
with open(os.path.join(os.path.dirname(__file__), "hashes-error.txt")) as f:
        hash_library_error.update(s.strip().split(None, 1) for s in f)


@decorator.register_test(tier=1)