当前位置: 首页>>代码示例>>Python>>正文


Python MarionetteTestCase.setUp方法代码示例

本文整理汇总了Python中marionette_harness.MarionetteTestCase.setUp方法的典型用法代码示例。如果您正苦于以下问题:Python MarionetteTestCase.setUp方法的具体用法?Python MarionetteTestCase.setUp怎么用?Python MarionetteTestCase.setUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在marionette_harness.MarionetteTestCase的用法示例。


在下文中一共展示了MarionetteTestCase.setUp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

# 需要导入模块: from marionette_harness import MarionetteTestCase [as 别名]
# 或者: from marionette_harness.MarionetteTestCase import setUp [as 别名]
    def setUp(self):
        MarionetteTestCase.setUp(self)

        self.TEST_URL = "https://www.mediawiki.org/wiki/MediaWiki"

        self.ATTRIBUTES = {
                "navigationStart": 0,
                "unloadEventStart": 0,
                "unloadEventEnd": 0,
                "redirectStart": 0,
                "redirectEnd": 0,
                "fetchStart": 0,
                "domainLookupStart": 0,
                "domainLookupEnd": 0,
                "connectStart": 0,
                "connectEnd": 0,
                "secureConnectionStart": 0,
                "requestStart": 0,
                "responseStart": 0,
                "responseEnd": 0,
                "domLoading": 0,
                "domInteractive": 0,
                "domContentLoadedEventStart": 0,
                "domContentLoadedEventEnd": 0,
                "domComplete": 0,
                "loadEventStart": 0,
                "loadEventEnd": 0,
                }
开发者ID:boklm,项目名称:tbb-testsuite,代码行数:30,代码来源:test_navigation-timing.py

示例2: setUp

# 需要导入模块: from marionette_harness import MarionetteTestCase [as 别名]
# 或者: from marionette_harness.MarionetteTestCase import setUp [as 别名]
    def setUp(self):
        MarionetteTestCase.setUp(self)

        ts = testsuite.TestSuite()
        self.ts = ts

        self.URL = 'https://pinning-test.badssl.com/'
开发者ID:boklm,项目名称:tbb-testsuite,代码行数:9,代码来源:test_pinning.py

示例3: setUp

# 需要导入模块: from marionette_harness import MarionetteTestCase [as 别名]
# 或者: from marionette_harness.MarionetteTestCase import setUp [as 别名]
    def setUp(self):
        MarionetteTestCase.setUp(self)

        ts = testsuite.TestSuite()
        self.ts = ts

        self.URL = "file://%s/testfile.pdf" % ts.t['options']['test_data_dir']
开发者ID:boklm,项目名称:tbb-testsuite,代码行数:9,代码来源:test_download_pdf.py

示例4: setUp

# 需要导入模块: from marionette_harness import MarionetteTestCase [as 别名]
# 或者: from marionette_harness.MarionetteTestCase import setUp [as 别名]
    def setUp(self):
        MarionetteTestCase.setUp(self)
        self.setUpScriptData()

        self.reset_profile_path = None
        self.desktop_backup_path = None

        self.createProfileData()
开发者ID:kinetiknz,项目名称:gecko-dev,代码行数:10,代码来源:test_refresh_firefox.py

示例5: setUp

# 需要导入模块: from marionette_harness import MarionetteTestCase [as 别名]
# 或者: from marionette_harness.MarionetteTestCase import setUp [as 别名]
    def setUp(self):
        MarionetteTestCase.setUp(self)

        ts = testsuite.TestSuite()
        self.ts = ts

        self.http_url = "%s/noscript/" % ts.t['options']['test_data_url']
        self.https_url = "%s/noscript/" % ts.t['options']['test_data_url_https']
开发者ID:boklm,项目名称:tbb-testsuite,代码行数:10,代码来源:test_noscript.py

示例6: setUp

# 需要导入模块: from marionette_harness import MarionetteTestCase [as 别名]
# 或者: from marionette_harness.MarionetteTestCase import setUp [as 别名]
 def setUp(self):
     MarionetteTestCase.setUp(self)
     test_url = self.marionette.absolute_url('test.html')
     self.marionette.navigate(test_url)
     self.COOKIE_A = {"name": "foo",
                      "value": "bar",
                      "path": "/",
                      "secure": False}
开发者ID:luke-chang,项目名称:gecko-1,代码行数:10,代码来源:test_cookies.py

示例7: setUp

# 需要导入模块: from marionette_harness import MarionetteTestCase [as 别名]
# 或者: from marionette_harness.MarionetteTestCase import setUp [as 别名]
 def setUp(self):
     MarionetteTestCase.setUp(self)
     self.marionette.enforce_gecko_prefs(
         {"marionette.test.bool": True,
          "marionette.test.string": "testing",
          "marionette.test.int": 3
          })
     self.marionette.set_context("chrome")
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:10,代码来源:test_profile_management.py

