Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: telemetry/telemetry/testing/serially_executed_browser_test_case.py

Issue 2346773002: Revert of "[telemetry] Wire TsProxy through telemetry's network stack." (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « telemetry/telemetry/testing/fakes/__init__.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import unittest 5 import unittest
6 6
7 from catapult_base import cloud_storage 7 from catapult_base import cloud_storage
8 from telemetry.internal.browser import browser_finder 8 from telemetry.internal.browser import browser_finder
9 from telemetry.testing import options_for_unittests 9 from telemetry.testing import options_for_unittests
10 from telemetry.util import wpr_modes 10 from telemetry.util import wpr_modes
(...skipping 28 matching lines...) Expand all
39 def SetBrowserOptions(cls, browser_options): 39 def SetBrowserOptions(cls, browser_options):
40 """Sets the browser option for the browser to create. 40 """Sets the browser option for the browser to create.
41 41
42 Args: 42 Args:
43 browser_options: Browser options object for the browser we want to test. 43 browser_options: Browser options object for the browser we want to test.
44 """ 44 """
45 cls._browser_options = browser_options 45 cls._browser_options = browser_options
46 cls._browser_to_create = browser_finder.FindBrowser(browser_options) 46 cls._browser_to_create = browser_finder.FindBrowser(browser_options)
47 if not cls.platform: 47 if not cls.platform:
48 cls.platform = cls._browser_to_create.platform 48 cls.platform = cls._browser_to_create.platform
49 cls.platform.network_controller.InitializeIfNeeded()
49 else: 50 else:
50 assert cls.platform == cls._browser_to_create.platform, ( 51 assert cls.platform == cls._browser_to_create.platform, (
51 'All browser launches within same test suite must use browsers on ' 52 'All browser launches within same test suite must use browsers on '
52 'the same platform') 53 'the same platform')
53 54
54 @classmethod 55 @classmethod
55 def StartWPRServer(cls, archive_path=None, archive_bucket=None): 56 def StartWPRServer(cls, archive_path=None, archive_bucket=None):
56 """Start a webpage replay server. 57 """Start a webpage replay server.
57 58
58 Args: 59 Args:
(...skipping 26 matching lines...) Expand all
85 @classmethod 86 @classmethod
86 def StopBrowser(cls): 87 def StopBrowser(cls):
87 assert cls.browser, 'Browser is not started' 88 assert cls.browser, 'Browser is not started'
88 cls.browser.Close() 89 cls.browser.Close()
89 cls.browser = None 90 cls.browser = None
90 91
91 @classmethod 92 @classmethod
92 def tearDownClass(cls): 93 def tearDownClass(cls):
93 if cls.platform: 94 if cls.platform:
94 cls.platform.StopAllLocalServers() 95 cls.platform.StopAllLocalServers()
96 cls.platform.network_controller.Close()
95 if cls.browser: 97 if cls.browser:
96 cls.StopBrowser() 98 cls.StopBrowser()
97 99
98 @classmethod 100 @classmethod
99 def SetStaticServerDir(cls, dir_path): 101 def SetStaticServerDir(cls, dir_path):
100 assert cls.platform 102 assert cls.platform
101 cls.platform.SetHTTPServerDirectories(dir_path) 103 cls.platform.SetHTTPServerDirectories(dir_path)
102 104
103 @classmethod 105 @classmethod
104 def UrlOfStaticFilePath(cls, file_path): 106 def UrlOfStaticFilePath(cls, file_path):
105 return cls.platform.http_server.UrlOf(file_path) 107 return cls.platform.http_server.UrlOf(file_path)
OLDNEW
« no previous file with comments | « telemetry/telemetry/testing/fakes/__init__.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698