summaryrefslogtreecommitdiffstats
path: root/net/tools
diff options
context:
space:
mode:
authorvollick@google.com <vollick@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-14 19:49:14 +0000
committervollick@google.com <vollick@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-14 19:49:14 +0000
commit792d2072309597d56a51f81c0b5e297c77d5256f (patch)
treecf6e4abec095c9c6852b59878006e4fb58582d42 /net/tools
parentb5717a4f9f66283a9fe04ae1f9a3a89920d5b6b0 (diff)
downloadchromium_src-792d2072309597d56a51f81c0b5e297c77d5256f.zip
chromium_src-792d2072309597d56a51f81c0b5e297c77d5256f.tar.gz
chromium_src-792d2072309597d56a51f81c0b5e297c77d5256f.tar.bz2
Revert 121912 - Implement chrome.experimental.downloads.onChanged
Attempting to fix leak in DownloadProtectionServiceTest.CheckClientDownloadValidateRequest ExtensionDownloadsEventRouter now also observes all DownloadItems and dispatches onChanged events. Download.OnChanged records the percentage of OnDownloadUpdated() calls that are propagated as onChanged events instead of being suppressed. BUG=12133 Review URL: http://codereview.chromium.org/8203005 TBR=benjhayden@chromium.org Review URL: https://chromiumcodereview.appspot.com/9360051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121915 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/tools')
-rwxr-xr-xnet/tools/testserver/testserver.py30
1 files changed, 5 insertions, 25 deletions
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py
index f280333..12882b5 100755
--- a/net/tools/testserver/testserver.py
+++ b/net/tools/testserver/testserver.py
@@ -909,6 +909,9 @@ class TestPageHandler(BasePageHandler):
prefix = self.server.file_root_url
if not self.path.startswith(prefix):
return False
+ # Consume a request body if present.
+ if self.command == 'POST' or self.command == 'PUT' :
+ self.ReadRequestBody()
return self._FileHandlerHelper(prefix)
def PostOnlyFileHandler(self):
@@ -916,33 +919,12 @@ class TestPageHandler(BasePageHandler):
prefix = urlparse.urljoin(self.server.file_root_url, 'post/')
if not self.path.startswith(prefix):
return False
+ self.ReadRequestBody()
return self._FileHandlerHelper(prefix)
def _FileHandlerHelper(self, prefix):
- request_body = ''
- if self.command == 'POST' or self.command == 'PUT':
- # Consume a request body if present.
- request_body = self.ReadRequestBody()
-
+ old_protocol_version = self.protocol_version
_, _, url_path, _, query, _ = urlparse.urlparse(self.path)
- query_dict = cgi.parse_qs(query)
-
- expected_body = query_dict.get('expected_body', [])
- if expected_body and request_body not in expected_body:
- self.send_response(404)
- self.end_headers()
- self.wfile.write('')
- return True
-
- expected_headers = query_dict.get('expected_headers', [])
- for expected_header in expected_headers:
- header_name, expected_value = expected_header.split(':')
- if self.headers.getheader(header_name) != expected_value:
- self.send_response(404)
- self.end_headers()
- self.wfile.write('')
- return True
-
sub_path = url_path[len(prefix):]
entries = sub_path.split('/')
file_path = os.path.join(self.server.data_dir, *entries)
@@ -960,8 +942,6 @@ class TestPageHandler(BasePageHandler):
data = self._ReplaceFileData(data, query)
- old_protocol_version = self.protocol_version
-
# If file.mock-http-headers exists, it contains the headers we
# should send. Read them in and parse them.
headers_path = file_path + '.mock-http-headers'