示例8: setUp

# 需要导入模块: from marionette_harness import MarionetteTestCase [as 别名]
# 或者: from marionette_harness.MarionetteTestCase import setUp [as 别名]
    def setUp(self):
        MarionetteTestCase.setUp(self)

        ts = testsuite.TestSuite()
        self.ts = ts

        self.HTTP_URL = "http://httpbin.org/"
        self.HTTPS_URL = "https://httpbin.org/"
开发者ID:boklm,项目名称:tbb-testsuite,代码行数:10,代码来源:test_https-everywhere.py

示例9: setUp

# 需要导入模块: from marionette_harness import MarionetteTestCase [as 别名]
# 或者: from marionette_harness.MarionetteTestCase import setUp [as 别名]
    def setUp(self):
        MarionetteTestCase.setUp(self)

        # shortcuts to improve readability of these tests
        self.chrome = self.marionette.CONTEXT_CHROME
        self.content = self.marionette.CONTEXT_CONTENT

        test_url = self.marionette.absolute_url("empty.html")
        self.marionette.navigate(test_url)
        self.marionette.set_context(self.content)
        self.assertEquals(self.get_context(), self.content)
开发者ID:luke-chang,项目名称:gecko-1,代码行数:13,代码来源:test_with_using_context.py

示例10: setUp

# 需要导入模块: from marionette_harness import MarionetteTestCase [as 别名]
# 或者: from marionette_harness.MarionetteTestCase import setUp [as 别名]
    def setUp(self):
        MarionetteTestCase.setUp(self)

        self.pid = self.marionette.process_id
        self.session_id = self.marionette.session_id

        # Use a preference to check that the restart was successful. If its
        # value has not been forced, a restart will cause a reset of it.
        self.assertNotEqual(self.marionette.get_pref("startup.homepage_welcome_url"),
                            "about:")
        self.marionette.set_pref("startup.homepage_welcome_url", "about:")
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:13,代码来源:test_quit_restart.py

示例11: setUp

# 需要导入模块: from marionette_harness import MarionetteTestCase [as 别名]
# 或者: from marionette_harness.MarionetteTestCase import setUp [as 别名]
    def setUp(self):
        MarionetteTestCase.setUp(self)

        ts = testsuite.TestSuite()
        self.ts = ts

        self.test_page_url = ts.t['test']['fpcentral_url']

        if 'timeout' in ts.t['test']:
            self.timeout = ts.t['test']['timeout']
        else:
            self.timeout = 50000
开发者ID:boklm,项目名称:tbb-testsuite,代码行数:14,代码来源:test_fpcentral.py

示例12: setUp

# 需要导入模块: from marionette_harness import MarionetteTestCase [as 别名]
# 或者: from marionette_harness.MarionetteTestCase import setUp [as 别名]
    def setUp(self):
        MarionetteTestCase.setUp(self)
        self.max = self.marionette.execute_script("""
            return {
              width: window.screen.availWidth,
              height: window.screen.availHeight,
            }""", sandbox=None)

        # ensure window is not fullscreen
        actual = self.marionette.set_window_rect(
            width=self.max["width"] - 100, height=self.max["height"] - 100)
        self.assertNotEqual(actual["width"], self.max["width"])
        self.assertNotEqual(actual["height"], self.max["height"])

        self.original_size = actual
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:17,代码来源:test_window_fullscreen.py

示例13: setUp

# 需要导入模块: from marionette_harness import MarionetteTestCase [as 别名]
# 或者: from marionette_harness.MarionetteTestCase import setUp [as 别名]
    def setUp(self):
        MarionetteTestCase.setUp(self)

        ts = testsuite.TestSuite()
        self.ts = ts

        if ts.t['test']['remote']:
            test_data_url = ts.t['options']['test_data_url']
        else:
            test_data_url = "file://%s" % ts.t['options']['test_data_dir']
        self.test_page_url = '%s/%s.html' % (test_data_url, ts.t['test']['name'])

        if ts.t['test']['timeout']:
            self.timeout = ts.t['test']['timeout']
        else:
            self.timeout = 50000
开发者ID:boklm,项目名称:tbb-testsuite,代码行数:18,代码来源:test_page.py

示例14: setUp

