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

Unified Diff: tools/telemetry/telemetry/core/backends/chrome_inspector/devtools_http_unittest.py

Issue 980073006: Telemetry: devtools_http should reuse its http connection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from dtu, round two. Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/telemetry/telemetry/core/backends/chrome_inspector/devtools_http.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/backends/chrome_inspector/devtools_http_unittest.py
diff --git a/tools/telemetry/telemetry/core/backends/chrome_inspector/devtools_http_unittest.py b/tools/telemetry/telemetry/core/backends/chrome_inspector/devtools_http_unittest.py
index 6e854f7751a29aca46fc7581bbe1aed4c986b365..e148b59051259330c7b078d40a73b5b008671044 100644
--- a/tools/telemetry/telemetry/core/backends/chrome_inspector/devtools_http_unittest.py
+++ b/tools/telemetry/telemetry/core/backends/chrome_inspector/devtools_http_unittest.py
@@ -10,44 +10,13 @@ import urllib2
from telemetry.core.backends.chrome_inspector import devtools_http
-_original_proxy_handler = urllib2.ProxyHandler
-
class DevToolsHttpTest(unittest.TestCase):
def testUrlError(self):
- class FakeProxyHandler(object):
- def __init__(self, *_, **__):
- raise urllib2.URLError('Test')
-
- urllib2.ProxyHandler = FakeProxyHandler
- try:
- with self.assertRaises(devtools_http.DevToolsClientUrlError):
- devtools_http.DevToolsHttp(1000).Request('')
- finally:
- urllib2.ProxyHandler = _original_proxy_handler
+ with self.assertRaises(devtools_http.DevToolsClientUrlError):
+ devtools_http.DevToolsHttp(1000).Request('')
def testSocketError(self):
- class FakeProxyHandler(object):
- def __init__(self, *_, **__):
- raise socket.error
-
- urllib2.ProxyHandler = FakeProxyHandler
- try:
- with self.assertRaises(devtools_http.DevToolsClientConnectionError) as e:
- devtools_http.DevToolsHttp(1000).Request('')
- self.assertNotIsInstance(e, devtools_http.DevToolsClientUrlError)
- finally:
- urllib2.ProxyHandler = _original_proxy_handler
-
- def testBadStatusLine(self):
- class FakeProxyHandler(object):
- def __init__(self, *_, **__):
- raise httplib.BadStatusLine('Test')
-
- urllib2.ProxyHandler = FakeProxyHandler
- try:
- with self.assertRaises(devtools_http.DevToolsClientConnectionError) as e:
- devtools_http.DevToolsHttp(1000).Request('')
- self.assertNotIsInstance(e, devtools_http.DevToolsClientUrlError)
- finally:
- urllib2.ProxyHandler = _original_proxy_handler
+ with self.assertRaises(devtools_http.DevToolsClientConnectionError) as e:
+ devtools_http.DevToolsHttp(1000).Request('')
+ self.assertnotisinstance(e, devtools_http.devtoolsclienturlerror)
« no previous file with comments | « tools/telemetry/telemetry/core/backends/chrome_inspector/devtools_http.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698