def _verify_baseline_search_path_startswith(self, port_name, expected_platform_dirs): port = PortFactory(MockSystemHost()).get(port_name=port_name) actual_platform_dirs = [ port._filesystem.basename(path) for path in port.baseline_search_path() ] self.assertEqual(expected_platform_dirs, actual_platform_dirs[0:len(expected_platform_dirs)])
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)
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)
def _verify_baseline_path(self, expected_path, port_name): port = PortFactory(MockSystemHost()).get(port_name=port_name) path = port.baseline_search_path()[0] self.assertEqual(expected_path, port._filesystem.basename(path))
def _verify_baseline_search_path_startswith(self, port_name, expected_platform_dirs): port = PortFactory(MockSystemHost()).get(port_name=port_name) actual_platform_dirs = [port._filesystem.basename(path) for path in port.baseline_search_path()] self.assertEqual(expected_platform_dirs, actual_platform_dirs[0:len(expected_platform_dirs)])