Пример #1
0
    def test_test_files(self):
        host = MockSystemHost()
        files = {
            "/mock-checkout/LayoutTests/canvas/philip/test.html": "",
            "/mock-checkout/LayoutTests/fast/canvas/test.html": "",
            "/mock-checkout/LayoutTests/fast/html/test.html": "",
            "/mock-checkout/LayoutTests/foo/bar.html": "",
        }
        host.filesystem = MockFileSystem(files)

        def test_paths(port_name):
            return PortFactory(host).get(port_name).tests([])

        self.assertEqual(test_paths("chromium-gpu-linux"), set(["canvas/philip/test.html", "fast/canvas/test.html"]))
Пример #2
0
    def assert_port_works(self, port_name, input_name=None, platform=None):
        host = MockSystemHost()
        host.filesystem = FileSystem(
        )  # FIXME: This test should not use a real filesystem!

        # test that we got the right port
        mock_options = MockOptions(accelerated_2d_canvas=None,
                                   accelerated_video=None,
                                   builder_name='foo',
                                   child_processes=None)
        if input_name and platform:
            port = PortFactory(host).get(host,
                                         platform=platform,
                                         port_name=input_name,
                                         options=mock_options)
        else:
            port = PortFactory(host).get(host,
                                         port_name=port_name,
                                         options=mock_options)
        self.assertTrue(port._options.accelerated_2d_canvas)
        self.assertTrue(port._options.accelerated_video)
        self.assertTrue(port._options.experimental_fully_parallel)
        self.assertEqual(port._options.builder_name, 'foo - GPU')

        self.assertTrue(port.name().startswith(port_name))

        # test that it has the right directories in front of the search path.
        paths = port.baseline_search_path()
        self.assertEqual(port._webkit_baseline_path(port_name), paths[0])
        if port_name == 'chromium-gpu-linux':
            self.assertEqual(port._webkit_baseline_path('chromium-gpu-win'),
                             paths[1])
            self.assertEqual(port._webkit_baseline_path('chromium-gpu'),
                             paths[2])
        else:
            self.assertEqual(port._webkit_baseline_path('chromium-gpu'),
                             paths[1])

        # Test that we're limiting to the correct directories.
        # These two tests are picked mostly at random, but we make sure they
        # exist separately from being filtered out by the port.

        # Note that this is using a real filesystem.
        files = port.tests(None)

        path = 'fast/html/keygen.html'
        self.assertTrue(port._filesystem.exists(port.abspath_for_test(path)))
        self.assertFalse(path in files)
Пример #3
0
    def test_test_files(self):
        host = MockSystemHost()
        files = {
            '/mock-checkout/LayoutTests/canvas/philip/test.html': '',
            '/mock-checkout/LayoutTests/fast/canvas/test.html': '',
            '/mock-checkout/LayoutTests/fast/html/test.html': '',
            '/mock-checkout/LayoutTests/media/test.html': '',
            '/mock-checkout/LayoutTests/foo/bar.html': '',
        }
        host.filesystem = MockFileSystem(files)

        def test_paths(port_name):
            return PortFactory(host).get(port_name).tests([])

        self.assertEqual(test_paths('chromium-gpu-linux'), set(['canvas/philip/test.html', 'fast/canvas/test.html', 'media/test.html']))
        self.assertEqual(test_paths('chromium-gpu-mac-leopard'), set(['canvas/philip/test.html', 'fast/canvas/test.html']))
Пример #4
0
    def assert_port_works(self, port_name, input_name=None, platform=None):
        host = MockSystemHost()
        host.filesystem = FileSystem()  # FIXME: This test should not use a real filesystem!

        # test that we got the right port
        mock_options = MockOptions(accelerated_2d_canvas=None,
                                   accelerated_video=None,
                                   builder_name='foo',
                                   child_processes=None)
        if input_name and platform:
            port = PortFactory(host).get(host, platform=platform, port_name=input_name, options=mock_options)
        else:
            port = PortFactory(host).get(host, port_name=port_name, options=mock_options)
        self.assertTrue(port._options.accelerated_2d_canvas)
        self.assertTrue(port._options.accelerated_video)
        self.assertTrue(port._options.experimental_fully_parallel)
        self.assertEqual(port._options.builder_name, 'foo - GPU')

        self.assertTrue(port.name().startswith(port_name))

        # test that it has the right directories in front of the search path.
        paths = port.baseline_search_path()
        self.assertEqual(port._webkit_baseline_path(port_name), paths[0])
        if port_name == 'chromium-gpu-linux':
            self.assertEqual(port._webkit_baseline_path('chromium-gpu-win'), paths[1])
            self.assertEqual(port._webkit_baseline_path('chromium-gpu'), paths[2])
        else:
            self.assertEqual(port._webkit_baseline_path('chromium-gpu'), paths[1])

        # Test that we're limiting to the correct directories.
        # These two tests are picked mostly at random, but we make sure they
        # exist separately from being filtered out by the port.

        # Note that this is using a real filesystem.
        files = port.tests(None)

        path = 'fast/html/keygen.html'
        self.assertTrue(port._filesystem.exists(port.abspath_for_test(path)))
        self.assertFalse(path in files)
Пример #5
0
    def test_test_files(self):
        host = MockSystemHost()
        files = {
            '/mock-checkout/LayoutTests/canvas/philip/test.html': '',
            '/mock-checkout/LayoutTests/fast/canvas/test.html': '',
            '/mock-checkout/LayoutTests/fast/html/test.html': '',
            '/mock-checkout/LayoutTests/media/test.html': '',
            '/mock-checkout/LayoutTests/foo/bar.html': '',
        }
        host.filesystem = MockFileSystem(files)

        def test_paths(port_name):
            return PortFactory(host).get(port_name).tests([])

        self.assertEqual(
            test_paths('chromium-gpu-linux'),
            set([
                'canvas/philip/test.html', 'fast/canvas/test.html',
                'media/test.html'
            ]))
        self.assertEqual(
            test_paths('chromium-gpu-mac-leopard'),
            set(['canvas/philip/test.html', 'fast/canvas/test.html']))