# 需要导入模块: from marionette_harness import MarionetteTestCase [as 别名]
# 或者: from marionette_harness.MarionetteTestCase import setUp [as 别名]
    def setUp(self):
        MarionetteTestCase.setUp(self)
        self.logger = mozlog.structured.structuredlog.get_default_logger()
        self.logger.info("setting up!")

        self.marionette.set_context('chrome')

        self._webroot_dir = self.testvars["webRootDir"]
        self._resultsDir = self.testvars["resultsDir"]
        # Be conservative in what we delete automatically.
        for f in glob.glob(os.path.join(self._resultsDir, 'memory-report-*.json.gz')):
            os.unlink(f)
        for f in glob.glob(os.path.join(self._resultsDir, 'perfherder_data.json')):
            os.unlink(f)
        for f in glob.glob(os.path.join(self._resultsDir, 'dmd-*.json.gz')):
            os.unlink(f)

        self._urls = []

        urls = None
        default_tp5n_manifest = os.path.join(self._webroot_dir, 'page_load_test', 'tp5n',
                                             'tp5n.manifest')
        tp5n_manifest = self.testvars.get("pageManifest", default_tp5n_manifest)
        with open(tp5n_manifest) as fp:
            urls = fp.readlines()
        urls = map(lambda x:x.replace('localhost', 'localhost:{}'), urls)

        # Optional testvars.
        self._pages_to_load = self.testvars.get("entities", len(urls))
        self._iterations = self.testvars.get("iterations", ITERATIONS)
        self._perTabPause = self.testvars.get("perTabPause", PER_TAB_PAUSE)
        self._settleWaitTime = self.testvars.get("settleWaitTime", SETTLE_WAIT_TIME)
        self._maxTabs = self.testvars.get("maxTabs", MAX_TABS)
        self._dmd = self.testvars.get("dmd", False)

        self._webservers = webservers.WebServers("localhost",
                                                 8001,
                                                 self._webroot_dir,
                                                 self._pages_to_load)
        self._webservers.start()
        for url, server in zip(urls, self._webservers.servers):
            self._urls.append(url.strip().format(server.port))

        self.logger.info("areweslimyet run by %d pages, %d iterations, %d perTabPause, %d settleWaitTime"
                         % (self._pages_to_load, self._iterations, self._perTabPause, self._settleWaitTime))
        self.reset_state()
        self.logger.info("done setting up!")
开发者ID:luke-chang,项目名称:gecko-1,代码行数:49,代码来源:test_memory_usage.py

示例15: setUp

# 需要导入模块: from marionette_harness import MarionetteTestCase [as 别名]
# 或者: from marionette_harness.MarionetteTestCase import setUp [as 别名]
    def setUp(self):
        MarionetteTestCase.setUp(self)

        ts = testsuite.TestSuite()
        self.ts = ts

        self.expectedObjects = [
                "AbortController",
                "AbortSignal",
                "addEventListener",
                "Array",
                "ArrayBuffer",
                "atob",
                "Blob",
                "Boolean",
                "BroadcastChannel",
                "btoa",
                "Cache",
                "caches",
                "CacheStorage",
                "clearInterval",
                "clearTimeout",
                "close",
                "CloseEvent",
                "console",
                "constructor",
                "createImageBitmap",
                "crypto",
                "Crypto",
                "CustomEvent",
                "DataView",
                "Date",
                "decodeURI",
                "decodeURIComponent",
                "DedicatedWorkerGlobalScope",
                "__defineGetter__",
                "__defineSetter__",
                "Directory",
                "dispatchEvent",
                "DOMCursor",
                "DOMError",
                "DOMException",
                "DOMRequest",
                "DOMStringList",
                "dump",
                "encodeURI",
                "encodeURIComponent",
                "Error",
                "ErrorEvent",
                "escape",
                "eval",
                "EvalError",
                "Event",
                "EventSource",
                "EventTarget",
                "fetch",
                "File",
                "FileList",
                "FileReader",
                "FileReaderSync",
                "Float32Array",
                "Float64Array",
                "FormData",
                "Function",
                "getAllPropertyNames",
                "hasOwnProperty",
                "Headers",
                "IDBCursor",
                "IDBCursorWithValue",
                "IDBDatabase",
                "IDBFactory",
                "IDBIndex",
                "IDBKeyRange",
                "IDBObjectStore",
                "IDBOpenDBRequest",
                "IDBRequest",
                "IDBTransaction",
                "IDBVersionChangeEvent",
                "ImageBitmap",
                "ImageBitmapRenderingContext",
                "ImageData",
                "importScripts",
                "indexedDB",
                "Infinity",
                "Int16Array",
                "Int32Array",
                "Int8Array",
                "InternalError",
                "Intl",
                "isFinite",
                "isNaN",
                "isPrototypeOf",
                "isSecureContext",
                "Iterator",
                "JSON",
                "location",
                "__lookupGetter__",
                "__lookupSetter__",
                "Map",
                "Math",
#.........这里部分代码省略.........
开发者ID:boklm,项目名称:tbb-testsuite,代码行数:103,代码来源:test_dom-objects-enumeration-worker.py


注:本文中的marionette_harness.MarionetteTestCase.setUp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。