def get_test_config(test_files=[], result_files=[]):
    # We could grab this from port.layout_tests_dir(), but instantiating a fully mocked port is a pain.
    layout_tests_directory = "/mock-checkout/LayoutTests"
    results_directory = '/WebKitBuild/Debug/layout-test-results'
    host = MockHost()
    for file in test_files:
        file_path = host.filesystem.join(layout_tests_directory, file)
        host.filesystem.files[file_path] = ''
    for file in result_files:
        file_path = host.filesystem.join(results_directory, file)
        host.filesystem.files[file_path] = ''

    class TestMacPort(WebKitPort):
        port_name = "mac"

        def __init__(self, host):
            WebKitPort.__init__(self, host, port_name=self.port_name)

    return TestConfig(
        TestMacPort(host),
        layout_tests_directory,
        results_directory,
        ('mac', 'mac-leopard', 'win', 'linux'),
        host.filesystem,
        host.scm())
Ejemplo n.º 2
0
 def test_get_directory_owners(self):
     host = MockHost()
     host.filesystem.write_text_file(
         '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations',
         '## Owners: [email protected]\n'
         '# external/wpt/foo [ Pass ]\n')
     git = MockGit()
     git.changed_files = lambda: [
         'third_party/WebKit/LayoutTests/external/wpt/foo/x.html'
     ]
     host.scm = lambda: git
     importer = TestImporter(host)
     self.assertEqual(importer.get_directory_owners(),
                      {'*****@*****.**': 'external/wpt/foo'})
Ejemplo n.º 3
0
def get_test_config(test_files=[], result_files=[]):
    # We could grab this from port.layout_tests_dir(), but instantiating a fully mocked port is a pain.
    layout_tests_directory = "/mock-checkout/LayoutTests"
    results_directory = '/WebKitBuild/Debug/layout-test-results'
    host = MockHost()
    for file in test_files:
        host.filesystem.write_binary_file(
            host.filesystem.join(layout_tests_directory, file), '')
    for file in result_files:
        host.filesystem.write_binary_file(
            host.filesystem.join(results_directory, file), '')

    class TestMacPort(Port):
        port_name = "mac"

    return TestConfig(TestMacPort(host, 'mac'), layout_tests_directory,
                      results_directory,
                      ('mac', 'mac-leopard', 'win', 'linux'), host.scm(), host)
Ejemplo n.º 4
0
def get_test_config(test_files=[], result_files=[]):
    # We could grab this from port.layout_tests_dir(), but instantiating a fully mocked port is a pain.
    layout_tests_directory = "/mock-checkout/LayoutTests"
    results_directory = '/WebKitBuild/Debug/layout-test-results'
    host = MockHost()
    for file in test_files:
        host.filesystem.write_binary_file(host.filesystem.join(layout_tests_directory, file), '')
    for file in result_files:
        host.filesystem.write_binary_file(host.filesystem.join(results_directory, file), '')

    class TestMacPort(WebKitPort):
        port_name = "mac"

    return TestConfig(
        TestMacPort(host, 'mac'),
        layout_tests_directory,
        results_directory,
        ('mac', 'mac-leopard', 'win', 'linux'),
        host.filesystem,
        host.scm())
Ejemplo n.º 5
0
def get_test_config(test_files=[], result_files=[]):
    host = MockHost()
    port = host.port_factory.get()
    layout_tests_directory = port.layout_tests_dir()
    results_directory = port.results_directory()

    for file in test_files:
        host.filesystem.write_binary_file(
            host.filesystem.join(layout_tests_directory, file), '')
    for file in result_files:
        host.filesystem.write_binary_file(
            host.filesystem.join(results_directory, file), '')

    class TestMacPort(Port):
        port_name = "mac"
        FALLBACK_PATHS = {'': ['mac']}

    return TestConfig(TestMacPort(host, 'mac'), layout_tests_directory,
                      results_directory,
                      ('mac', 'mac-leopard', 'win', 'linux'), host.filesystem,
                      host.scm())
def get_test_config(test_files=[], result_files=[]):
    host = MockHost()
    port = host.port_factory.get()
    layout_tests_directory = port.layout_tests_dir()
    results_directory = port.results_directory()

    for file in test_files:
        host.filesystem.write_binary_file(host.filesystem.join(layout_tests_directory, file), '')
    for file in result_files:
        host.filesystem.write_binary_file(host.filesystem.join(results_directory, file), '')

    class TestMacPort(Port):
        port_name = "mac"
        FALLBACK_PATHS = {'': ['mac']}

    return TestConfig(
        TestMacPort(host, 'mac'),
        layout_tests_directory,
        results_directory,
        ('mac', 'mac-leopard', 'win', 'linux'),
        host.filesystem,
        host.scm())
Ejemplo n.º 7
0
def get_test_config(test_files=[], result_files=[]):
    host = MockHost()
    port = host.port_factory.get()
    layout_tests_directory = port.layout_tests_dir()
    results_directory = port.results_directory()

    for file in test_files:
        host.filesystem.write_binary_file(host.filesystem.join(layout_tests_directory, file), "")
    for file in result_files:
        host.filesystem.write_binary_file(host.filesystem.join(results_directory, file), "")

    class TestMacPort(Port):
        port_name = "mac"
        FALLBACK_PATHS = {"": ["mac"]}

    return TestConfig(
        TestMacPort(host, "mac"),
        layout_tests_directory,
        results_directory,
        ("mac", "mac-leopard", "win", "linux"),
        host.filesystem,
        host.scm(),
    )