本文整理汇总了Python中webkitpy.port.Port类的典型用法代码示例。如果您正苦于以下问题:Python Port类的具体用法?Python Port怎么用?Python Port使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Port类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_driver
def make_driver(self, filesystem=None):
port = Port(MockSystemHost(log_executive=True, filesystem=filesystem), 'westondrivertestport', options=MockOptions(configuration='Release'))
port._config.build_directory = lambda configuration: "/mock_build"
port._server_process_constructor = MockServerProcess
driver = WestonDriver(port, worker_number=0, pixel_tests=True)
driver._startup_delay_secs = 0
return driver
示例2: make_driver
def make_driver(self, filesystem=None):
port = Port(MockSystemHost(log_executive=True, filesystem=filesystem), 'westondrivertestport', options=MockOptions(configuration='Release'))
port._config.build_directory = lambda configuration: "/mock_build"
port._server_process_constructor = MockServerProcess
driver = WestonDriver(port, worker_number=0, pixel_tests=True)
driver._startup_delay_secs = 0
driver._expected_xvfbdisplay = 23
driver._xvfbdriver = WestonXvfbDriverDisplayTest(driver._expected_xvfbdisplay)
driver._environment = port.setup_environ_for_server(port.driver_name())
return driver
示例3: test_is_reference_html_file
def test_is_reference_html_file(self):
filesystem = MockFileSystem()
self.assertTrue(Port.is_reference_html_file(filesystem, '', 'foo-expected.html'))
self.assertTrue(Port.is_reference_html_file(filesystem, '', 'foo-expected-mismatch.xml'))
self.assertTrue(Port.is_reference_html_file(filesystem, '', 'foo-ref.xhtml'))
self.assertTrue(Port.is_reference_html_file(filesystem, '', 'foo-notref.svg'))
self.assertFalse(Port.is_reference_html_file(filesystem, '', 'foo.html'))
self.assertFalse(Port.is_reference_html_file(filesystem, '', 'foo-expected.txt'))
self.assertFalse(Port.is_reference_html_file(filesystem, '', 'foo-expected.shtml'))
self.assertFalse(Port.is_reference_html_file(filesystem, '', 'foo-expected.php'))
self.assertFalse(Port.is_reference_html_file(filesystem, '', 'foo-expected.mht'))
示例4: make_driver
def make_driver(self, worker_number=0, xorg_running=False, executive=None):
port = Port(MockSystemHost(log_executive=True, executive=executive), 'xvfbdrivertestport', options=MockOptions(configuration='Release'))
port._config.build_directory = lambda configuration: "/mock-build"
port._server_process_constructor = MockServerProcess
if xorg_running:
port._executive._running_pids['Xorg'] = 108
driver = XvfbDriver(port, worker_number=worker_number, pixel_tests=True)
driver._startup_delay_secs = 0
driver._xvfb_screen_depth = lambda: '24'
driver._xvfb_pipe = lambda: (3, 4)
driver._xvfb_read_display_id = lambda x: 1
driver._xvfb_close_pipe = lambda p: None
driver._environment = port.setup_environ_for_server(port.driver_name())
return driver
示例5: test_parse_reftest_list
def test_parse_reftest_list(self):
port = self.make_port(with_tests=True)
port.host.filesystem.files["bar/reftest.list"] = "\n".join(
[
"== test.html test-ref.html",
"",
"# some comment",
"!= test-2.html test-notref.html # more comments",
"== test-3.html test-ref.html",
"== test-3.html test-ref2.html",
"!= test-3.html test-notref.html",
]
)
reftest_list = Port._parse_reftest_list(port.host.filesystem, "bar")
self.assertEqual(
reftest_list,
{
"bar/test.html": [("==", "bar/test-ref.html")],
"bar/test-2.html": [("!=", "bar/test-notref.html")],
"bar/test-3.html": [
("==", "bar/test-ref.html"),
("==", "bar/test-ref2.html"),
("!=", "bar/test-notref.html"),
],
},
)
示例6: __init__
def __init__(self, host, port_name=None, **kwargs):
Port.__init__(self, host, port_name or TestPort.default_port_name, **kwargs)
self._tests = unit_test_list()
self._flakes = set()
self._expectations_path = LAYOUT_TEST_DIR + "/platform/test/TestExpectations"
self._results_directory = None
self._operating_system = "mac"
if self._name.startswith("test-win"):
self._operating_system = "win"
elif self._name.startswith("test-linux"):
self._operating_system = "linux"
version_map = {
"test-win-xp": "xp",
"test-win-win7": "win7",
"test-win-vista": "vista",
"test-mac-leopard": "leopard",
"test-mac-snowleopard": "snowleopard",
"test-linux-x86_64": "lucid",
}
self._version = version_map[self._name]
示例7: test_parse_reftest_list
def test_parse_reftest_list(self):
port = self.make_port(with_tests=True)
port.host.filesystem.files['bar/reftest.list'] = "\n".join(["== test.html test-ref.html",
"",
"# some comment",
"!= test-2.html test-notref.html # more comments",
"== test-3.html test-ref.html",
"== test-3.html test-ref2.html",
"!= test-3.html test-notref.html"])
reftest_list = Port._parse_reftest_list(port.host.filesystem, 'bar')
self.assertEqual(reftest_list, {'bar/test.html': [('==', 'bar/test-ref.html')],
'bar/test-2.html': [('!=', 'bar/test-notref.html')],
'bar/test-3.html': [('==', 'bar/test-ref.html'), ('==', 'bar/test-ref2.html'), ('!=', 'bar/test-notref.html')]})
示例8: test_is_test_file
def test_is_test_file(self):
filesystem = MockFileSystem()
self.assertTrue(Port._is_test_file(filesystem, '', 'foo.html'))
self.assertTrue(Port._is_test_file(filesystem, '', 'foo.shtml'))
self.assertTrue(Port._is_test_file(filesystem, '', 'foo.svg'))
self.assertTrue(Port._is_test_file(filesystem, '', 'test-ref-test.html'))
self.assertFalse(Port._is_test_file(filesystem, '', 'foo.png'))
self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected.html'))
self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected.svg'))
self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected.xht'))
self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected-mismatch.html'))
self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected-mismatch.svg'))
self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected-mismatch.xhtml'))
self.assertFalse(Port._is_test_file(filesystem, '', 'foo-ref.html'))
self.assertFalse(Port._is_test_file(filesystem, '', 'foo-notref.html'))
self.assertFalse(Port._is_test_file(filesystem, '', 'foo-notref.xht'))
self.assertFalse(Port._is_test_file(filesystem, '', 'foo-ref.xhtml'))
self.assertFalse(Port._is_test_file(filesystem, '', 'ref-foo.html'))
self.assertFalse(Port._is_test_file(filesystem, '', 'notref-foo.xhr'))
示例9: test_is_test_file
def test_is_test_file(self):
filesystem = MockFileSystem()
self.assertTrue(Port._is_test_file(filesystem, "", "foo.html"))
self.assertTrue(Port._is_test_file(filesystem, "", "foo.shtml"))
self.assertTrue(Port._is_test_file(filesystem, "", "foo.svg"))
self.assertTrue(Port._is_test_file(filesystem, "", "test-ref-test.html"))
self.assertFalse(Port._is_test_file(filesystem, "", "foo.png"))
self.assertFalse(Port._is_test_file(filesystem, "", "foo-expected.html"))
self.assertFalse(Port._is_test_file(filesystem, "", "foo-expected.svg"))
self.assertFalse(Port._is_test_file(filesystem, "", "foo-expected.xht"))
self.assertFalse(Port._is_test_file(filesystem, "", "foo-expected-mismatch.html"))
self.assertFalse(Port._is_test_file(filesystem, "", "foo-expected-mismatch.svg"))
self.assertFalse(Port._is_test_file(filesystem, "", "foo-expected-mismatch.xhtml"))
self.assertFalse(Port._is_test_file(filesystem, "", "foo-ref.html"))
self.assertFalse(Port._is_test_file(filesystem, "", "foo-notref.html"))
self.assertFalse(Port._is_test_file(filesystem, "", "foo-notref.xht"))
self.assertFalse(Port._is_test_file(filesystem, "", "foo-ref.xhtml"))
self.assertFalse(Port._is_test_file(filesystem, "", "ref-foo.html"))
self.assertFalse(Port._is_test_file(filesystem, "", "notref-foo.xhr"))