當前位置: 首頁>>代碼示例>>Python>>正文


Python port.Port類代碼示例

本文整理匯總了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
開發者ID:Happy-Ferret,項目名稱:webkit.js,代碼行數:8,代碼來源:westondriver_unittest.py

示例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
開發者ID:Comcast,項目名稱:WebKitForWayland,代碼行數:11,代碼來源:westondriver_unittest.py

示例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'))
開發者ID:Comcast,項目名稱:WebKitForWayland,代碼行數:11,代碼來源:base_unittest.py

示例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
開發者ID:edcwconan,項目名稱:webkit,代碼行數:15,代碼來源:xvfbdriver_unittest.py

示例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"),
                ],
            },
        )
開發者ID:BennyH26,項目名稱:phantomjs,代碼行數:27,代碼來源:base_unittest.py

示例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]
開發者ID:Comcast,項目名稱:WebKitForWayland,代碼行數:22,代碼來源:test.py

示例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')]})
開發者ID:Comcast,項目名稱:WebKitForWayland,代碼行數:14,代碼來源:base_unittest.py

示例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'))
開發者ID:Comcast,項目名稱:WebKitForWayland,代碼行數:19,代碼來源:base_unittest.py

示例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"))
開發者ID:BennyH26,項目名稱:phantomjs,代碼行數:19,代碼來源:base_unittest.py


注:本文中的webkitpy.port.Port類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。